Add missing test assertions 48/86648/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 30 Dec 2019 21:24:03 +0000 (22:24 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 30 Dec 2019 21:24:38 +0000 (22:24 +0100)
While the test has shown the exception no longer occurs, it should
also make assertions. Add that.

JIRA: YANGTOOLS-1060
Change-Id: Id3f864f769c3ac845fe5ed3501fba24502206202
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-util-ut/src/test/java/org/opendaylight/yangtools/yang/model/util/ut/YT1060Test.java

index 9d9d172a374a6df18034da5f61a827e16696daa4..4c1d5dd9c8e6bf4a841d2c440a8e3e284cea3761 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.yangtools.yang.model.api.PathExpression;
 import org.opendaylight.yangtools.yang.model.api.PathExpression.LocationPathSteps;
 import org.opendaylight.yangtools.yang.model.api.PathExpression.Steps;
 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition;
 import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
@@ -60,12 +61,8 @@ public class YT1060Test {
     @Test
     public void testFindDataSchemaNode() {
         final SchemaNode found = SchemaContextUtil.findDataTreeSchemaNode(context, CONT.getModule(), path);
-
-
-
-
-//        final SchemaNode found =  SchemaContextUtil.findDataSchemaNodeForRelativeXPath(context, module, secondaryType,
-//            ((LeafrefTypeDefinition) typeNodeType).getPathStatement());
-//        assertSame(primaryType, found);
+        assertThat(found, isA(LeafSchemaNode.class));
+        assertEquals(SchemaPath.create(true, QName.create("imported", "root"), QName.create("imported", "leaf1")),
+            found.getPath());
     }
 }