summaryrefslogtreecommitdiffstats
path: root/aai-resources
diff options
context:
space:
mode:
authorIgor Dysko <igor1.dysko@orange.com>2020-06-22 13:58:10 +0200
committerIgor Dysko <igor1.dysko@orange.com>2020-06-22 14:13:25 +0200
commit486d7f22a047b1465abc5a1365560ebf44c0e589 (patch)
tree8b708d1c4f355d6cc834fdf92d0d3612b8268cd2 /aai-resources
parentcc51eb3da0b3d77bc7ad7bcd61c7cdaba3031ed8 (diff)
Update to spring boot 2
Update of code and dependencies, no changes in functionality Issue-ID: AAI-2526 Signed-off-by: Igor Dysko <igor1.dysko@orange.com> Change-Id: I62c1a5b5e8439f1a076b0507b3834a53bc084637
Diffstat (limited to 'aai-resources')
-rw-r--r--aai-resources/pom.xml78
-rw-r--r--aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java8
-rw-r--r--aai-resources/src/main/java/org/onap/aai/web/LocalHostAccessLog.java10
-rw-r--r--aai-resources/src/main/java/org/onap/aai/web/WebConfiguration.java6
-rw-r--r--aai-resources/src/main/resources/application.properties1
-rw-r--r--aai-resources/src/test/java/org/onap/aai/ResourcesTestConfiguration.java2
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/AbstractSpringRestTest.java2
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/ConfigurationTest.java2
8 files changed, 44 insertions, 65 deletions
diff --git a/aai-resources/pom.xml b/aai-resources/pom.xml
index d6440b8..e3141dd 100644
--- a/aai-resources/pom.xml
+++ b/aai-resources/pom.xml
@@ -282,6 +282,29 @@
<dependencies>
<dependency>
+ <groupId>javax.jms</groupId>
+ <artifactId>javax.jms-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-core</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
</dependency>
@@ -378,54 +401,9 @@
<artifactId>guava</artifactId>
</dependency>
<dependency>
- <groupId>org.janusgraph</groupId>
- <artifactId>janusgraph-core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.janusgraph</groupId>
- <artifactId>janusgraph-cassandra</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!--
- indirect janusgraph-cassandra dependency
- need to be newer than default one
- in order to support multiple cpu archs
- -->
- <dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-ffi</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.janusgraph</groupId>
- <artifactId>janusgraph-cql</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
@@ -563,6 +541,12 @@
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.vaadin.external.google</groupId>
+ <artifactId>android-json</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<!--
Explicitly stating the security spring framework and
@@ -601,10 +585,6 @@
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-jersey</artifactId>
- </dependency>
- <dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency>
diff --git a/aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java b/aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java
index c5f3e08..80b542b 100644
--- a/aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java
+++ b/aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java
@@ -22,18 +22,16 @@ package org.onap.aai.web;
import static java.lang.Boolean.parseBoolean;
import static java.util.Comparator.comparingInt;
+import com.google.common.collect.Sets;
import java.lang.reflect.AnnotatedElement;
import java.util.Collection;
import java.util.Comparator;
import java.util.Set;
import java.util.logging.Logger;
import javax.annotation.Priority;
-import javax.ws.rs.client.ClientRequestFilter;
-import javax.ws.rs.client.ClientResponseFilter;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.ContainerResponseFilter;
-import jersey.repackaged.com.google.common.collect.Sets;
-import org.glassfish.jersey.filter.LoggingFilter;
+import com.sun.jersey.api.client.filter.LoggingFilter;
import org.glassfish.jersey.server.ResourceConfig;
import org.onap.aai.rest.BulkAddConsumer;
import org.onap.aai.rest.BulkProcessConsumer;
@@ -124,7 +122,7 @@ public class JerseyConfiguration {
}
private void logRequests(ResourceConfig resourceConfig) {
- resourceConfig.register(new LoggingFilter(log, ENABLE_RESPONSE_LOGGING));
+ resourceConfig.register(new LoggingFilter(log, ENABLE_RESPONSE_LOGGING ? null : 0));
}
private boolean isLoggingEnabled() {
diff --git a/aai-resources/src/main/java/org/onap/aai/web/LocalHostAccessLog.java b/aai-resources/src/main/java/org/onap/aai/web/LocalHostAccessLog.java
index 4bc3300..8faf828 100644
--- a/aai-resources/src/main/java/org/onap/aai/web/LocalHostAccessLog.java
+++ b/aai-resources/src/main/java/org/onap/aai/web/LocalHostAccessLog.java
@@ -24,9 +24,9 @@ import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.server.handler.RequestLogHandler;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
-import org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory;
-import org.springframework.boot.context.embedded.jetty.JettyServerCustomizer;
+import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer;
+import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory;
+import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -36,12 +36,12 @@ import java.util.Arrays;
public class LocalHostAccessLog {
@Bean
- public EmbeddedServletContainerFactory jettyConfigBean(
+ public AbstractServletWebServerFactory jettyConfigBean(
@Value("${jetty.threadPool.maxThreads:200}") final String maxThreads,
@Value("${jetty.threadPool.minThreads:8}") final String minThreads
){
- JettyEmbeddedServletContainerFactory jef = new JettyEmbeddedServletContainerFactory();
+ JettyServletWebServerFactory jef = new JettyServletWebServerFactory();
jef.addServerCustomizers((JettyServerCustomizer) server -> {
HandlerCollection handlers = new HandlerCollection();
diff --git a/aai-resources/src/main/java/org/onap/aai/web/WebConfiguration.java b/aai-resources/src/main/java/org/onap/aai/web/WebConfiguration.java
index 5300611..a716b33 100644
--- a/aai-resources/src/main/java/org/onap/aai/web/WebConfiguration.java
+++ b/aai-resources/src/main/java/org/onap/aai/web/WebConfiguration.java
@@ -22,14 +22,14 @@ package org.onap.aai.web;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebConfiguration {
@Bean
- public WebMvcConfigurerAdapter forwardToIndex() {
- return new WebMvcConfigurerAdapter() {
+ public WebMvcConfigurer forwardToIndex() {
+ return new WebMvcConfigurer() {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/swagger").setViewName(
diff --git a/aai-resources/src/main/resources/application.properties b/aai-resources/src/main/resources/application.properties
index d6064d5..7dee2b2 100644
--- a/aai-resources/src/main/resources/application.properties
+++ b/aai-resources/src/main/resources/application.properties
@@ -6,6 +6,7 @@ info.build.version=1.1.0
spring.application.name=Resources Microservice
spring.jersey.type=filter
+spring.main.allow-bean-definition-overriding=true
server.contextPath=/
spring.autoconfigure.exclude=\
diff --git a/aai-resources/src/test/java/org/onap/aai/ResourcesTestConfiguration.java b/aai-resources/src/test/java/org/onap/aai/ResourcesTestConfiguration.java
index 09bb7a5..7a9ae2d 100644
--- a/aai-resources/src/test/java/org/onap/aai/ResourcesTestConfiguration.java
+++ b/aai-resources/src/test/java/org/onap/aai/ResourcesTestConfiguration.java
@@ -82,7 +82,7 @@ public class ResourcesTestConfiguration {
.build();
restTemplate = builder
- .requestFactory(new HttpComponentsClientHttpRequestFactory(client))
+ .requestFactory(() -> new HttpComponentsClientHttpRequestFactory(client))
.build();
}else {
restTemplate = builder.build();
diff --git a/aai-resources/src/test/java/org/onap/aai/rest/AbstractSpringRestTest.java b/aai-resources/src/test/java/org/onap/aai/rest/AbstractSpringRestTest.java
index ff985a9..e4684fb 100644
--- a/aai-resources/src/test/java/org/onap/aai/rest/AbstractSpringRestTest.java
+++ b/aai-resources/src/test/java/org/onap/aai/rest/AbstractSpringRestTest.java
@@ -32,7 +32,7 @@ import org.onap.aai.exceptions.AAIException;
import org.onap.aai.nodes.NodeIngestor;
import org.onap.aai.util.AAIConfig;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.http.HttpEntity;
diff --git a/aai-resources/src/test/java/org/onap/aai/rest/ConfigurationTest.java b/aai-resources/src/test/java/org/onap/aai/rest/ConfigurationTest.java
index af7d022..ee33bfc 100644
--- a/aai-resources/src/test/java/org/onap/aai/rest/ConfigurationTest.java
+++ b/aai-resources/src/test/java/org/onap/aai/rest/ConfigurationTest.java
@@ -27,7 +27,7 @@ import org.onap.aai.ResourcesTestConfiguration;
import org.onap.aai.restclient.PropertyPasswordConfiguration;
import org.onap.aai.config.SpringContextAware;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.http.*;