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=0c79dc5fdce3671658db5ac04955716803cff18f;hp=86985d8631f5288474fa3835ac2f05bcbf18a24d;hb=HEAD;hpb=0b4016fbde53d49f9511a4253e22285681840572 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 86985d8..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 @@ -26,13 +26,14 @@ 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.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 { @@ -129,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() {