diff options
Diffstat (limited to 'aai-core')
3 files changed, 6 insertions, 4 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java index b7627267..9ce343f6 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java @@ -129,7 +129,7 @@ public class Aggregate extends MultiFormatMapper { json.addProperty(prop.key(), gson.toJson(prop.value())); } else { // throw exception? - return null; + return Optional.empty(); } } } else { @@ -214,7 +214,7 @@ public class Aggregate extends MultiFormatMapper { json.add(inner); } else { Optional<JsonObject> obj = this.getJsonFromVertex((Vertex)l, properties); - json.add(obj.get()); + if(obj.isPresent()) json.add(obj.get()); } } return Optional.of(json); diff --git a/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java b/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java index c2bfabf4..84935cdb 100644 --- a/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java +++ b/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java @@ -93,9 +93,9 @@ public class HttpsAuthClient { ctx = SSLContext.getInstance("TLSv1.2"); KeyManagerFactory kmf = null; - try { + + try(FileInputStream fin = new FileInputStream(keystorePath)) { kmf = KeyManagerFactory.getInstance("SunX509"); - FileInputStream fin = new FileInputStream(keystorePath); KeyStore ks = KeyStore.getInstance("PKCS12"); char[] pwd = keystorePassword.toCharArray(); ks.load(fin, pwd); diff --git a/aai-core/src/test/java/org/onap/aai/audit/ListEndpointsTest.java b/aai-core/src/test/java/org/onap/aai/audit/ListEndpointsTest.java index 5c825242..5d606733 100644 --- a/aai-core/src/test/java/org/onap/aai/audit/ListEndpointsTest.java +++ b/aai-core/src/test/java/org/onap/aai/audit/ListEndpointsTest.java @@ -25,11 +25,13 @@ import org.junit.Before; import org.junit.Test; import org.onap.aai.AAISetup; import org.onap.aai.setup.SchemaVersion; +import org.springframework.test.annotation.DirtiesContext; import java.util.List; import java.util.Map; import java.util.Properties; +@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS) public class ListEndpointsTest extends AAISetup { private Properties properties; |