summaryrefslogtreecommitdiffstats
path: root/aai-resources
diff options
context:
space:
mode:
Diffstat (limited to 'aai-resources')
-rw-r--r--aai-resources/pom.xml39
-rw-r--r--aai-resources/src/main/java/org/onap/aai/ResourcesApp.java13
-rw-r--r--aai-resources/src/main/java/org/onap/aai/rest/ExceptionHandler.java1
-rw-r--r--aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java1
-rw-r--r--aai-resources/src/main/java/org/onap/aai/rest/bulk/pojos/Operation.java2
-rw-r--r--aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java1
-rw-r--r--aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java1
-rw-r--r--aai-resources/src/test/java/org/onap/aai/AAISetup.java4
-rw-r--r--aai-resources/src/test/java/org/onap/aai/it/performance/K6PerformanceTest.java4
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/AbstractSpringRestTest.java8
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/ConfigurationTest.java4
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/ExceptionHandlerTest.java2
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/ModelDistributionTest.java2
13 files changed, 23 insertions, 59 deletions
diff --git a/aai-resources/pom.xml b/aai-resources/pom.xml
index d580966..2ad5cb6 100644
--- a/aai-resources/pom.xml
+++ b/aai-resources/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.onap.aai.resources</groupId>
<artifactId>resources</artifactId>
- <version>1.14.4-SNAPSHOT</version>
+ <version>1.14.5-SNAPSHOT</version>
</parent>
<properties>
<java.version>1.8</java.version>
@@ -40,8 +40,6 @@
<!-- This value should be overwritten at runtime to wherever need to be pushed to -->
<docker.push.registry>localhost:5000</docker.push.registry>
<aai.docker.version>1.0.0</aai.docker.version>
- <aai.base.image>alpine</aai.base.image>
- <aai.base.image.version>1.13.4</aai.base.image.version>
<netty.handler.version>4.1.63.Final</netty.handler.version>
<netty.version>4.1.63.Final</netty.version>
@@ -83,8 +81,8 @@
<!-- End of Default ONAP Schema Properties -->
<spring.boot.version>2.4.13</spring.boot.version>
- <janusgraph.version>0.5.3</janusgraph.version>
- <gremlin.version>3.4.13</gremlin.version>
+ <janusgraph.version>0.6.0</janusgraph.version>
+ <gremlin.version>3.5.1</gremlin.version>
<javax.servlet.version>4.0.1</javax.servlet.version>
<keycloak.version>11.0.2</keycloak.version>
@@ -107,37 +105,6 @@
<build>
<plugins>
<plugin>
- <groupId>org.codehaus.groovy.maven</groupId>
- <artifactId>gmaven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <phase>pre-clean</phase>
- </execution>
- <execution>
- <id>parse-base</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <source>
- def userAaiBaseImage = session.userProperties['aai.base.image']
- def userAaiCommonVersion = session.userProperties['aai.base.image.version']
- if (userAaiCommonVersion != null) {
- project.properties['aai.base.image.version'] = userAaiCommonVersion
- }
- if (userAaiBaseImage != null) {
- project.properties['aai.base.image'] = userAaiBaseImage
- }
- log.info 'Base image flavour: ' + project.properties['aai.base.image']
- log.info 'Base image version: ' + project.properties['aai.base.image.version']
- </source>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
diff --git a/aai-resources/src/main/java/org/onap/aai/ResourcesApp.java b/aai-resources/src/main/java/org/onap/aai/ResourcesApp.java
index 007b0d1..51f5609 100644
--- a/aai-resources/src/main/java/org/onap/aai/ResourcesApp.java
+++ b/aai-resources/src/main/java/org/onap/aai/ResourcesApp.java
@@ -37,24 +37,17 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration;
+import org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
-import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.core.env.Profiles;
@SpringBootApplication(
exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class,
- HibernateJpaAutoConfiguration.class})
-// Component Scan provides a way to look for spring beans
-// It only searches beans in the following packages
-// Any method annotated with @Bean annotation or any class
-// with @Component, @Configuration, @Service will be picked up
-@ComponentScan(
- basePackages = {"org.onap.aai.config", "org.onap.aai.web", "org.onap.aai.setup", "org.onap.aai.tasks",
- "org.onap.aai.service", "org.onap.aai.rest", "org.onap.aai.aaf", "org.onap.aai.TenantIsolation",
- "org.onap.aai.aailog", "org.onap.aai.prevalidation"})
+ HibernateJpaAutoConfiguration.class, CassandraDataAutoConfiguration.class, CassandraAutoConfiguration.class})
public class ResourcesApp {
private static final Logger logger = LoggerFactory.getLogger(ResourcesApp.class.getName());
diff --git a/aai-resources/src/main/java/org/onap/aai/rest/ExceptionHandler.java b/aai-resources/src/main/java/org/onap/aai/rest/ExceptionHandler.java
index 81c49b9..7af598b 100644
--- a/aai-resources/src/main/java/org/onap/aai/rest/ExceptionHandler.java
+++ b/aai-resources/src/main/java/org/onap/aai/rest/ExceptionHandler.java
@@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.JsonMappingException;
import com.sun.istack.SAXParseException2;
import java.util.ArrayList;
-import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.WebApplicationException;
diff --git a/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java b/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java
index c518258..689e0b4 100644
--- a/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java
+++ b/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java
@@ -47,7 +47,6 @@ import org.onap.aai.introspection.sideeffect.OwnerCheck;
import org.onap.aai.query.builder.Pageable;
import org.onap.aai.parsers.query.QueryParser;
import org.onap.aai.query.builder.QueryOptions;
-import org.onap.aai.query.builder.Sort;
import org.onap.aai.rest.db.DBRequest;
import org.onap.aai.rest.db.HttpEntry;
import org.onap.aai.rest.exceptions.AAIInvalidXMLNamespace;
diff --git a/aai-resources/src/main/java/org/onap/aai/rest/bulk/pojos/Operation.java b/aai-resources/src/main/java/org/onap/aai/rest/bulk/pojos/Operation.java
index 814cea0..1920b37 100644
--- a/aai-resources/src/main/java/org/onap/aai/rest/bulk/pojos/Operation.java
+++ b/aai-resources/src/main/java/org/onap/aai/rest/bulk/pojos/Operation.java
@@ -20,7 +20,7 @@
package org.onap.aai.rest.bulk.pojos;
-import com.google.gson.*;
+import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
public class Operation {
diff --git a/aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java b/aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java
index d4d8d32..0e44a63 100644
--- a/aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java
+++ b/aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java
@@ -21,7 +21,6 @@
package org.onap.aai.rest.util;
import java.util.ArrayList;
-import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
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 24004d1..41ec8e1 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
@@ -47,7 +47,6 @@ import org.onap.aai.rest.bulk.BulkSingleTransactionConsumer;
import org.onap.aai.rest.util.EchoResponse;
import org.onap.logging.filter.base.AuditLogContainerFilter;
import org.reflections.Reflections;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
diff --git a/aai-resources/src/test/java/org/onap/aai/AAISetup.java b/aai-resources/src/test/java/org/onap/aai/AAISetup.java
index b510c00..81ed8c3 100644
--- a/aai-resources/src/test/java/org/onap/aai/AAISetup.java
+++ b/aai-resources/src/test/java/org/onap/aai/AAISetup.java
@@ -32,7 +32,6 @@ import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.extension.ExtendWith;
-import org.junit.runner.RunWith;
import org.onap.aai.config.ConfigConfiguration;
import org.onap.aai.config.IntrospectionConfig;
import org.onap.aai.config.RestBeanConfig;
@@ -43,6 +42,7 @@ import org.onap.aai.introspection.LoaderFactory;
import org.onap.aai.introspection.MoxyLoader;
import org.onap.aai.nodes.NodeIngestor;
import org.onap.aai.rest.db.HttpEntry;
+import org.onap.aai.rest.notification.NotificationService;
import org.onap.aai.serialization.db.EdgeSerializer;
import org.onap.aai.setup.AAIConfigTranslator;
import org.onap.aai.setup.SchemaVersion;
@@ -58,7 +58,7 @@ import org.springframework.test.context.junit4.rules.SpringMethodRule;
@ContextConfiguration(
classes = {ConfigConfiguration.class, AAIConfigTranslator.class, NodeIngestor.class, EdgeIngestor.class,
EdgeSerializer.class, SpringContextAware.class, IntrospectionConfig.class,
- XmlFormatTransformerConfiguration.class, RestBeanConfig.class})
+ XmlFormatTransformerConfiguration.class, RestBeanConfig.class, LoaderFactory.class, NotificationService.class})
@TestPropertySource(
properties = {"schema.uri.base.path = /aai",
"schema.ingest.file = src/test/resources/application-test.properties"})
diff --git a/aai-resources/src/test/java/org/onap/aai/it/performance/K6PerformanceTest.java b/aai-resources/src/test/java/org/onap/aai/it/performance/K6PerformanceTest.java
index 64b4f3c..00179fe 100644
--- a/aai-resources/src/test/java/org/onap/aai/it/performance/K6PerformanceTest.java
+++ b/aai-resources/src/test/java/org/onap/aai/it/performance/K6PerformanceTest.java
@@ -36,6 +36,9 @@ import org.onap.aai.db.props.AAIProperties;
import org.onap.aai.dbmap.AAIGraph;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration;
+import org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.web.server.LocalServerPort;
@@ -48,6 +51,7 @@ import lombok.SneakyThrows;
@Testcontainers
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+@EnableAutoConfiguration(exclude={CassandraDataAutoConfiguration.class, CassandraAutoConfiguration.class}) // there is no running cassandra instance for the test
public class K6PerformanceTest {
private static final Logger logger = LoggerFactory.getLogger(ResourcesApp.class.getName());
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 9e901ad..82d726e 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
@@ -41,6 +41,9 @@ import org.onap.aai.nodes.NodeIngestor;
import org.onap.aai.restclient.PropertyPasswordConfiguration;
import org.onap.aai.util.AAIConfig;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration;
+import org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.context.annotation.Import;
@@ -53,10 +56,11 @@ import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
import org.springframework.web.client.RestTemplate;
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = ResourcesApp.class)
+@Import(ResourcesTestConfiguration.class)
@TestPropertySource(locations = "classpath:application-test.properties")
@ContextConfiguration(initializers = PropertyPasswordConfiguration.class)
-@Import(ResourcesTestConfiguration.class)
+@EnableAutoConfiguration(exclude={CassandraDataAutoConfiguration.class, CassandraAutoConfiguration.class}) // there is no running cassandra instance for the test
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = ResourcesApp.class)
public abstract class AbstractSpringRestTest {
@ClassRule
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 5e1142d..21f2fb4 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
@@ -38,6 +38,9 @@ import org.onap.aai.config.SpringContextAware;
import org.onap.aai.restclient.PropertyPasswordConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration;
+import org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.context.annotation.Import;
@@ -57,6 +60,7 @@ import org.springframework.web.client.RestTemplate;
@TestPropertySource(locations = "classpath:application-test.properties")
@ContextConfiguration(initializers = PropertyPasswordConfiguration.class, classes = {SpringContextAware.class})
+@EnableAutoConfiguration(exclude={CassandraDataAutoConfiguration.class, CassandraAutoConfiguration.class}) // there is no running cassandra instance for the test
@Import(ResourcesTestConfiguration.class)
@SpringBootTest(
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
diff --git a/aai-resources/src/test/java/org/onap/aai/rest/ExceptionHandlerTest.java b/aai-resources/src/test/java/org/onap/aai/rest/ExceptionHandlerTest.java
index 0780649..21baedc 100644
--- a/aai-resources/src/test/java/org/onap/aai/rest/ExceptionHandlerTest.java
+++ b/aai-resources/src/test/java/org/onap/aai/rest/ExceptionHandlerTest.java
@@ -27,8 +27,6 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.core.JsonLocation;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonMappingException;
diff --git a/aai-resources/src/test/java/org/onap/aai/rest/ModelDistributionTest.java b/aai-resources/src/test/java/org/onap/aai/rest/ModelDistributionTest.java
index 374519e..6679c0b 100644
--- a/aai-resources/src/test/java/org/onap/aai/rest/ModelDistributionTest.java
+++ b/aai-resources/src/test/java/org/onap/aai/rest/ModelDistributionTest.java
@@ -26,9 +26,7 @@ import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Collections;
-import org.json.JSONObject;
import org.junit.jupiter.api.Test;
-import org.onap.aai.rest.AbstractSpringRestTest;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;