Further cleanup of tests
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / Bug5481Test.java
index 062e2cd62b7123b7086cb68c2edfc59f6c63c0c0..6926d024fbffd33f1ed5673dd68dda608c612aa4 100644 (file)
@@ -7,9 +7,10 @@
  */
 package org.opendaylight.yangtools.yang.stmt;
 
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.util.Optional;
@@ -17,25 +18,23 @@ import org.junit.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.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.Status;
 import org.opendaylight.yangtools.yang.xpath.api.YangXPathExpression.QualifiedBound;
 
-public class Bug5481Test {
+public class Bug5481Test extends AbstractYangTest {
     @Test
     public void test() throws Exception {
-        SchemaContext context = StmtTestUtils.parseYangSources("/bugs/bug5481");
-        assertNotNull(context);
-
+        final var context = assertEffectiveModelDir("/bugs/bug5481");
         ContainerSchemaNode topContainer = verifyTopContainer(context);
         verifyExtendedLeaf(topContainer);
     }
 
-    private static ContainerSchemaNode verifyTopContainer(final SchemaContext context) {
+    private static ContainerSchemaNode verifyTopContainer(final EffectiveModelContext context) {
         QName top = QName.create("http://example.com/module1", "2016-03-09", "top");
         DataSchemaNode dataChildByName = context.getDataChildByName(top);
-        assertTrue(dataChildByName instanceof ContainerSchemaNode);
+        assertThat(dataChildByName, instanceOf(ContainerSchemaNode.class));
 
         ContainerSchemaNode topContainer = (ContainerSchemaNode) dataChildByName;