From: Harish Venkata Kajur Date: Wed, 26 Feb 2020 22:38:15 +0000 (-0500) Subject: Update aai-common to be spring boot 2 compatible X-Git-Tag: 1.6.10~2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=6f0577db0cc8bd169d5d420e22b576397817f8bd;p=aai%2Faai-common.git Update aai-common to be spring boot 2 compatible Issue-ID: AAI-2806 Change-Id: Idad79373209ef25bb26551253aa8ad86e4a75549 Signed-off-by: Harish Venkata Kajur --- diff --git a/aai-aaf-auth/pom.xml b/aai-aaf-auth/pom.xml index 7601c2fb..883ed593 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.8-SNAPSHOT + 1.6.9-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 9f2782a4..dfac48dd 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 8f4c8f6f..1db79303 100644 --- a/aai-annotations/pom.xml +++ b/aai-annotations/pom.xml @@ -27,7 +27,7 @@ org.onap.aai.aai-common aai-parent - 1.6.8-SNAPSHOT + 1.6.9-SNAPSHOT ../aai-parent/pom.xml aai-annotations diff --git a/aai-auth/pom.xml b/aai-auth/pom.xml index 9b3fc71d..12c10aaf 100644 --- a/aai-auth/pom.xml +++ b/aai-auth/pom.xml @@ -27,7 +27,7 @@ org.onap.aai.aai-common aai-parent - 1.6.8-SNAPSHOT + 1.6.9-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 ce5754fc..57f845cd 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.8-SNAPSHOT + 1.6.9-SNAPSHOT aai-common-images - 1.6.8-SNAPSHOT + 1.6.9-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 e63b4c0f..cfda0299 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.8-SNAPSHOT + 1.6.9-SNAPSHOT aai-haproxy-image - 1.6.8-SNAPSHOT + 1.6.9-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 39018d5c..009b4a04 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.8-SNAPSHOT + 1.6.9-SNAPSHOT ../aai-parent/pom.xml diff --git a/aai-core/pom.xml b/aai-core/pom.xml index a8725eed..eb8e8ee7 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.8-SNAPSHOT + 1.6.9-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 4235b0fd..0ac283dc 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.8-SNAPSHOT + 1.6.9-SNAPSHOT ../aai-parent/pom.xml aai-els-onap-logging diff --git a/aai-parent/pom.xml b/aai-parent/pom.xml index ae8e8c78..eecc370d 100644 --- a/aai-parent/pom.xml +++ b/aai-parent/pom.xml @@ -27,7 +27,7 @@ limitations under the License. org.onap.aai.aai-common aai-common - 1.6.8-SNAPSHOT + 1.6.9-SNAPSHOT aai-parent aai-parent @@ -42,7 +42,7 @@ limitations under the License. ${aai.common.version} 1.5.1 1.5.1 - 1.6.0 + 1.6.3 2.1.15 4.7.2 @@ -110,7 +110,7 @@ limitations under the License. 0.9.10 1.25 - 1.5.22.RELEASE + 1.5.22.RELEASE 3.1.0 1.2 @@ -129,9 +129,9 @@ limitations under the License. 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 @@ -143,7 +143,7 @@ limitations under the License. spring-boot-2-1 - 1.5.22.RELEASE + 2.1.12.RELEASE diff --git a/aai-rest/pom.xml b/aai-rest/pom.xml index 18b74149..dbcb874a 100644 --- a/aai-rest/pom.xml +++ b/aai-rest/pom.xml @@ -29,7 +29,7 @@ org.onap.aai.aai-common aai-parent - 1.6.8-SNAPSHOT + 1.6.9-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 a59d21d3..eec7ce28 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.8-SNAPSHOT + 1.6.9-SNAPSHOT ../aai-parent/pom.xml diff --git a/aai-schema-ingest/pom.xml b/aai-schema-ingest/pom.xml index e8ad5f9e..8c1b72fc 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.8-SNAPSHOT + 1.6.9-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 97d2f058..ec16328b 100644 --- a/aai-utils/pom.xml +++ b/aai-utils/pom.xml @@ -29,7 +29,7 @@ org.onap.aai.aai-common aai-parent - 1.6.8-SNAPSHOT + 1.6.9-SNAPSHOT ../aai-parent/pom.xml aai-utils diff --git a/pom.xml b/pom.xml index 9833fb80..d5840d72 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ org.onap.aai.aai-common aai-common - 1.6.8-SNAPSHOT + 1.6.9-SNAPSHOT pom aai-aai-common Contains all of the common code for resources and traversal repos diff --git a/version.properties b/version.properties index f7e7893b..5fc34cc4 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ major_version=1 minor_version=6 -patch_version=8 +patch_version=9 base_version=${major_version}.${minor_version}.${patch_version}