Port yang-parser-rfc7950 to JUnit 5
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / Bug6240Test.java
index dc590638a30112fdfdb1fca70f720c6760c86596..5a11d99a8e12657f028f6a5086ed96dcb827d616 100644 (file)
@@ -10,21 +10,22 @@ package org.opendaylight.yangtools.yang.stmt;
 import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.hamcrest.CoreMatchers.startsWith;
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
 
-public class Bug6240Test extends AbstractYangTest {
+class Bug6240Test extends AbstractYangTest {
     private static final String NS = "bar";
     private static final String REV = "2016-07-19";
 
     @Test
-    public void testModels() throws Exception {
+    void testModels() throws Exception {
         final var context = assertEffectiveModelDir("/bugs/bug6240/correct");
 
         final var modules = context.getModules();
@@ -39,14 +40,14 @@ public class Bug6240Test extends AbstractYangTest {
         }
 
         assertNotNull(bar);
-        assertThat(bar.getDataChildByName(QName.create(NS, REV, "foo-grp-con")), instanceOf(ContainerSchemaNode.class));
+        assertInstanceOf(ContainerSchemaNode.class, bar.getDataChildByName(QName.create(NS, REV, "foo-grp-con")));
         assertThat(bar.getDataChildByName(QName.create(NS, REV, "sub-foo-grp-con")),
             instanceOf(ContainerSchemaNode.class));
 
         assertEquals(1, bar.getSubmodules().size());
 
         final DataSchemaNode dataChildByName = bar.getDataChildByName(QName.create(NS, REV, "sub-bar-con"));
-        assertThat(dataChildByName, instanceOf(ContainerSchemaNode.class));
+        assertInstanceOf(ContainerSchemaNode.class, dataChildByName);
         final ContainerSchemaNode subBarCon = (ContainerSchemaNode) dataChildByName;
 
         assertThat(subBarCon.getDataChildByName(QName.create(NS, REV, "foo-grp-con")),
@@ -56,7 +57,7 @@ public class Bug6240Test extends AbstractYangTest {
     }
 
     @Test
-    public void testInvalidModels() {
+    void testInvalidModels() {
         assertInferenceExceptionDir("/bugs/bug6240/incorrect",
             startsWith("Grouping '(bar?revision=2016-07-19)foo-imp-grp' was not resolved."));
     }