aboutsummaryrefslogtreecommitdiffstats
path: root/aai-resources
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-09-17 08:36:31 +0200
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-09-17 08:36:31 +0200
commitfec75c941420be1c637112e9f404ed4553dba66f (patch)
treed16dc119ecb6d9d2d9c303a7f6b4d65f7db30678 /aai-resources
parent222f8efa881e940a4a3529706e067d0cefb6db99 (diff)
Update aai-common to 1.14.6 in resources
- upgrade spring-boot (2.4.13 -> 2.5.15) - fix vulnerabilities Issue-ID: AAI-3992 Change-Id: I161101a5e74b21494583c1c58c82d7d75351b348 Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-resources')
-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
9 files changed, 21 insertions, 32 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);
}
}