Use Optional.isEmpty()
[yangtools.git] / data / yang-data-tree-ri / src / test / java / org / opendaylight / yangtools / yang / data / tree / impl / OrderedListTest.java
index 6e3576f549d382bab4aec9a704814668d9f54b26..d0ca71bbcbf4b772b981d745f9a1593c6fe179c3 100644 (file)
@@ -64,7 +64,39 @@ public class OrderedListTest {
         parentOrdinaryLeaf = QName.create(testModule, "parent-ordinary-leaf");
         childOrdinaryLeaf = QName.create(testModule, "child-ordinary-leaf");
         inMemoryDataTree = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL,
-            YangParserTestUtils.parseYangResource("/ordered-list-modification-test.yang"));
+            YangParserTestUtils.parseYang("""
+                module ordered-list-modification-test {
+                  namespace "ordered-list-modification-test";
+                  prefix "olmt";
+
+                  container parent-container {
+                    container child-container {
+                      list parent-ordered-list {
+                        ordered-by user;
+                        key "parent-key-leaf";
+
+                        leaf parent-key-leaf {
+                          type string;
+                        }
+                        leaf parent-ordinary-leaf {
+                          type string;
+                        }
+
+                        list child-ordered-list {
+                          ordered-by user;
+                          key "child-key-leaf";
+
+                          leaf child-key-leaf {
+                            type string;
+                          }
+                          leaf child-ordinary-leaf {
+                            type string;
+                          }
+                        }
+                      }
+                    }
+                  }
+                }"""));
     }
 
     @Test
@@ -99,8 +131,8 @@ public class OrderedListTest {
                 .withChild(createChildOrderedListEntry("chkval1", "chlfval1"))
                 .withChild(createChildOrderedListEntry("chkval2", "chlfval2")).build();
 
-        YangInstanceIdentifier path2 = YangInstanceIdentifier.of(parentContainer).node(childContainer)
-                .node(parentOrderedList).node(createParentOrderedListEntryPath("pkval2")).node(childOrderedList);
+        YangInstanceIdentifier path2 = YangInstanceIdentifier.of(parentContainer, childContainer, parentOrderedList)
+            .node(createParentOrderedListEntryPath("pkval2")).node(childOrderedList);
 
         treeModification.write(path2, childOrderedListNode);
         treeModification.ready();