From ed992e01c17d5677dfa0e1d0a76a7f9bc12c2a90 Mon Sep 17 00:00:00 2001 From: Jimmy Forsyth Date: Tue, 10 Mar 2020 15:21:02 -0400 Subject: [PATCH] Reenable spring-boot2 in aai-common Issue-ID: AAI-2831 Signed-off-by: Jimmy Forsyth Change-Id: I9f3f1d8d1d9ef45786d0f17afa5c824e90c77263 --- aai-aaf-auth/pom.xml | 2 +- .../aai/aaf/filters/AafAuthorizationFilter.java | 2 +- .../aaf/filters/AafCertAuthorizationFilter.java | 2 +- .../org/onap/aai/aaf/filters/AafCertFilter.java | 2 +- .../java/org/onap/aai/aaf/filters/AafFilter.java | 2 +- .../aai/aaf/filters/TwoWaySslAuthorization.java | 2 +- aai-annotations/pom.xml | 2 +- aai-auth/pom.xml | 2 +- aai-common-docker/aai-common-images/pom.xml | 4 +- aai-common-docker/aai-haproxy-image/pom.xml | 4 +- aai-common-docker/pom.xml | 2 +- aai-core/pom.xml | 2 +- .../ValidationServiceNoAuthClient.java | 1 + .../java/org/onap/aai/restcore/util/URITools.java | 32 +++++----- aai-els-onap-logging/pom.xml | 2 +- aai-parent/pom.xml | 56 ++++++++++-------- aai-rest/pom.xml | 2 +- .../org/onap/aai/restclient/NoAuthRestClient.java | 5 +- .../onap/aai/restclient/OneWaySSLRestClient.java | 4 +- .../onap/aai/restclient/TwoWaySSLRestClient.java | 5 +- aai-schema-abstraction/pom.xml | 2 +- .../aai/schemaif/oxm/OxmSchemaProviderTest.java | 68 +++++++++++----------- aai-schema-ingest/pom.xml | 2 +- .../java/org/onap/aai/edges/EdgeIngestorTest.java | 6 +- .../java/org/onap/aai/nodes/NodeIngestorTest.java | 5 +- ...hemaLocationsBeanXMLSetterWithPropFileTest.java | 2 + .../forWiringTests/testUsingPropFileContext.xml | 4 +- aai-utils/pom.xml | 2 +- pom.xml | 3 +- version.properties | 2 +- 30 files changed, 121 insertions(+), 110 deletions(-) diff --git a/aai-aaf-auth/pom.xml b/aai-aaf-auth/pom.xml index 580f56eb..1557fbfb 100644 --- a/aai-aaf-auth/pom.xml +++ b/aai-aaf-auth/pom.xml @@ -6,7 +6,7 @@ org.onap.aai.aai-common aai-parent - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT ../aai-parent/pom.xml aai-aaf-auth diff --git a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafAuthorizationFilter.java b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafAuthorizationFilter.java index 46285396..82651e9f 100644 --- a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafAuthorizationFilter.java +++ b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafAuthorizationFilter.java @@ -23,7 +23,7 @@ package org.onap.aai.aaf.filters; import org.onap.aai.aaf.auth.ResponseFormatter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.web.filter.OrderedRequestContextFilter; +import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component; diff --git a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafCertAuthorizationFilter.java b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafCertAuthorizationFilter.java index 7ec6bb64..e0adf191 100644 --- a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafCertAuthorizationFilter.java +++ b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafCertAuthorizationFilter.java @@ -23,7 +23,7 @@ package org.onap.aai.aaf.filters; import org.onap.aai.aaf.auth.AafRequestFilter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.web.filter.OrderedRequestContextFilter; +import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component; diff --git a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafCertFilter.java b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafCertFilter.java index 71238cfc..7a47b972 100644 --- a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafCertFilter.java +++ b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafCertFilter.java @@ -27,7 +27,7 @@ import org.onap.aaf.cadi.filter.CadiFilter; import org.onap.aai.aaf.auth.AafRequestFilter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.web.filter.OrderedRequestContextFilter; +import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component; diff --git a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafFilter.java b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafFilter.java index 16d9afd2..e6769dda 100644 --- a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafFilter.java +++ b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafFilter.java @@ -26,7 +26,7 @@ import org.onap.aaf.cadi.PropAccess; import org.onap.aaf.cadi.filter.CadiFilter; import org.onap.aai.aaf.auth.ResponseFormatter; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.web.filter.OrderedRequestContextFilter; +import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Component; diff --git a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/TwoWaySslAuthorization.java b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/TwoWaySslAuthorization.java index 0e206c50..150802b8 100644 --- a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/TwoWaySslAuthorization.java +++ b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/TwoWaySslAuthorization.java @@ -26,7 +26,7 @@ import org.onap.aai.aaf.auth.CertUtil; import org.onap.aai.aaf.auth.ResponseFormatter; import org.onap.aai.exceptions.AAIException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.web.filter.OrderedRequestContextFilter; +import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.context.annotation.Profile; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; diff --git a/aai-annotations/pom.xml b/aai-annotations/pom.xml index e11c6196..e4960929 100644 --- a/aai-annotations/pom.xml +++ b/aai-annotations/pom.xml @@ -27,7 +27,7 @@ org.onap.aai.aai-common aai-parent - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT ../aai-parent/pom.xml aai-annotations diff --git a/aai-auth/pom.xml b/aai-auth/pom.xml index 0dbd11ab..12529a4b 100644 --- a/aai-auth/pom.xml +++ b/aai-auth/pom.xml @@ -27,7 +27,7 @@ org.onap.aai.aai-common aai-parent - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT ../aai-parent/pom.xml aai-auth diff --git a/aai-common-docker/aai-common-images/pom.xml b/aai-common-docker/aai-common-images/pom.xml index 31b878b1..e2792e9c 100644 --- a/aai-common-docker/aai-common-images/pom.xml +++ b/aai-common-docker/aai-common-images/pom.xml @@ -25,11 +25,11 @@ org.onap.aai.aai-common aai-common-docker - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT aai-common-images - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT pom aai-aai-common-images Contains dockerfiles for aai-common images (alpine and ubuntu based). diff --git a/aai-common-docker/aai-haproxy-image/pom.xml b/aai-common-docker/aai-haproxy-image/pom.xml index d77f7f62..49a1a328 100644 --- a/aai-common-docker/aai-haproxy-image/pom.xml +++ b/aai-common-docker/aai-haproxy-image/pom.xml @@ -25,11 +25,11 @@ org.onap.aai.aai-common aai-common-docker - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT aai-haproxy-image - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT pom aai-aai-haproxy-image Contains dockerfiles for aai-haproxy image. diff --git a/aai-common-docker/pom.xml b/aai-common-docker/pom.xml index 1eec1141..900667ba 100644 --- a/aai-common-docker/pom.xml +++ b/aai-common-docker/pom.xml @@ -26,7 +26,7 @@ org.onap.aai.aai-common aai-parent - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT ../aai-parent/pom.xml diff --git a/aai-core/pom.xml b/aai-core/pom.xml index 84fb4dc8..6ecc0fb9 100644 --- a/aai-core/pom.xml +++ b/aai-core/pom.xml @@ -28,7 +28,7 @@ limitations under the License. org.onap.aai.aai-common aai-parent - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT ../aai-parent/pom.xml aai-core diff --git a/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationServiceNoAuthClient.java b/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationServiceNoAuthClient.java index d373ae78..6173e4bd 100644 --- a/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationServiceNoAuthClient.java +++ b/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationServiceNoAuthClient.java @@ -26,6 +26,7 @@ import org.onap.aai.restclient.NoAuthRestClient; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; +import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.util.MultiValueMap; diff --git a/aai-core/src/main/java/org/onap/aai/restcore/util/URITools.java b/aai-core/src/main/java/org/onap/aai/restcore/util/URITools.java index a757d3db..fc32f859 100644 --- a/aai-core/src/main/java/org/onap/aai/restcore/util/URITools.java +++ b/aai-core/src/main/java/org/onap/aai/restcore/util/URITools.java @@ -47,25 +47,21 @@ public class URITools { MultivaluedMap result = new MultivaluedHashMap<>(); String queryParams = uri.getRawQuery(); if (queryParams != null) { - try { - String[] sections = queryParams.split("&"); - String[] query = null; - String key, value = ""; - for (String section : sections) { - query = section.split("="); - key = UriUtils.decode(query[0], "UTF-8"); - if (query[1] != null) { - query[1] = query[1].replaceAll("\\+", "%20"); - } - value = UriUtils.decode(query[1], "UTF-8"); - if (result.containsKey(key)) { - result.add(key, value); - } else { - result.putSingle(key, value); - } + String[] sections = queryParams.split("&"); + String[] query = null; + String key, value = ""; + for (String section : sections) { + query = section.split("="); + key = UriUtils.decode(query[0], "UTF-8"); + if (query[1] != null) { + query[1] = query[1].replaceAll("\\+", "%20"); + } + value = UriUtils.decode(query[1], "UTF-8"); + if (result.containsKey(key)) { + result.add(key, value); + } else { + result.putSingle(key, value); } - } catch (UnsupportedEncodingException e) { - } } return result; diff --git a/aai-els-onap-logging/pom.xml b/aai-els-onap-logging/pom.xml index 2dcc6f61..d91ac3b5 100644 --- a/aai-els-onap-logging/pom.xml +++ b/aai-els-onap-logging/pom.xml @@ -6,7 +6,7 @@ org.onap.aai.aai-common aai-parent - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT ../aai-parent/pom.xml aai-els-onap-logging diff --git a/aai-parent/pom.xml b/aai-parent/pom.xml index 1a237e82..0adb0000 100644 --- a/aai-parent/pom.xml +++ b/aai-parent/pom.xml @@ -1,33 +1,33 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.onap.aai.aai-common aai-common - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT aai-parent aai-parent @@ -101,7 +101,7 @@ 1.7.25 1.2.17 1.10.19 - 2.15.0 + 1.10.19 4.1.43.Final 4.0.56.Final 3.1 @@ -110,11 +110,11 @@ 0.9.10 1.25 - 1.5.22.RELEASE + 2.1.12.RELEASE 3.1.0 1.2 - + @@ -129,9 +129,9 @@ 3.7.0.1746 - 4.3.25.RELEASE - 4.3.25.RELEASE - 4.3.25.RELEASE + 5.1.13.RELEASE + 5.1.13.RELEASE + 5.1.13.RELEASE 1.0.8.RELEASE 1.1.1 2.0.4 @@ -142,6 +142,12 @@ spring-boot-2-1 + + 2.1.12.RELEASE + + + + spring-boot-1-5 1.5.22.RELEASE diff --git a/aai-rest/pom.xml b/aai-rest/pom.xml index 89d3d3c2..d89fe0a7 100644 --- a/aai-rest/pom.xml +++ b/aai-rest/pom.xml @@ -29,7 +29,7 @@ org.onap.aai.aai-common aai-parent - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT ../aai-parent/pom.xml aai-rest diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/NoAuthRestClient.java b/aai-rest/src/main/java/org/onap/aai/restclient/NoAuthRestClient.java index 68ff3e5e..b11b0333 100644 --- a/aai-rest/src/main/java/org/onap/aai/restclient/NoAuthRestClient.java +++ b/aai-rest/src/main/java/org/onap/aai/restclient/NoAuthRestClient.java @@ -26,6 +26,7 @@ import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; import org.onap.aai.aailog.filter.RestClientLoggingInterceptor; import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; @@ -39,8 +40,8 @@ public abstract class NoAuthRestClient extends RestClient { @PostConstruct public void init() throws Exception { - restTemplate = - new RestTemplateBuilder().requestFactory(this.getHttpRequestFactory()).build(); + restTemplate = new RestTemplate(); + restTemplate.setRequestFactory(this.getHttpRequestFactory()); restTemplate.setErrorHandler(new RestClientResponseErrorHandler()); RestClientLoggingInterceptor loggingInterceptor = new RestClientLoggingInterceptor(); restTemplate.getInterceptors().add(loggingInterceptor); diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/OneWaySSLRestClient.java b/aai-rest/src/main/java/org/onap/aai/restclient/OneWaySSLRestClient.java index b2534f57..5c359e27 100644 --- a/aai-rest/src/main/java/org/onap/aai/restclient/OneWaySSLRestClient.java +++ b/aai-rest/src/main/java/org/onap/aai/restclient/OneWaySSLRestClient.java @@ -42,8 +42,8 @@ public abstract class OneWaySSLRestClient extends RestClient { @PostConstruct public void init() throws Exception { - restTemplate = - new RestTemplateBuilder().requestFactory(this.getHttpRequestFactory()).build(); + restTemplate = new RestTemplate(); + restTemplate.setRequestFactory(this.getHttpRequestFactory()); restTemplate.setErrorHandler(new RestClientResponseErrorHandler()); RestClientLoggingInterceptor loggingInterceptor = new RestClientLoggingInterceptor(); diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/TwoWaySSLRestClient.java b/aai-rest/src/main/java/org/onap/aai/restclient/TwoWaySSLRestClient.java index 58ee79f1..f43d21c8 100644 --- a/aai-rest/src/main/java/org/onap/aai/restclient/TwoWaySSLRestClient.java +++ b/aai-rest/src/main/java/org/onap/aai/restclient/TwoWaySSLRestClient.java @@ -48,9 +48,8 @@ public abstract class TwoWaySSLRestClient extends RestClient { @PostConstruct public void init() throws Exception { - restTemplate = - new RestTemplateBuilder().requestFactory(this.getHttpRequestFactory()).build(); - + restTemplate = new RestTemplate(); + restTemplate.setRequestFactory(this.getHttpRequestFactory()); restTemplate.setErrorHandler(new RestClientResponseErrorHandler()); RestClientLoggingInterceptor loggingInterceptor = new RestClientLoggingInterceptor(); restTemplate.getInterceptors().add(loggingInterceptor); diff --git a/aai-schema-abstraction/pom.xml b/aai-schema-abstraction/pom.xml index 9c0eacde..a0f42deb 100644 --- a/aai-schema-abstraction/pom.xml +++ b/aai-schema-abstraction/pom.xml @@ -28,7 +28,7 @@ org.onap.aai.aai-common aai-parent - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT ../aai-parent/pom.xml diff --git a/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java b/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java index 6c7364ae..6cfb5a7d 100644 --- a/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java +++ b/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java @@ -30,14 +30,14 @@ import java.util.Set; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.runners.MockitoJUnitRunner; import org.onap.aai.schemaif.SchemaProviderException; import org.onap.aai.schemaif.definitions.EdgeSchema; import org.onap.aai.schemaif.definitions.PropertySchema; import org.onap.aai.schemaif.definitions.VertexSchema; import org.onap.aai.schemaif.definitions.types.DataType.Type; -@RunWith(MockitoJUnitRunner.Silent.class) +@RunWith(MockitoJUnitRunner.class) public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { @Test @@ -49,15 +49,15 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { VertexSchema vertSchema = schemaProvider.getVertexSchema("pserver", schemaProvider.getLatestSchemaVersion()); System.out.println(vertSchema.toString()); - EdgeSchema edgeSchema = schemaProvider.getEdgeSchema("org.onap.relationships.inventory.LocatedIn", + EdgeSchema edgeSchema = schemaProvider.getEdgeSchema("org.onap.relationships.inventory.LocatedIn", "cloud-region", "zone", schemaProvider.getLatestSchemaVersion()); System.out.println(edgeSchema.toString()); - + // Validate vertex schema assertTrue(vertSchema.getName().equals("pserver")); assertTrue(vertSchema.getAnnotationValue("nameProps").equals("pserver-name2")); assertTrue(vertSchema.getAnnotationValue("dependentOn") == null); - + PropertySchema propSchema = vertSchema.getPropertySchema("hostname"); assertTrue(propSchema.getName().equals("hostname")); assertTrue(propSchema.getDefaultValue().equals("")); @@ -66,7 +66,7 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { assertTrue(propSchema.getDataType().getType().compareTo(Type.STRING) == 0); Object obj = propSchema.validateValue("somestring"); assertTrue(obj instanceof String); - + propSchema = vertSchema.getPropertySchema("in-maint"); assertTrue(propSchema.getName().equals("in-maint")); assertTrue(propSchema.getDefaultValue().equals("false")); @@ -79,8 +79,8 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { obj = propSchema.validateValue("false"); assertTrue(obj instanceof Boolean); assertTrue(propSchema.getDataType().validateValue("badValue") == null); - - + + propSchema = vertSchema.getPropertySchema("aai-node-type"); assertTrue(propSchema.getName().equals("aai-node-type")); assertTrue(propSchema.getDefaultValue().equals("")); @@ -88,7 +88,7 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { assertTrue(!propSchema.isKey()); assertTrue(propSchema.isReserved()); assertTrue(propSchema.getDataType().getType().compareTo(Type.STRING) == 0); - + propSchema = vertSchema.getPropertySchema("pserver-id"); assertTrue(propSchema.getName().equals("pserver-id")); assertTrue(propSchema.getDefaultValue().equals("")); @@ -96,7 +96,7 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { assertTrue(!propSchema.isReserved()); assertTrue(propSchema.isKey()); assertTrue(propSchema.getDataType().getType().compareTo(Type.STRING) == 0); - + propSchema = vertSchema.getPropertySchema("number-of-cpus"); assertTrue(propSchema.getName().equals("number-of-cpus")); assertTrue(propSchema.getAnnotationValue("source-of-truth-type").equals("openstack")); @@ -107,7 +107,7 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { assertTrue(obj instanceof Integer); assertTrue(propSchema.getDataType().validateValue("5.5") == null); assertTrue(propSchema.getDataType().validateValue("xyz") == null); - + // Validate edge schema assertTrue(edgeSchema.getName().equals("org.onap.relationships.inventory.LocatedIn")); assertTrue(edgeSchema.getSource().equals("cloud-region")); @@ -115,7 +115,7 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { assertTrue(edgeSchema.getMultiplicity().equals(EdgeSchema.Multiplicity.MANY_2_ONE)); assertTrue(edgeSchema.getAnnotationValue("contains-other-v").equals("NONE")); assertTrue(edgeSchema.getPropertySchema("prevent-delete").getDataType().getType().equals(Type.STRING)); - + // Validate 'dependentOn' annotation vertSchema = schemaProvider.getVertexSchema("tenant", schemaProvider.getLatestSchemaVersion()); assertTrue(vertSchema.getAnnotationValue("dependentOn").equals("cloud-region")); @@ -128,19 +128,19 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { assertTrue(false); } } - + @Test public void testAdjacentEdges() throws SchemaProviderException { try { OxmSchemaProvider schemaProvider = new OxmSchemaProvider(); schemaProvider.loadSchema(); - Set edgeSchemaList = + Set edgeSchemaList = schemaProvider.getAdjacentEdgeSchema("snapshot", schemaProvider.getLatestSchemaVersion()); - + // Validate edge schema assertTrue(edgeSchemaList.size() == 2); - + for (EdgeSchema es : edgeSchemaList) { System.out.println(es.toString()); if (es.getName().equals("org.onap.relationships.inventory.BelongsTo")) { @@ -166,15 +166,15 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { assertTrue(false); } } - + @Test public void testValidSourceTargetEdge() throws SchemaProviderException { try { OxmSchemaProvider schemaProvider = new OxmSchemaProvider(); schemaProvider.loadSchema(); - Set edgeSchemaList = - schemaProvider.getEdgeSchemaForSourceTarget("service-instance", "customer", + Set edgeSchemaList = + schemaProvider.getEdgeSchemaForSourceTarget("service-instance", "customer", schemaProvider.getLatestSchemaVersion()); // Validate edge schema @@ -183,14 +183,14 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { assertTrue(edgeSchemaList.iterator().next().getSource().equals("service-instance")); assertTrue(edgeSchemaList.iterator().next().getTarget().equals("customer")); assertTrue(edgeSchemaList.iterator().next().getMultiplicity().equals(EdgeSchema.Multiplicity.MANY_2_MANY)); - - edgeSchemaList = - schemaProvider.getEdgeSchemaForSourceTarget("cloud-region", "complex", + + edgeSchemaList = + schemaProvider.getEdgeSchemaForSourceTarget("cloud-region", "complex", schemaProvider.getLatestSchemaVersion()); - + // Validate edge schema assertTrue(edgeSchemaList.size() == 2); - + for (EdgeSchema es : edgeSchemaList) { System.out.println(es.toString()); if (es.getName().equals("org.onap.relationships.inventory.FoundIn")) { @@ -207,11 +207,11 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { assertTrue(false); } } - - edgeSchemaList = - schemaProvider.getEdgeSchemaForSourceTarget("cloud-region", "bad-node", + + edgeSchemaList = + schemaProvider.getEdgeSchemaForSourceTarget("cloud-region", "bad-node", schemaProvider.getLatestSchemaVersion()); - + // Validate edge schema assertTrue(edgeSchemaList.size() == 0); } @@ -223,23 +223,23 @@ public class OxmSchemaProviderTest extends OxmSchemaServiceSetup { assertTrue(false); } } - + @Test public void testInvalidVertexOrEdge() throws SchemaProviderException { try { OxmSchemaProvider schemaProvider = new OxmSchemaProvider(); schemaProvider.loadSchema(); - VertexSchema vertSchema = + VertexSchema vertSchema = schemaProvider.getVertexSchema("bad-node", schemaProvider.getLatestSchemaVersion()); assertTrue(vertSchema == null); - EdgeSchema edgeSchema = schemaProvider.getEdgeSchema("org.onap.relationships.inventory.LocatedIn", + EdgeSchema edgeSchema = schemaProvider.getEdgeSchema("org.onap.relationships.inventory.LocatedIn", "cloud-region", "bad-node", schemaProvider.getLatestSchemaVersion()); assertTrue(edgeSchema == null); - - Set edgeSchemaList = - schemaProvider.getAdjacentEdgeSchema("org.onap.nodes.bad-node", + + Set edgeSchemaList = + schemaProvider.getAdjacentEdgeSchema("org.onap.nodes.bad-node", schemaProvider.getLatestSchemaVersion()); assertTrue(edgeSchemaList.isEmpty()); } diff --git a/aai-schema-ingest/pom.xml b/aai-schema-ingest/pom.xml index 3e21f455..2b257585 100644 --- a/aai-schema-ingest/pom.xml +++ b/aai-schema-ingest/pom.xml @@ -26,7 +26,7 @@ limitations under the License. org.onap.aai.aai-common aai-parent - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT ../aai-parent/pom.xml aai-schema-ingest diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java index 8fdce62b..a9cd1f74 100644 --- a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java +++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java @@ -50,8 +50,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {MockProvider.class, EdgesConfiguration.class}) @TestPropertySource( - properties = {"schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties"}) - + properties = { + "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties", + "spring.main.allow-bean-definition-overriding=true" + }) @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS) @SpringBootTest public class EdgeIngestorTest { diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java index 7035affd..dc4e1e46 100644 --- a/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java +++ b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java @@ -51,7 +51,10 @@ import org.w3c.dom.Document; @RunWith(SpringJUnit4ClassRunner.class) @TestPropertySource( - properties = {"schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-ss-wiring-test.properties"}) + properties = { + "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-ss-wiring-test.properties", + "spring.main.allow-bean-definition-overriding=true" + }) @ContextConfiguration(classes = {MockProvider.class, NodesConfiguration.class}) @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS) diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java index af94765f..2a5068f2 100644 --- a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java +++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java @@ -23,12 +23,14 @@ package org.onap.aai.setup; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +@Ignore("Support of schema ingest via context configuration with prop file is removed as it won't work with spring boot 2") @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath:forWiringTests/testUsingPropFileContext.xml"}) public class SchemaLocationsBeanXMLSetterWithPropFileTest { diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml b/aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml index 1d3e61e4..b4e2c026 100644 --- a/aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml +++ b/aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml @@ -14,6 +14,6 @@ - + - \ No newline at end of file + diff --git a/aai-utils/pom.xml b/aai-utils/pom.xml index 17a15256..5acbb109 100644 --- a/aai-utils/pom.xml +++ b/aai-utils/pom.xml @@ -29,7 +29,7 @@ org.onap.aai.aai-common aai-parent - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT ../aai-parent/pom.xml aai-utils diff --git a/pom.xml b/pom.xml index ab6b7ffc..3dd193af 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ org.onap.aai.aai-common aai-common - 1.6.10-SNAPSHOT + 1.6.11-SNAPSHOT pom aai-aai-common Contains all of the common code for resources and traversal repos @@ -261,3 +261,4 @@ + diff --git a/version.properties b/version.properties index c7bd1896..ac165c98 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ major_version=1 minor_version=6 -patch_version=10 +patch_version=11 base_version=${major_version}.${minor_version}.${patch_version} -- 2.16.6