aboutsummaryrefslogtreecommitdiffstats
path: root/aai-resources/src
diff options
context:
space:
mode:
Diffstat (limited to 'aai-resources/src')
-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
8 files changed, 10 insertions, 30 deletions
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);
}
}