diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-09-17 08:36:31 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-09-17 08:36:31 +0200 |
commit | fec75c941420be1c637112e9f404ed4553dba66f (patch) | |
tree | d16dc119ecb6d9d2d9c303a7f6b4d65f7db30678 /aai-resources/src/test/java/org/onap | |
parent | 222f8efa881e940a4a3529706e067d0cefb6db99 (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/src/test/java/org/onap')
5 files changed, 7 insertions, 27 deletions
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); } } |