summaryrefslogtreecommitdiffstats
path: root/aai-utils/src
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-11-08 09:49:07 +0100
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-11-08 10:09:22 +0100
commit315cc50d39facda91c937dbb72d4d28b89524afe (patch)
tree48d71c0bfdf917e8f6b27e743d218389cd680936 /aai-utils/src
parent26092e3d55ec4d7be061fbedce43d7b27439af01 (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/src')
-rw-r--r--aai-utils/src/test/java/org/onap/aaiutils/oxm/OxmModelLoaderTest.java30
1 files changed, 14 insertions, 16 deletions
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"));
}
}