|
1 |
| -package com.microsoft.azure.functions.worker.broker.tests; |
| 1 | +package com.microsoft.azure.functions.worker.broker; |
2 | 2 |
|
3 | 3 | import com.microsoft.azure.functions.rpc.messages.InvocationRequest;
|
4 | 4 | import com.microsoft.azure.functions.rpc.messages.ParameterBinding;
|
|
7 | 7 | import com.microsoft.azure.functions.worker.reflect.DefaultClassLoaderProvider;
|
8 | 8 | import mockit.*;
|
9 | 9 | import org.junit.Test;
|
| 10 | + |
| 11 | +import java.io.File; |
10 | 12 | import java.util.*;
|
11 | 13 |
|
12 | 14 | import static org.junit.Assert.assertEquals;
|
| 15 | +import static org.junit.Assert.assertTrue; |
13 | 16 |
|
14 | 17 | public class JavaFunctionBrokerTest {
|
15 | 18 |
|
@@ -105,4 +108,26 @@ public void getTriggerMetadataMap_ignored(
|
105 | 108 | // In case of non-http request, it will not modify the triggerMetadata
|
106 | 109 | assertEquals(expectedCount, actualTriggerMetadata.size());
|
107 | 110 | }
|
| 111 | + |
| 112 | + @Test(expected = Exception.class) |
| 113 | + public void checkLibFolderNoWorkerLib() throws Exception { |
| 114 | + JavaFunctionBroker broker = new JavaFunctionBroker(null); |
| 115 | + broker.checkLibFolder(new File(""), null, null); |
| 116 | + } |
| 117 | + |
| 118 | + @Test(expected = Exception.class) |
| 119 | + public void checkLibFolderNoJarsInLib() throws Exception { |
| 120 | + JavaFunctionBroker broker = new JavaFunctionBroker(null); |
| 121 | + String path = "./"; |
| 122 | + File file = new File(path); |
| 123 | + broker.checkLibFolder(file, path, "CLIENT_LIB_FIRST"); |
| 124 | + } |
| 125 | + |
| 126 | + @Test |
| 127 | + public void checkLibFolderNoException() throws Exception { |
| 128 | + JavaFunctionBroker broker = new JavaFunctionBroker(null); |
| 129 | + String path = "./lib_worker_1.6.2"; |
| 130 | + File file = new File(path); |
| 131 | + assertTrue(broker.checkLibFolder(file, path, "CLIENT_LIB_FIRST")); |
| 132 | + } |
108 | 133 | }
|
0 commit comments