Remove Augmentation{Identifier,Node}
[yangtools.git] / data / yang-data-tree-ri / src / test / java / org / opendaylight / yangtools / yang / data / tree / impl / YT1276Test.java
index dbb973c750e2d3ceb7900957dc2233f6670127a2..abcd8f665e03341209555577f47bcab721b2d090 100644 (file)
@@ -10,13 +10,11 @@ package org.opendaylight.yangtools.yang.data.tree.impl;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThrows;
 
-import java.util.Set;
 import java.util.function.Consumer;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
@@ -58,10 +56,7 @@ public class YT1276Test {
         applyOperation(mod -> {
             mod.write(YangInstanceIdentifier.of(FOO), Builders.containerBuilder()
                 .withNodeIdentifier(new NodeIdentifier(FOO))
-                .withChild(Builders.augmentationBuilder()
-                    .withNodeIdentifier(new AugmentationIdentifier(Set.of(BAR)))
-                    .withChild(ImmutableNodes.leafNode(BAR, "xyzzy"))
-                    .build())
+                .withChild(ImmutableNodes.leafNode(BAR, "xyzzy"))
                 .build());
         });
     }
@@ -84,9 +79,7 @@ public class YT1276Test {
                 .withNodeIdentifier(new NodeIdentifier(FOO))
                 .build());
         });
-        assertEquals(
-            "Node (foo)foo is missing mandatory descendant /AugmentationIdentifier{childNames=[(foo)bar]}/(foo)bar",
-            ex.getMessage());
+        assertEquals("Node (foo)foo is missing mandatory descendant /(foo)bar", ex.getMessage());
     }
 
     @Test
@@ -97,15 +90,12 @@ public class YT1276Test {
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(new NodeIdentifier(BAZ))
                     .withChild(ImmutableNodes.leafNode(XYZZY_LEAF, "xyzzy"))
-                    .withChild(Builders.augmentationBuilder()
-                        .withNodeIdentifier(new AugmentationIdentifier(Set.of(XYZZY_AUGMENT, XYZZY_AUGMENT_CONT)))
-                        .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT, "xyzzy"))
+                    .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT, "xyzzy"))
+                    .withChild(Builders.containerBuilder()
+                        .withNodeIdentifier(new NodeIdentifier(XYZZY_AUGMENT_CONT))
                         .withChild(Builders.containerBuilder()
-                            .withNodeIdentifier(new NodeIdentifier(XYZZY_AUGMENT_CONT))
-                            .withChild(Builders.containerBuilder()
-                                .withNodeIdentifier(new NodeIdentifier(XYZZY_AUGMENT_CONT_INNER))
-                                .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT_CONT_LEAF, "aug-cont-leaf"))
-                                .build())
+                            .withNodeIdentifier(new NodeIdentifier(XYZZY_AUGMENT_CONT_INNER))
+                            .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT_CONT_LEAF, "aug-cont-leaf"))
                             .build())
                         .build())
                     .build())
@@ -202,15 +192,12 @@ public class YT1276Test {
                 .withNodeIdentifier(new NodeIdentifier(BAR))
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(new NodeIdentifier(BAZ))
-                    .withChild(Builders.augmentationBuilder()
-                        .withNodeIdentifier(new AugmentationIdentifier(Set.of(XYZZY_AUGMENT, XYZZY_AUGMENT_CONT)))
-                        .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT, "xyzzy"))
+                    .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT, "xyzzy"))
+                    .withChild(Builders.containerBuilder()
+                        .withNodeIdentifier(NodeIdentifier.create(XYZZY_AUGMENT_CONT))
                         .withChild(Builders.containerBuilder()
-                            .withNodeIdentifier(NodeIdentifier.create(XYZZY_AUGMENT_CONT))
-                            .withChild(Builders.containerBuilder()
-                                .withNodeIdentifier(NodeIdentifier.create(XYZZY_AUGMENT_CONT_INNER))
-                                .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT_CONT_LEAF, "aug-cont-leaf"))
-                                .build())
+                            .withNodeIdentifier(NodeIdentifier.create(XYZZY_AUGMENT_CONT_INNER))
+                            .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT_CONT_LEAF, "aug-cont-leaf"))
                             .build())
                         .build())
                     .build())
@@ -232,8 +219,7 @@ public class YT1276Test {
                     .build())
                 .build());
         });
-        assertEquals("Node (foo)baz is missing mandatory descendant /AugmentationIdentifier{childNames="
-                + "[(foo)xyzzy-augment, (foo)xyzzy-augment-container]}/(foo)xyzzy-augment", ex.getMessage());
+        assertEquals("Node (foo)baz is missing mandatory descendant /(foo)xyzzy-augment", ex.getMessage());
 
     }