Improve SchemaNodeIdentifier.toString()
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / yin / YinFileAugmentStmtTest.java
index ce4ad365600ff33fbfdb619360be01f42ccbf714..f6abe8edc7783ab09b0a7c510f90169b0b4c6aa4 100644 (file)
@@ -7,12 +7,14 @@
  */
 package org.opendaylight.yangtools.yang.stmt.yin;
 
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.isA;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 
+import java.util.Collection;
 import java.util.Iterator;
-import java.util.Set;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode;
@@ -28,20 +30,19 @@ public class YinFileAugmentStmtTest extends AbstractYinModulesTest {
         final Module testModule = TestUtils.findModule(context, "main-impl").get();
         assertNotNull(testModule);
 
-        final Set<AugmentationSchemaNode> augmentations = testModule.getAugmentations();
+        final Collection<? extends AugmentationSchemaNode> augmentations = testModule.getAugmentations();
         assertEquals(1, augmentations.size());
 
-        final Iterator<AugmentationSchemaNode> augmentIterator = augmentations.iterator();
+        final Iterator<? extends AugmentationSchemaNode> augmentIterator = augmentations.iterator();
         final AugmentationSchemaNode augment = augmentIterator.next();
         assertNotNull(augment);
-        assertTrue(augment.getTargetPath().toString().contains(
-                "(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)modules, "
-                        + "(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)module, "
-                        + "(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)configuration"));
+        assertThat(augment.getTargetPath().toString(), containsString(
+            "(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)modules, module, "
+                    + "configuration"));
 
         assertEquals(1, augment.getChildNodes().size());
         final DataSchemaNode caseNode = augment.findDataChildByName(
             QName.create(testModule.getQNameModule(), "main-impl")).get();
-        assertTrue(caseNode instanceof CaseSchemaNode);
+        assertThat(caseNode, isA(CaseSchemaNode.class));
     }
 }