diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-11-08 09:49:07 +0100 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-11-08 10:09:22 +0100 |
commit | 315cc50d39facda91c937dbb72d4d28b89524afe (patch) | |
tree | 48d71c0bfdf917e8f6b27e743d218389cd680936 /aai-utils | |
parent | 26092e3d55ec4d7be061fbedce43d7b27439af01 (diff) |
Upgrade spring boot to 2.6
- upgrade spring boot (2.5.15 -> 2.6.15)
- migrate aai-schema-ingest module to JUnit 5
Issue-ID: AAI-4048
Change-Id: I72a59891fdbcdea9b54f6c02aae09fcc7a26947a
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-utils')
-rw-r--r-- | aai-utils/pom.xml | 21 | ||||
-rw-r--r-- | aai-utils/src/test/java/org/onap/aaiutils/oxm/OxmModelLoaderTest.java | 30 |
2 files changed, 30 insertions, 21 deletions
diff --git a/aai-utils/pom.xml b/aai-utils/pom.xml index f5bc33f6..2ce63f68 100644 --- a/aai-utils/pom.xml +++ b/aai-utils/pom.xml @@ -88,11 +88,22 @@ <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <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.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <scope>test</scope> + </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> diff --git a/aai-utils/src/test/java/org/onap/aaiutils/oxm/OxmModelLoaderTest.java b/aai-utils/src/test/java/org/onap/aaiutils/oxm/OxmModelLoaderTest.java index f3b9f621..bcfdbebc 100644 --- a/aai-utils/src/test/java/org/onap/aaiutils/oxm/OxmModelLoaderTest.java +++ b/aai-utils/src/test/java/org/onap/aaiutils/oxm/OxmModelLoaderTest.java @@ -20,35 +20,33 @@ package org.onap.aaiutils.oxm; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.regex.Pattern; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class OxmModelLoaderTest { - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test public void shouldLoadOxmModelsWhichMatchToPattern() throws Exception { OxmModelLoader.loadModels("classpath*:test_aai_oxm*.xml", Pattern.compile("test_aai_oxm_(.*).xml")); - Assert.assertTrue(OxmModelLoader.getVersionContextMap().size() == 2); - Assert.assertFalse(OxmModelLoader.getVersionContextMap().containsKey("v7")); - Assert.assertTrue(OxmModelLoader.getVersionContextMap().containsKey("v8")); - Assert.assertTrue(OxmModelLoader.getVersionContextMap().containsKey("v9")); + Assertions.assertTrue(OxmModelLoader.getVersionContextMap().size() == 2); + Assertions.assertFalse(OxmModelLoader.getVersionContextMap().containsKey("v7")); + Assertions.assertTrue(OxmModelLoader.getVersionContextMap().containsKey("v8")); + Assertions.assertTrue(OxmModelLoader.getVersionContextMap().containsKey("v9")); } @Test - public void shouldReportAnErrorWhenOxmModelsAreNotAvailable() throws Exception { - thrown.expect(Exception.class); - thrown.expectMessage("Failed to load schema"); + public void shouldReportAnErrorWhenOxmModelsAreNotAvailable() { + Throwable exception = assertThrows(Exception.class, () -> - OxmModelLoader.loadModels("classpath*:non_existing_aai_oxm*.xml", - Pattern.compile("non_existing_aai_oxm_(.*).xml")); + OxmModelLoader.loadModels("classpath*:non_existing_aai_oxm*.xml", + Pattern.compile("non_existing_aai_oxm_(.*).xml"))); + assertTrue(exception.getMessage().contains("Failed to load schema")); } } |