summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xadaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java5
-rwxr-xr-xadaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java4
-rwxr-xr-xadaptors/sql-resource/provider/pom.xml14
-rwxr-xr-xadaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java21
-rwxr-xr-xnorthbound/dmaap-listener/pom.xml1
-rw-r--r--northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncEsrDmaapReceiver.java11
-rw-r--r--northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java21
-rw-r--r--northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java10
-rw-r--r--northbound/dmaap-listener/src/test/resources/dmaap-consumer-esrsysteminfo.properties3
-rw-r--r--northbound/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties1
-rwxr-xr-xnorthbound/ueb-listener/pom.xml5
-rwxr-xr-xplugins/grToolkit/provider/pom.xml2
-rw-r--r--plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java4
-rwxr-xr-xplugins/properties-node/provider/pom.xml24
-rw-r--r--plugins/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java10
15 files changed, 49 insertions, 87 deletions
diff --git a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java
index 3ededcc54..6083e89ba 100755
--- a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java
+++ b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java
@@ -31,6 +31,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.lang.reflect.Field;
+import java.lang.reflect.InaccessibleObjectException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@@ -173,6 +174,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
}
}
+ /** This does not work in Java 17
try {
Field methodsField = HttpURLConnection.class.getDeclaredField("methods");
methodsField.setAccessible(true);
@@ -184,7 +186,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
// remove the "final" modifier
modifiersField.setInt(methodsField, methodsField.getModifiers() & ~Modifier.FINAL);
- /* valid HTTP methods */
+ // valid HTTP methods
String[] methods = {
"GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE", "PATCH"
};
@@ -194,6 +196,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
} catch (SecurityException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {
LOG.warn("Adding PATCH method", e);
}
+ **/
LOG.info("AAIResource.ctor initialized.");
}
diff --git a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java
index 14206288d..f69020f75 100755
--- a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java
+++ b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java
@@ -314,6 +314,7 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
LOG.info("AAIResource.ctor initialized.");
+ /* Not permitted in Java 17
try {
Field methodsField = HttpURLConnection.class.getDeclaredField("methods");
methodsField.setAccessible(true);
@@ -325,7 +326,7 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
// remove the "final" modifier
modifiersField.setInt(methodsField, methodsField.getModifiers() & ~Modifier.FINAL);
- /* valid HTTP methods */
+ // valid HTTP methods
String[] methods = {
"GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE", "PATCH"
};
@@ -335,6 +336,7 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
} catch (SecurityException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {
LOG.error("Exception occured", e);
}
+ */
}
diff --git a/adaptors/sql-resource/provider/pom.xml b/adaptors/sql-resource/provider/pom.xml
index 4a53413cb..c6d256d34 100755
--- a/adaptors/sql-resource/provider/pom.xml
+++ b/adaptors/sql-resource/provider/pom.xml
@@ -79,4 +79,18 @@
<scope>provided</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <SDNC_CONFIG_DIR>${basedir}/src/test/resources</SDNC_CONFIG_DIR>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java b/adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java
index 6436f1ef1..4b97e1d5a 100755
--- a/adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java
+++ b/adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java
@@ -36,16 +36,7 @@ public class SqlResourceProviderTest {
@Test
public void testSqlResourceProvider() {
- try{
- Map<String, String> env = System.getenv();
- Class<?> cl = env.getClass();
- Field field = cl.getDeclaredField("m");
- field.setAccessible(true);
- Map<String, String> writableEnv = (Map<String, String>) field.get(env);
- writableEnv.put(SDNC_CONFIG_DIR, "./src/test/resources");
- } catch (Exception e) {
- throw new IllegalStateException("Failed to set environment variable", e);
- }
+
provider = new SqlResourcePropertiesProviderImpl();
assertNotNull(provider);
@@ -59,16 +50,6 @@ public class SqlResourceProviderTest {
@Test
public void testReportSuccess() {
- try{
- Map<String, String> env = System.getenv();
- Class<?> cl = env.getClass();
- Field field = cl.getDeclaredField("m");
- field.setAccessible(true);
- Map<String, String> writableEnv = (Map<String, String>) field.get(env);
- writableEnv.put(SDNC_CONFIG_DIR, "./src/test/resources");
- } catch (Exception e) {
- throw new IllegalStateException("Failed to set environment variable", e);
- }
provider = new SqlResourcePropertiesProviderImpl();
Properties properties = provider.getProperties();
diff --git a/northbound/dmaap-listener/pom.xml b/northbound/dmaap-listener/pom.xml
index 17137bcd0..db426f73c 100755
--- a/northbound/dmaap-listener/pom.xml
+++ b/northbound/dmaap-listener/pom.xml
@@ -162,6 +162,7 @@
<DMAAP_AUTHKEY>ABC123</DMAAP_AUTHKEY>
<ODL_USER>admin</ODL_USER>
<ODL_PASSWORD>admin</ODL_PASSWORD>
+ <DMAAPLISTENERROOT>.</DMAAPLISTENERROOT>
</environmentVariables>
</configuration>
</plugin>
diff --git a/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncEsrDmaapReceiver.java b/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncEsrDmaapReceiver.java
index 623c96426..cd198e1d3 100644
--- a/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncEsrDmaapReceiver.java
+++ b/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncEsrDmaapReceiver.java
@@ -117,16 +117,7 @@ public class TestSdncEsrDmaapReceiver {
e.printStackTrace();
}
- try {
- Map<String, String> env = System.getenv();
- Class<?> cl = env.getClass();
- Field field = cl.getDeclaredField("m");
- field.setAccessible(true);
- Map<String, String> writableEnv = (Map<String, String>) field.get(env);
- writableEnv.put(DMAAPLISTENERROOT, ".");
- } catch (Exception e) {
- throw new IllegalStateException("Failed to set environment variable", e);
- }
+
Properties props = new Properties();
InputStream propStr = TestSdncEsrDmaapReceiver.class.getResourceAsStream("/dmaap-consumer-esrsysteminfo.properties");
diff --git a/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java b/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java
index 620098cb7..bf7b4e236 100644
--- a/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java
+++ b/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncJsonDmaapConsumer.java
@@ -52,16 +52,6 @@ public class TestSdncJsonDmaapConsumer {
e.printStackTrace();
}
- try {
- Map<String, String> env = System.getenv();
- Class<?> cl = env.getClass();
- Field field = cl.getDeclaredField("m");
- field.setAccessible(true);
- Map<String, String> writableEnv = (Map<String, String>) field.get(env);
- writableEnv.put(DMAAPLISTENERROOT, ".");
- } catch (Exception e) {
- throw new IllegalStateException("Failed to set environment variable", e);
- }
String msg = "{\n" +
" \"input\" : { \n" +
@@ -99,17 +89,6 @@ public class TestSdncJsonDmaapConsumer {
e.printStackTrace();
}
- try {
- Map<String, String> env = System.getenv();
- Class<?> cl = env.getClass();
- Field field = cl.getDeclaredField("m");
- field.setAccessible(true);
- Map<String, String> writableEnv = (Map<String, String>) field.get(env);
- writableEnv.put(DMAAPLISTENERROOT, ".");
- } catch (Exception e) {
- throw new IllegalStateException("Failed to set environment variable", e);
- }
-
String msg = "{\n" +
" \"input\" : { \n" +
" }\n" +
diff --git a/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java b/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java
index 11201265d..06876086d 100644
--- a/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java
+++ b/northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestSdncPserverDmaapReceiver.java
@@ -118,16 +118,6 @@ public class TestSdncPserverDmaapReceiver {
e.printStackTrace();
}
- try {
- Map<String, String> env = System.getenv();
- Class<?> cl = env.getClass();
- Field field = cl.getDeclaredField("m");
- field.setAccessible(true);
- Map<String, String> writableEnv = (Map<String, String>) field.get(env);
- writableEnv.put(DMAAPLISTENERROOT, ".");
- } catch (Exception e) {
- throw new IllegalStateException("Failed to set environment variable", e);
- }
Properties props = new Properties();
SdncAaiDmaapConsumer consumer = new SdncAaiDmaapConsumer();
diff --git a/northbound/dmaap-listener/src/test/resources/dmaap-consumer-esrsysteminfo.properties b/northbound/dmaap-listener/src/test/resources/dmaap-consumer-esrsysteminfo.properties
index 785d636bb..6492316fe 100644
--- a/northbound/dmaap-listener/src/test/resources/dmaap-consumer-esrsysteminfo.properties
+++ b/northbound/dmaap-listener/src/test/resources/dmaap-consumer-esrsysteminfo.properties
@@ -31,4 +31,5 @@ sessionstickinessrequired=NO
DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
sdnc.odl.user=${ODL_USER}
sdnc.odl.password=${ODL_PASSWORD}
-sdnc.odl.url-base=http://localhost:8181/restconf/operations \ No newline at end of file
+sdnc.odl.url-base=http://localhost:8181/restconf/operations
+routeOffer=MR1 \ No newline at end of file
diff --git a/northbound/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties b/northbound/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties
index 2fb525e89..6492316fe 100644
--- a/northbound/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties
+++ b/northbound/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties
@@ -32,3 +32,4 @@ DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
sdnc.odl.user=${ODL_USER}
sdnc.odl.password=${ODL_PASSWORD}
sdnc.odl.url-base=http://localhost:8181/restconf/operations
+routeOffer=MR1 \ No newline at end of file
diff --git a/northbound/ueb-listener/pom.xml b/northbound/ueb-listener/pom.xml
index db620937b..293c5ba49 100755
--- a/northbound/ueb-listener/pom.xml
+++ b/northbound/ueb-listener/pom.xml
@@ -93,6 +93,11 @@
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>1.18.24</version>
+ </dependency>
</dependencies>
<build>
diff --git a/plugins/grToolkit/provider/pom.xml b/plugins/grToolkit/provider/pom.xml
index 87f2a789a..e39e17434 100755
--- a/plugins/grToolkit/provider/pom.xml
+++ b/plugins/grToolkit/provider/pom.xml
@@ -150,6 +150,7 @@
<environmentVariables>
<ODL_USER>admin</ODL_USER>
<ODL_PASSWORD>admin</ODL_PASSWORD>
+ <SDNC_CONFIG_DIR>src/test/resources</SDNC_CONFIG_DIR>
</environmentVariables>
</configuration>
</plugin>
@@ -160,6 +161,7 @@
<environmentVariables>
<ODL_USER>admin</ODL_USER>
<ODL_PASSWORD>admin</ODL_PASSWORD>
+ <SDNC_CONFIG_DIR>src/test/resources</SDNC_CONFIG_DIR>
</environmentVariables>
</configuration>
</plugin>
diff --git a/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java b/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java
index 6495c89cf..98e55e50d 100644
--- a/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java
+++ b/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java
@@ -46,7 +46,6 @@ import java.util.stream.Stream;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.contrib.java.lang.system.EnvironmentVariables;
import org.onap.ccsdk.sli.core.dblib.DBLibConnection;
import org.onap.ccsdk.sli.core.dblib.DbLibService;
import org.onap.ccsdk.sli.plugins.grtoolkit.data.ClusterActor;
@@ -81,13 +80,10 @@ public class GrToolkitProviderTest {
Properties properties;
@Rule
- public final EnvironmentVariables environmentVariables = new EnvironmentVariables();
- @Rule
public WireMockRule wireMockRule = new WireMockRule(9999);
@Before
public void setup() {
- environmentVariables.set("SDNC_CONFIG_DIR","src/test/resources");
dataBroker = mock(DataBroker.class);
notificationProviderService = mock(NotificationPublishService.class);
rpcProviderRegistry = mock(RpcProviderService.class);
diff --git a/plugins/properties-node/provider/pom.xml b/plugins/properties-node/provider/pom.xml
index ddae8edca..66b79b14b 100755
--- a/plugins/properties-node/provider/pom.xml
+++ b/plugins/properties-node/provider/pom.xml
@@ -33,17 +33,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.github.stefanbirkner</groupId>
- <artifactId>system-rules</artifactId>
- <version>1.19.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-common</artifactId>
<scope>provided</scope>
@@ -57,4 +46,17 @@
<artifactId>jettison</artifactId>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <deployer_pass>sdncp-123</deployer_pass>
+ </environmentVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/plugins/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java b/plugins/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java
index 34ac4685f..f5259845d 100644
--- a/plugins/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java
+++ b/plugins/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java
@@ -1,13 +1,8 @@
package jtest.org.onap.ccsdk.sli.plugins.prop;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Map;
-import java.util.Set;
-
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.contrib.java.lang.system.EnvironmentVariables;
import static org.junit.Assert.assertEquals;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
@@ -18,8 +13,7 @@ import org.slf4j.LoggerFactory;
public class TestPropertiesNode {
private static final Logger log = LoggerFactory.getLogger(TestPropertiesNode.class);
- @Rule
- public EnvironmentVariables environmentVariables = new EnvironmentVariables();
+
@Test
public void testJSONFileParsing() throws SvcLogicException {
@@ -134,7 +128,7 @@ public class TestPropertiesNode {
@Test
public void testTXTFileParsing() throws SvcLogicException {
- environmentVariables.set("deployer_pass", "sdncp-123");
+
assertEquals("sdncp-123", System.getenv("deployer_pass"));
SvcLogicContext ctx = new SvcLogicContext();