diff options
author | Jimmy Forsyth <jf2512@att.com> | 2020-03-10 15:21:02 -0400 |
---|---|---|
committer | Jimmy Forsyth <jf2512@att.com> | 2020-03-10 16:34:50 -0400 |
commit | ed992e01c17d5677dfa0e1d0a76a7f9bc12c2a90 (patch) | |
tree | 085e36cce2b19afbde50139f34eb969001db91cd | |
parent | 2f4601f2b8fa2e219e870bfabe8d1c464e67dd69 (diff) |
Reenable spring-boot2 in aai-common
Issue-ID: AAI-2831
Signed-off-by: Jimmy Forsyth <jf2512@att.com>
Change-Id: I9f3f1d8d1d9ef45786d0f17afa5c824e90c77263
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 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> <artifactId>aai-aaf-auth</artifactId> 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 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> <artifactId>aai-annotations</artifactId> 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 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> <artifactId>aai-auth</artifactId> 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 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-common-docker</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> </parent> <artifactId>aai-common-images</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <packaging>pom</packaging> <name>aai-aai-common-images</name> <description>Contains dockerfiles for aai-common images (alpine and ubuntu based).</description> 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 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-common-docker</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> </parent> <artifactId>aai-haproxy-image</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <packaging>pom</packaging> <name>aai-aai-haproxy-image</name> <description>Contains dockerfiles for aai-haproxy image.</description> 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 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> 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. <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> <artifactId>aai-core</artifactId> 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<String, String> 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 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> <artifactId>aai-els-onap-logging</artifactId> 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 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - ============LICENSE_START====================================================== - org.onap.aai - =============================================================================== - Copyright © 2019 AT&T Intellectual Property. All rights reserved. - =============================================================================== - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +============LICENSE_START====================================================== +org.onap.aai +=============================================================================== +Copyright © 2019 AT&T Intellectual Property. All rights reserved. +=============================================================================== +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. ===========LICENSE_END========================================================= --> <project xmlns="http://maven.apache.org/POM/4.0.0" - 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"> + 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"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-common</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> </parent> <artifactId>aai-parent</artifactId> <name>aai-parent</name> @@ -101,7 +101,7 @@ <slf4j.version>1.7.25</slf4j.version> <log4j.version>1.2.17</log4j.version> <mockito.all.version>1.10.19</mockito.all.version> - <mockito.core.version>2.15.0</mockito.core.version> + <mockito.core.version>1.10.19</mockito.core.version> <netty.handler.version>4.1.43.Final</netty.handler.version> <netty.version>4.0.56.Final</netty.version> <opencsv.version>3.1</opencsv.version> @@ -110,11 +110,11 @@ <reflections.version>0.9.10</reflections.version> <snakeyaml.version>1.25</snakeyaml.version> - <spring.boot.version>1.5.22.RELEASE</spring.boot.version> + <spring.boot.version>2.1.12.RELEASE</spring.boot.version> <javax.servlet.version>3.1.0</javax.servlet.version> <javax.annotation.version>1.2</javax.annotation.version> - <sonar.jacoco.reportPath /> + <sonar.jacoco.reportPath /> <sonar.jacoco.itReportPath /> <sonar.jacoco.reportMissing.force.zero /> @@ -129,9 +129,9 @@ <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> - <spring.version>4.3.25.RELEASE</spring.version> - <spring.jms.version>4.3.25.RELEASE</spring.jms.version> - <spring.test.version>4.3.25.RELEASE</spring.test.version> + <spring.version>5.1.13.RELEASE</spring.version> + <spring.jms.version>5.1.13.RELEASE</spring.jms.version> + <spring.test.version>5.1.13.RELEASE</spring.test.version> <spring.security.rsa.version>1.0.8.RELEASE</spring.security.rsa.version> <json.simple.version>1.1.1</json.simple.version> <powermock.api.mockito2.version>2.0.4</powermock.api.mockito2.version> @@ -143,6 +143,12 @@ <profile> <id>spring-boot-2-1</id> <properties> + <spring.boot.version>2.1.12.RELEASE</spring.boot.version> + </properties> + </profile> + <profile> + <id>spring-boot-1-5</id> + <properties> <spring.boot.version>1.5.22.RELEASE</spring.boot.version> </properties> </profile> 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 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> <artifactId>aai-rest</artifactId> 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 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> 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<EdgeSchema> edgeSchemaList = + Set<EdgeSchema> 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<EdgeSchema> edgeSchemaList = - schemaProvider.getEdgeSchemaForSourceTarget("service-instance", "customer", + Set<EdgeSchema> 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<EdgeSchema> edgeSchemaList = - schemaProvider.getAdjacentEdgeSchema("org.onap.nodes.bad-node", + + Set<EdgeSchema> 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. <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> <artifactId>aai-schema-ingest</artifactId> 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 @@ <property name="edgeDirectory" value="${schema.edges.location}" /> </bean> - <context:property-placeholder location="classpath:forWiringTests/schema-ingest-for-xml-test.properties" ignore-unresolvable="true" /> + <context:property-placeholder location="/forWiringTests/schema-ingest-for-xml-test.properties" ignore-unresolvable="true" /> -</beans>
\ No newline at end of file +</beans> 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 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> <artifactId>aai-utils</artifactId> @@ -30,7 +30,7 @@ <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-common</artifactId> - <version>1.6.10-SNAPSHOT</version> + <version>1.6.11-SNAPSHOT</version> <packaging>pom</packaging> <name>aai-aai-common</name> <description>Contains all of the common code for resources and traversal repos</description> @@ -261,3 +261,4 @@ </repositories> <!-- End of ONAP Specific Repositories --> </project> +<!-- noop for release --> 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} |