Update aai-common to be spring boot 2 compatible 47/102447/4
authorHarish Venkata Kajur <vk250x@att.com>
Wed, 26 Feb 2020 22:38:15 +0000 (17:38 -0500)
committerjimmy <jf2512@att.com>
Tue, 3 Mar 2020 21:54:47 +0000 (16:54 -0500)
Issue-ID: AAI-2806
Change-Id: Idad79373209ef25bb26551253aa8ad86e4a75549
Signed-off-by: Harish Venkata Kajur <vk250x@att.com>
29 files changed:
aai-aaf-auth/pom.xml
aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafAuthorizationFilter.java
aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafCertAuthorizationFilter.java
aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafCertFilter.java
aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/AafFilter.java
aai-aaf-auth/src/main/java/org/onap/aai/aaf/filters/TwoWaySslAuthorization.java
aai-annotations/pom.xml
aai-auth/pom.xml
aai-common-docker/aai-common-images/pom.xml
aai-common-docker/aai-haproxy-image/pom.xml
aai-common-docker/pom.xml
aai-core/pom.xml
aai-core/src/main/java/org/onap/aai/prevalidation/ValidationServiceNoAuthClient.java
aai-core/src/main/java/org/onap/aai/restcore/util/URITools.java
aai-els-onap-logging/pom.xml
aai-parent/pom.xml
aai-rest/pom.xml
aai-rest/src/main/java/org/onap/aai/restclient/NoAuthRestClient.java
aai-rest/src/main/java/org/onap/aai/restclient/OneWaySSLRestClient.java
aai-rest/src/main/java/org/onap/aai/restclient/TwoWaySSLRestClient.java
aai-schema-abstraction/pom.xml
aai-schema-ingest/pom.xml
aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java
aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java
aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java
aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml
aai-utils/pom.xml
pom.xml
version.properties

index 7601c2f..883ed59 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.6.8-SNAPSHOT</version>
+        <version>1.6.9-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-aaf-auth</artifactId>
index 9f2782a..dfac48d 100644 (file)
@@ -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;
index 7ec6bb6..e0adf19 100644 (file)
@@ -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;
index 71238cf..7a47b97 100644 (file)
@@ -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;
index 16d9afd..e6769dd 100644 (file)
@@ -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;
 
index 0e206c5..150802b 100644 (file)
@@ -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;
index 8f4c8f6..1db7930 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.6.8-SNAPSHOT</version>
+        <version>1.6.9-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-annotations</artifactId>
index 9b3fc71..12c10aa 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.6.8-SNAPSHOT</version>
+        <version>1.6.9-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-auth</artifactId>
index ce5754f..57f845c 100644 (file)
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-common-docker</artifactId>
-        <version>1.6.8-SNAPSHOT</version>
+        <version>1.6.9-SNAPSHOT</version>
     </parent>
 
     <artifactId>aai-common-images</artifactId>
-    <version>1.6.8-SNAPSHOT</version>
+    <version>1.6.9-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>aai-aai-common-images</name>
     <description>Contains dockerfiles for aai-common images (alpine and ubuntu based).</description>
index e63b4c0..cfda029 100644 (file)
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-common-docker</artifactId>
-        <version>1.6.8-SNAPSHOT</version>
+        <version>1.6.9-SNAPSHOT</version>
     </parent>
 
     <artifactId>aai-haproxy-image</artifactId>
-    <version>1.6.8-SNAPSHOT</version>
+    <version>1.6.9-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>aai-aai-haproxy-image</name>
     <description>Contains dockerfiles for aai-haproxy image.</description>
index 39018d5..009b4a0 100644 (file)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.6.8-SNAPSHOT</version>
+        <version>1.6.9-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
 
index a8725ee..eb8e8ee 100644 (file)
@@ -28,7 +28,7 @@ limitations under the License.
        <parent>
                <groupId>org.onap.aai.aai-common</groupId>
                <artifactId>aai-parent</artifactId>
-               <version>1.6.8-SNAPSHOT</version>
+               <version>1.6.9-SNAPSHOT</version>
                <relativePath>../aai-parent/pom.xml</relativePath>
        </parent>
        <artifactId>aai-core</artifactId>
index d373ae7..6173e4b 100644 (file)
@@ -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;
 
index a757d3d..fc32f85 100644 (file)
@@ -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;
index 4235b0f..0ac283d 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.6.8-SNAPSHOT</version>
+        <version>1.6.9-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-els-onap-logging</artifactId>
index ae8e8c7..eecc370 100644 (file)
@@ -27,7 +27,7 @@ limitations under the License.
        <parent>
                <groupId>org.onap.aai.aai-common</groupId>
                <artifactId>aai-common</artifactId>
-               <version>1.6.8-SNAPSHOT</version>
+               <version>1.6.9-SNAPSHOT</version>
        </parent>
        <artifactId>aai-parent</artifactId>
        <name>aai-parent</name>
@@ -42,7 +42,7 @@ limitations under the License.
                <aai.release.version>${aai.common.version}</aai.release.version>
                <aai.common.logging.version>1.5.1</aai.common.logging.version>
                <aai.rest.client.version>1.5.1</aai.rest.client.version>
-               <aai.schema.service.version>1.6.0</aai.schema.service.version>
+               <aai.schema.service.version>1.6.3</aai.schema.service.version>
 
                <aaf.version>2.1.15</aaf.version>
                <antlr.version>4.7.2</antlr.version>
@@ -110,7 +110,7 @@ limitations under the License.
                <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>1.5.22.RELEASE</spring.boot.version>
         <javax.servlet.version>3.1.0</javax.servlet.version>
         <javax.annotation.version>1.2</javax.annotation.version>
 
@@ -129,9 +129,9 @@ limitations under the License.
 
                <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,7 +143,7 @@ limitations under the License.
          <profile>
            <id>spring-boot-2-1</id>
            <properties>
-             <spring.boot.version>1.5.22.RELEASE</spring.boot.version>
+             <spring.boot.version>2.1.12.RELEASE</spring.boot.version>
            </properties>
          </profile>
        </profiles>
index 18b7414..dbcb874 100644 (file)
@@ -29,7 +29,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.6.8-SNAPSHOT</version>
+        <version>1.6.9-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-rest</artifactId>
index 68ff3e5..b11b033 100644 (file)
@@ -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);
index b2534f5..5c359e2 100644 (file)
@@ -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();
index 58ee79f..f43d21c 100644 (file)
@@ -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);
index a59d21d..eec7ce2 100644 (file)
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.onap.aai.aai-common</groupId>
     <artifactId>aai-parent</artifactId>
-    <version>1.6.8-SNAPSHOT</version>
+    <version>1.6.9-SNAPSHOT</version>
     <relativePath>../aai-parent/pom.xml</relativePath>
   </parent>
 
index e8ad5f9..8c1b72f 100644 (file)
@@ -26,7 +26,7 @@ limitations under the License.
        <parent>
                <groupId>org.onap.aai.aai-common</groupId>
                <artifactId>aai-parent</artifactId>
-               <version>1.6.8-SNAPSHOT</version>
+               <version>1.6.9-SNAPSHOT</version>
                <relativePath>../aai-parent/pom.xml</relativePath>
        </parent>
        <artifactId>aai-schema-ingest</artifactId>
index 8fdce62..a9cd1f7 100644 (file)
@@ -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 {
index 7035aff..dc4e1e4 100644 (file)
@@ -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)
index af94765..2a5068f 100644 (file)
@@ -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 {
index 1d3e61e..b4e2c02 100644 (file)
@@ -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>
index 97d2f05..ec16328 100644 (file)
@@ -29,7 +29,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.6.8-SNAPSHOT</version>
+        <version>1.6.9-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 9833fb8..d5840d7 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
 
     <groupId>org.onap.aai.aai-common</groupId>
     <artifactId>aai-common</artifactId>
-    <version>1.6.8-SNAPSHOT</version>
+    <version>1.6.9-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>aai-aai-common</name>
     <description>Contains all of the common code for resources and traversal repos</description>
index f7e7893..5fc34cc 100644 (file)
@@ -5,7 +5,7 @@
 
 major_version=1
 minor_version=6
-patch_version=8
+patch_version=9
 
 base_version=${major_version}.${minor_version}.${patch_version}