aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-03-01 13:35:53 +0100
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-03-01 13:36:47 +0100
commit176c445bbeb5e47011ff2ca4816c00dd0f6ea779 (patch)
treed759d004aaf58aa38a29b1e9656c28786ca423f2 /src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java
parent811169825805a7160a6dd28abb281f64a4a56c71 (diff)
Update aai-parent in babel to 1.13.3
- update aai-parent from 1.9.4 to 1.13.3 - update spring-boot from 2.1 to 2.4 - migrate junit 4 to junit 5 Issue-ID: AAI-3791 Change-Id: I849c830f9f0addfb2d4d48d20f038afd401858d2 Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java')
-rw-r--r--src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java b/src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java
index b29d0d7..fc2522f 100644
--- a/src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java
+++ b/src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java
@@ -23,13 +23,14 @@ package org.onap.aai.babel.xml.generator;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.aai.babel.csar.extractor.InvalidArchiveException;
import org.onap.aai.babel.parser.ArtifactGeneratorToscaParser;
import org.onap.aai.babel.testdata.CsarTest;
@@ -50,7 +51,7 @@ public class TestAaiArtifactGenerator {
private ArtifactTestUtils testUtils;
- @Before
+ @BeforeEach
public void setup() {
testUtils = new ArtifactTestUtils();
testUtils.setGeneratorSystemProperties();
@@ -84,19 +85,21 @@ public class TestAaiArtifactGenerator {
* @throws XmlArtifactGenerationException
* if the configured widget mappings do not support processed widget type(s)
*/
- @Test(expected = IllegalArgumentException.class)
+ @Test
public void testParserWithIncompleteMappings()
throws SdcToscaParserException, IOException, XmlArtifactGenerationException {
- testUtils.loadWidgetMappings();
+ assertThrows(IllegalArgumentException.class, () -> {
+ testUtils.loadWidgetMappings();
- AaiArtifactGenerator artifactGenerator = new AaiArtifactGenerator();
- WidgetType.clearElements(); // Remove all WidgetTypes so that the generator fails
+ AaiArtifactGenerator artifactGenerator = new AaiArtifactGenerator();
+ WidgetType.clearElements(); // Remove all WidgetTypes so that the generator fails
- ISdcCsarHelper csarHelper = SdcToscaParserFactory.getInstance()
- .getSdcCsarHelper(TestAaiArtifactGenerator.class.getClassLoader()
- .getResource(ArtifactTestUtils.CSAR_INPUTS_FOLDER + CsarTest.VNF_VENDOR_CSAR.getName())
- .getFile().toString());
- artifactGenerator.generateAllArtifacts("1.0", csarHelper);
+ ISdcCsarHelper csarHelper = SdcToscaParserFactory.getInstance()
+ .getSdcCsarHelper(TestAaiArtifactGenerator.class.getClassLoader()
+ .getResource(ArtifactTestUtils.CSAR_INPUTS_FOLDER + CsarTest.VNF_VENDOR_CSAR.getName())
+ .getFile().toString());
+ artifactGenerator.generateAllArtifacts("1.0", csarHelper);
+ });
}
/**