Further cleanup of tests
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / Bug5518Test.java
index 88c034f9c31a6f88862913276e462d6347f80ed2..c9eed5281c0e6ad09ff150f80216f29ad7ad5468 100644 (file)
@@ -7,9 +7,9 @@
  */
 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.assertNotNull;
-import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 import org.junit.Test;
@@ -17,16 +17,13 @@ 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.MustDefinition;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
-public class Bug5518Test {
+public class Bug5518Test extends AbstractYangTest {
     @Test
-    public void test() throws Exception {
-        final SchemaContext context = StmtTestUtils.parseYangSources("/bugs/bug5518");
-        assertNotNull(context);
-
+    public void test() {
+        final var context = assertEffectiveModelDir("/bugs/bug5518");
         final DataSchemaNode dataChildByName = context.getDataChildByName(QName.create("foo", "root"));
-        assertTrue(dataChildByName instanceof ContainerSchemaNode);
+        assertThat(dataChildByName, instanceOf(ContainerSchemaNode.class));
         final ContainerSchemaNode root = (ContainerSchemaNode) dataChildByName;
         final Collection<? extends MustDefinition> mustConstraints = root.getMustConstraints();
         assertEquals(1, mustConstraints.size());