X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fmodel-loader.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fmodelloader%2Fentity%2Fmodel%2FModelSorterTest.java;h=86985d8631f5288474fa3835ac2f05bcbf18a24d;hp=8f4bf8df6c260bec3f6b31362e67600a5931342a;hb=HEAD;hpb=50889fa7107127868a9a4391218772ff58d0ac2e diff --git a/src/test/java/org/onap/aai/modelloader/entity/model/ModelSorterTest.java b/src/test/java/org/onap/aai/modelloader/entity/model/ModelSorterTest.java index 8f4bf8d..0c79dc5 100644 --- a/src/test/java/org/onap/aai/modelloader/entity/model/ModelSorterTest.java +++ b/src/test/java/org/onap/aai/modelloader/entity/model/ModelSorterTest.java @@ -24,14 +24,16 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.isEmptyString; -import static org.junit.Assert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Test; + +import org.junit.jupiter.api.Test; import org.onap.aai.modelloader.entity.Artifact; public class ModelSorterTest { @@ -128,12 +130,14 @@ public class ModelSorterTest { assertThat(new ModelSorter().sort(Arrays.asList(nq1, nq2, artifact)), is(expected)); } - @Test(expected = BabelArtifactParsingException.class) + @Test public void circularDependency() throws BabelArtifactParsingException { - List modelList = new ArrayList(); - modelList.add(buildTestModel("aaaa", "1111", "bbbb|1111")); - modelList.add(buildTestModel("bbbb", "1111", "aaaa|1111")); - new ModelSorter().sort(modelList); + assertThrows(BabelArtifactParsingException.class, () -> { + List modelList = new ArrayList(); + modelList.add(buildTestModel("aaaa", "1111", "bbbb|1111")); + modelList.add(buildTestModel("bbbb", "1111", "aaaa|1111")); + new ModelSorter().sort(modelList); + }); } private ModelArtifact buildTestModel() {