summaryrefslogtreecommitdiffstats
path: root/adaptors
diff options
context:
space:
mode:
Diffstat (limited to 'adaptors')
-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
4 files changed, 22 insertions, 22 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();