summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--aai-resources/pom.xml13
-rw-r--r--aai-resources/src/main/java/org/onap/aai/interceptors/pre/RetiredInterceptor.java2
-rw-r--r--aai-resources/src/main/java/org/onap/aai/interceptors/pre/VersionInterceptor.java2
-rw-r--r--aai-resources/src/main/java/org/onap/aai/interceptors/pre/VersionLatestInterceptor.java2
-rw-r--r--aai-resources/src/test/java/org/onap/aai/AAISetup.java14
-rw-r--r--aai-resources/src/test/java/org/onap/aai/it/performance/K6PerformanceTest.java2
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/AbstractSpringRestTest.java12
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/ModelDistributionTest.java4
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/util/LogFormatToolsTest.java2
-rw-r--r--pom.xml17
10 files changed, 36 insertions, 34 deletions
diff --git a/aai-resources/pom.xml b/aai-resources/pom.xml
index e2c66e0..1c43954 100644
--- a/aai-resources/pom.xml
+++ b/aai-resources/pom.xml
@@ -79,8 +79,6 @@
<schema.ingest.file>${project.basedir}/src/main/resources/application.properties</schema.ingest.file>
<!-- End of Default ONAP Schema Properties -->
- <spring.boot.version>2.4.13</spring.boot.version>
-
<janusgraph.version>0.6.4</janusgraph.version>
<gremlin.version>3.5.8</gremlin.version>
@@ -594,6 +592,17 @@
<version>3.21.0</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-junit</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
diff --git a/aai-resources/src/main/java/org/onap/aai/interceptors/pre/RetiredInterceptor.java b/aai-resources/src/main/java/org/onap/aai/interceptors/pre/RetiredInterceptor.java
index 80741f8..9ca1283 100644
--- a/aai-resources/src/main/java/org/onap/aai/interceptors/pre/RetiredInterceptor.java
+++ b/aai-resources/src/main/java/org/onap/aai/interceptors/pre/RetiredInterceptor.java
@@ -53,7 +53,7 @@ public class RetiredInterceptor extends AAIContainerFilter implements ContainerR
private String basePath;
- @Autowired
+ @Autowired // remove this
public RetiredInterceptor(RetiredService retiredService, @Value("${schema.uri.base.path}") String basePath) {
this.retiredService = retiredService;
this.basePath = basePath;
diff --git a/aai-resources/src/main/java/org/onap/aai/interceptors/pre/VersionInterceptor.java b/aai-resources/src/main/java/org/onap/aai/interceptors/pre/VersionInterceptor.java
index 01cd013..7e1b64e 100644
--- a/aai-resources/src/main/java/org/onap/aai/interceptors/pre/VersionInterceptor.java
+++ b/aai-resources/src/main/java/org/onap/aai/interceptors/pre/VersionInterceptor.java
@@ -49,7 +49,7 @@ public class VersionInterceptor extends AAIContainerFilter implements ContainerR
private final SchemaVersions schemaVersions;
- @Autowired
+ @Autowired // remove this
public VersionInterceptor(SchemaVersions schemaVersions) {
this.schemaVersions = schemaVersions;
allowedVersions =
diff --git a/aai-resources/src/main/java/org/onap/aai/interceptors/pre/VersionLatestInterceptor.java b/aai-resources/src/main/java/org/onap/aai/interceptors/pre/VersionLatestInterceptor.java
index 5d68c8a..2ad9ace 100644
--- a/aai-resources/src/main/java/org/onap/aai/interceptors/pre/VersionLatestInterceptor.java
+++ b/aai-resources/src/main/java/org/onap/aai/interceptors/pre/VersionLatestInterceptor.java
@@ -37,7 +37,7 @@ public class VersionLatestInterceptor extends AAIContainerFilter implements Cont
private final SchemaVersions schemaVersions;
- @Autowired
+ @Autowired // remove this
public VersionLatestInterceptor(SchemaVersions schemaVersions) {
this.schemaVersions = schemaVersions;
}
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 81ed8c3..3567187 100644
--- a/aai-resources/src/test/java/org/onap/aai/AAISetup.java
+++ b/aai-resources/src/test/java/org/onap/aai/AAISetup.java
@@ -28,8 +28,6 @@ import java.nio.charset.Charset;
import java.util.Map;
import org.apache.commons.io.IOUtils;
-import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.extension.ExtendWith;
import org.onap.aai.config.ConfigConfiguration;
@@ -48,14 +46,12 @@ import org.onap.aai.setup.AAIConfigTranslator;
import org.onap.aai.setup.SchemaVersion;
import org.onap.aai.setup.SchemaVersions;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;
-import org.springframework.test.context.junit4.rules.SpringClassRule;
-import org.springframework.test.context.junit4.rules.SpringMethodRule;
+import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
@ExtendWith(SpringExtension.class)
-@ContextConfiguration(
+@SpringJUnitConfig(
classes = {ConfigConfiguration.class, AAIConfigTranslator.class, NodeIngestor.class, EdgeIngestor.class,
EdgeSerializer.class, SpringContextAware.class, IntrospectionConfig.class,
XmlFormatTransformerConfiguration.class, RestBeanConfig.class, LoaderFactory.class, NotificationService.class})
@@ -82,12 +78,6 @@ public abstract class AAISetup {
@Autowired
protected SchemaVersions schemaVersions;
- @ClassRule
- public static final SpringClassRule springClassRule = new SpringClassRule();
-
- @Rule
- public final SpringMethodRule springMethodRule = new SpringMethodRule();
-
@BeforeAll
public static void setupBundleconfig() throws Exception {
System.setProperty("AJSC_HOME", "./");
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 00179fe..f7d1cc6 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
@@ -21,7 +21,7 @@
package org.onap.aai.it.performance;
import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
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 82d726e..adfa433 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
@@ -28,8 +28,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.janusgraph.core.JanusGraph;
import org.janusgraph.core.JanusGraphTransaction;
-import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
@@ -52,23 +50,15 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.rules.SpringClassRule;
-import org.springframework.test.context.junit4.rules.SpringMethodRule;
import org.springframework.web.client.RestTemplate;
@Import(ResourcesTestConfiguration.class)
@TestPropertySource(locations = "classpath:application-test.properties")
@ContextConfiguration(initializers = PropertyPasswordConfiguration.class)
-@EnableAutoConfiguration(exclude={CassandraDataAutoConfiguration.class, CassandraAutoConfiguration.class}) // there is no running cassandra instance for the test
+@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
- public static final SpringClassRule springClassRule = new SpringClassRule();
-
- @Rule
- public final SpringMethodRule springMethodRule = new SpringMethodRule();
-
@Autowired
protected RestTemplate restTemplate;
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 9ea7f7e..2177dac 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
@@ -19,8 +19,8 @@
*/
package org.onap.aai.rest;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.nio.file.Files;
import java.nio.file.Paths;
diff --git a/aai-resources/src/test/java/org/onap/aai/rest/util/LogFormatToolsTest.java b/aai-resources/src/test/java/org/onap/aai/rest/util/LogFormatToolsTest.java
index b00ae59..3958f46 100644
--- a/aai-resources/src/test/java/org/onap/aai/rest/util/LogFormatToolsTest.java
+++ b/aai-resources/src/test/java/org/onap/aai/rest/util/LogFormatToolsTest.java
@@ -29,7 +29,7 @@ public class LogFormatToolsTest {
@Test
public void testLogFormatTools() {
- String dateTime = new LogFormatTools().getCurrentDateTime();
+ String dateTime = LogFormatTools.getCurrentDateTime();
assertNotNull(dateTime);
}
}
diff --git a/pom.xml b/pom.xml
index 6bb5a2b..77e71ab 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-parent</artifactId>
- <version>1.14.5</version>
+ <version>1.14.6</version>
</parent>
<groupId>org.onap.aai.resources</groupId>
<artifactId>resources</artifactId>
@@ -48,9 +48,22 @@
<staging.path>/content/repositories/staging/</staging.path>
<!-- GMaven plugin uses this property to figure out the name of the docker tag -->
<aai.project.version>${project.version}</aai.project.version>
- <aai.common.version>1.14.5</aai.common.version>
+ <aai.common.version>1.14.6</aai.common.version>
<aai.schema.service.version>1.12.5</aai.schema.service.version>
</properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-junit</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
<build>
<pluginManagement>
<plugins>