X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fbabel%2Fxml%2Fgenerator%2Fmodel%2FTestModel.java;h=93dd4432f6c42a84bcf7f4234c930f57b3ac7a57;hb=176c445bbeb5e47011ff2ca4816c00dd0f6ea779;hp=700cf389a0c6c6affce88d1dba468cd5dc70135a;hpb=811169825805a7160a6dd28abb281f64a4a56c71;p=aai%2Fbabel.git diff --git a/src/test/java/org/onap/aai/babel/xml/generator/model/TestModel.java b/src/test/java/org/onap/aai/babel/xml/generator/model/TestModel.java index 700cf38..93dd443 100644 --- a/src/test/java/org/onap/aai/babel/xml/generator/model/TestModel.java +++ b/src/test/java/org/onap/aai/babel/xml/generator/model/TestModel.java @@ -23,11 +23,13 @@ package org.onap.aai.babel.xml.generator.model; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertThrows; import java.io.IOException; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.onap.aai.babel.util.ArtifactTestUtils; /** @@ -42,7 +44,7 @@ public class TestModel { * @throws IOException * if the mappings configuration cannot be loaded */ - @BeforeClass + @BeforeAll public static void setup() throws IOException { new ArtifactTestUtils().loadWidgetMappings(); } @@ -74,18 +76,22 @@ public class TestModel { /** * Test that there is no exception if processing a Model that has no metadata properties. */ - @Test(expected = Test.None.class /* no exception expected */) + @Test public void testNullIdentProperties() { - createTestModel().populateModelIdentificationInformation(null); + assertDoesNotThrow(() -> { + createTestModel().populateModelIdentificationInformation(null); + }); } /** * Test that an exception occurs if calling code passes an unsupported Widget Type value to the base implementation * of the hasWidgetType() method. */ - @Test(expected = IllegalArgumentException.class) + @Test public void testUnknownWidgetType() { - createTestModel().hasWidgetType(null); + assertThrows(IllegalArgumentException.class, () -> { + createTestModel().hasWidgetType(null); + }); } /**