We have a few stragglers, migrate them.
JIRA: YANGTOOLS-1259
Change-Id: Ie21d13359c7ec8d4b10f3ca4193460c478acefc3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
.withNodeIdentifier(BenchmarkModel.INNER_LIST);
for (int i = 0; i < count; ++i) {
- mapEntryBuilder
- .withChild(ImmutableNodes.mapEntry(BenchmarkModel.INNER_LIST_QNAME, BenchmarkModel.NAME_QNAME, i));
+ mapEntryBuilder.withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(BenchmarkModel.INNER_LIST_QNAME, BenchmarkModel.NAME_QNAME, i))
+ .withChild(ImmutableNodes.leafNode(BenchmarkModel.NAME_QNAME, i))
+ .build());
}
return mapEntryBuilder.build();
.withChild(ImmutableNodes.leafNode(TestModel.EMPTY_QNAME, Empty.value()))
.withChild(ImmutableNodes.newUserMapBuilder()
.withNodeIdentifier(new NodeIdentifier(TestModel.ORDERED_LIST_QNAME))
- .withChild(ImmutableNodes.mapEntry(TestModel.ORDERED_LIST_ENTRY_QNAME, TestModel.ID_QNAME, 11))
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(TestModel.ORDERED_LIST_ENTRY_QNAME, TestModel.ID_QNAME, 11))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, 11))
+ .build())
.build())
.build();
}
.withChild(ImmutableNodes.leafNode(ID_QNAME, TWO_ID))
.withChild(ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(INNER_LIST_QNAME))
- .withChild(ImmutableNodes.mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_ONE_NAME))
- .withChild(ImmutableNodes.mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME))
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(INNER_LIST_QNAME, NAME_QNAME, TWO_ONE_NAME))
+ .withChild(ImmutableNodes.leafNode(NAME_QNAME, TWO_ONE_NAME))
+ .build())
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME))
+ .withChild(ImmutableNodes.leafNode(NAME_QNAME, TWO_TWO_NAME))
+ .build())
.build())
.build();
.build())
.withChild(ImmutableNodes.newUserMapBuilder()
.withNodeIdentifier(new NodeIdentifier(ORDERED_LIST_QNAME))
- .withChild(ImmutableNodes.mapEntry(ORDERED_LIST_QNAME, ORDERED_LIST_ENTRY_QNAME, "1"))
- .withChild(ImmutableNodes.mapEntry(ORDERED_LIST_QNAME, ORDERED_LIST_ENTRY_QNAME, "2"))
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(ORDERED_LIST_QNAME, ORDERED_LIST_ENTRY_QNAME, "1"))
+ .withChild(ImmutableNodes.leafNode(ORDERED_LIST_ENTRY_QNAME, "1"))
+ .build())
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(ORDERED_LIST_QNAME, ORDERED_LIST_ENTRY_QNAME, "2"))
+ .withChild(ImmutableNodes.leafNode(ORDERED_LIST_ENTRY_QNAME, "2"))
+ .build())
.build())
// Create a list of shoes
.withChild(ImmutableNodes.newSystemLeafSetBuilder()
.build())
.withChild(ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(OUTER_LIST_QNAME))
- .withChild(ImmutableNodes.mapEntry(OUTER_LIST_QNAME, ID_QNAME, ONE_ID))
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(OUTER_LIST_QNAME, ID_QNAME, ONE_ID))
+ .withChild(ImmutableNodes.leafNode(ID_QNAME, ONE_ID))
+ .build())
.withChild(BAR_NODE)
.build());
}
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
+import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.impl.schema.SchemaOrderedNormalizedNodeWriter;
import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
createQName(FOO_NAMESPACE, NAME_NODE), "policy1"))
.withChild(ImmutableNodes.newUserMapBuilder()
.withNodeIdentifier(getNodeIdentifier(FOO_NAMESPACE, RULE_NODE))
- .withChild(ImmutableNodes.mapEntry(createQName(FOO_NAMESPACE, RULE_NODE),
- createQName(FOO_NAMESPACE, NAME_NODE), "rule1"))
- .withChild(ImmutableNodes.mapEntry(createQName(FOO_NAMESPACE, RULE_NODE),
- createQName(FOO_NAMESPACE, NAME_NODE), "rule2"))
- .withChild(ImmutableNodes.mapEntry(createQName(FOO_NAMESPACE, RULE_NODE),
- createQName(FOO_NAMESPACE, NAME_NODE), "rule3"))
- .withChild(ImmutableNodes.mapEntry(createQName(FOO_NAMESPACE, RULE_NODE),
- createQName(FOO_NAMESPACE, NAME_NODE), "rule4"))
+ .withChild(newRule("rule1"))
+ .withChild(newRule("rule2"))
+ .withChild(newRule("rule3"))
+ .withChild(newRule("rule4"))
.build())
.build())
.withChild(ImmutableNodes.newMapEntryBuilder()
assertFalse(diff.hasDifferences(), diff.toString());
}
+ private static MapEntryNode newRule(final String ruleName) {
+ final var name = createQName(FOO_NAMESPACE, NAME_NODE);
+ return ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(createQName(FOO_NAMESPACE, RULE_NODE), name, ruleName))
+ .withChild(ImmutableNodes.leafNode(name, ruleName))
+ .build();
+ }
+
@ParameterizedTest(name = "{0}")
@ArgumentsSource(TestFactories.class)
void testWriteOrder(final String factoryMode, final XMLOutputFactory factory) throws Exception {
.withNodeIdentifier(new NodeIdentifier(ROOT_QNAME))
.withChild(ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(LIST_A_QNAME))
- .withChild(ImmutableNodes.mapEntry(LIST_A_QNAME, LEAF_A_QNAME, FOO))
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(LIST_A_QNAME, LEAF_A_QNAME, FOO))
+ .withChild(ImmutableNodes.leafNode(LEAF_A_QNAME, FOO))
+ .build())
.withChild(ImmutableNodes.newMapEntryBuilder()
.withNodeIdentifier(NodeIdentifierWithPredicates.of(LIST_A_QNAME, LEAF_A_QNAME, BAR))
.withChild(ImmutableNodes.leafNode(LEAF_A_QNAME, BAR))
.withChild(ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(LIST_B_QNAME))
- .withChild(ImmutableNodes.mapEntry(LIST_B_QNAME, LEAF_B_QNAME, ONE))
- .withChild(ImmutableNodes.mapEntry(LIST_B_QNAME, LEAF_B_QNAME, TWO))
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(LIST_B_QNAME, LEAF_B_QNAME, ONE))
+ .withChild(ImmutableNodes.leafNode(LEAF_B_QNAME, ONE))
+ .build())
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(LIST_B_QNAME, LEAF_B_QNAME, TWO))
+ .withChild(ImmutableNodes.leafNode(LEAF_B_QNAME, TWO))
+ .build())
.build())
.build())
.build())
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
import org.opendaylight.yangtools.yang.data.api.schema.AnydataNode;
import org.opendaylight.yangtools.yang.data.api.schema.AnyxmlNode;
return leafNode(NodeIdentifier.create(name), value);
}
- public static @NonNull MapEntryNode mapEntry(final NodeIdentifierWithPredicates name) {
- return BUILDER_FACTORY.newMapEntryBuilder(name.size()).withNodeIdentifier(name).build();
- }
-
- public static @NonNull MapEntryNode mapEntry(final QName listName, final QName keyName, final Object keyValue) {
- return mapEntry(NodeIdentifierWithPredicates.of(listName, keyName, keyValue));
- }
-
public static <T> @NonNull LeafSetEntryNode<T> leafSetEntry(final NodeWithValue<T> name) {
return ImmutableLeafSetEntryNode.of(name);
}
private static final NodeIdentifier NODE_IDENTIFIER_LIST = NodeIdentifier.create(LIST_MAIN);
private static final NodeIdentifier NODE_IDENTIFIER_LEAF_LIST = NodeIdentifier.create(LEAF_LIST_MAIN);
private static final NodeIdentifier NODE_IDENTIFIER_LEAF = NodeIdentifier.create(LIST_MAIN_CHILD_QNAME_1);
- private static final MapEntryNode LIST_MAIN_CHILD_1 = ImmutableNodes.mapEntry(
- NodeIdentifierWithPredicates.of(LIST_MAIN, LIST_MAIN_CHILD_QNAME_1, 1));
- private static final MapEntryNode LIST_MAIN_CHILD_2 = ImmutableNodes.mapEntry(
- NodeIdentifierWithPredicates.of(LIST_MAIN, LIST_MAIN_CHILD_QNAME_1, 2));
- private static final MapEntryNode LIST_MAIN_CHILD_3 = ImmutableNodes.mapEntry(
- NodeIdentifierWithPredicates.of(LIST_MAIN, LIST_MAIN_CHILD_QNAME_1, 3));
+ private static final MapEntryNode LIST_MAIN_CHILD_1 = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(LIST_MAIN, LIST_MAIN_CHILD_QNAME_1, 1))
+ .withChild(ImmutableNodes.leafNode(LIST_MAIN_CHILD_QNAME_1, 1))
+ .build();
+ private static final MapEntryNode LIST_MAIN_CHILD_2 = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(LIST_MAIN, LIST_MAIN_CHILD_QNAME_1, 2))
+ .withChild(ImmutableNodes.leafNode(LIST_MAIN_CHILD_QNAME_1, 2))
+ .build();
+ private static final MapEntryNode LIST_MAIN_CHILD_3 = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(LIST_MAIN, LIST_MAIN_CHILD_QNAME_1, 3))
+ .withChild(ImmutableNodes.leafNode(LIST_MAIN_CHILD_QNAME_1, 3))
+ .build();
private static final int SIZE = 3;
private static final NodeWithValue<String> BAR_PATH = new NodeWithValue<>(LEAF_LIST_MAIN, "bar");
private static final LeafSetEntryNode<String> LEAF_SET_ENTRY_NODE =
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-model-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-model-spi</artifactId>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-model-util</artifactId>
protected static MapNode createMapNode() {
return ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(LIST_A_QNAME))
- .withChild(ImmutableNodes.mapEntry(LIST_A_QNAME, LEAF_A_QNAME, "foo"))
+ .withChild(createMapEntry(LIST_A_QNAME, LEAF_A_QNAME, "foo"))
.withChild(createMapEntryNode())
.build();
}
+ private static MapEntryNode createMapEntry(final QName list, final QName key, final String value) {
+ return ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(list, key, value))
+ .withChild(ImmutableNodes.leafNode(key, value))
+ .build();
+ }
+
protected static MapEntryNode createMapEntryNode() {
return ImmutableNodes.newMapEntryBuilder()
.withNodeIdentifier(NodeIdentifierWithPredicates.of(LIST_A_QNAME, LEAF_A_QNAME, "bar"))
.withChild(ImmutableNodes.leafNode(LEAF_A_QNAME, "bar"))
.withChild(ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(LIST_B_QNAME))
- .withChild(ImmutableNodes.mapEntry(LIST_B_QNAME, LEAF_B_QNAME, "one"))
- .withChild(ImmutableNodes.mapEntry(LIST_B_QNAME, LEAF_B_QNAME, "two"))
+ .withChild(createMapEntry(LIST_B_QNAME, LEAF_B_QNAME, "one"))
+ .withChild(createMapEntry(LIST_B_QNAME, LEAF_B_QNAME, "two"))
.build())
.build();
}
.withNodeIdentifier(new NodeIdentifier(ANOTHER_QNAME))
.withChild(ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(LIST_ANOTHER_NAMESPACE_QNAME))
- .withChild(ImmutableNodes.mapEntry(LIST_ANOTHER_NAMESPACE_QNAME, LEAF_ANOTHER_NAMESPACE_QNAME,
+ .withChild(createMapEntry(LIST_ANOTHER_NAMESPACE_QNAME, LEAF_ANOTHER_NAMESPACE_QNAME,
"Leaf from another namespace value"))
.build())
.build();
}
protected static MapEntryNode createUserMapEntryNode() {
- return ImmutableNodes.mapEntry(USER_MAP_QNAME, USER_MAP_ENTRY_QNAME, "User map entry value");
+ return createMapEntry(USER_MAP_QNAME, USER_MAP_ENTRY_QNAME, "User map entry value");
}
protected static UnkeyedListNode createUnkeyedListNode() {
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer;
import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes;
import org.opendaylight.yangtools.yang.data.tree.api.DataTree;
@Test
void testWriteMerge1() throws DataValidationFailedException {
- final var fooEntryNode = ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1);
- final var barEntryNode = ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 2);
+ final var fooEntryNode = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, 1))
+ .build();
+ final var barEntryNode = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 2))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, 2))
+ .build();
final var mapNode1 = ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
.withChild(fooEntryNode).build();
.withNodeIdentifier(NodeIdentifierWithPredicates.of(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, "baz"))
.withChild(ImmutableNodes.leafNode(MIN_MAX_VALUE_LEAF_QNAME, "baztest"))
.build();
- private final MapEntryNode fooEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME,
- "foo");
- private final MapEntryNode barEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME,
- "bar");
- private final MapEntryNode bazEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME,
- "baz");
+ private final MapEntryNode fooEntryNode = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, "foo"))
+ .withChild(ImmutableNodes.leafNode(MIN_MAX_KEY_LEAF_QNAME, "foo"))
+ .build();
+ private final MapEntryNode barEntryNode = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, "bar"))
+ .withChild(ImmutableNodes.leafNode(MIN_MAX_KEY_LEAF_QNAME, "bar"))
+ .build();
+ private final MapEntryNode bazEntryNode = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, "baz"))
+ .withChild(ImmutableNodes.leafNode(MIN_MAX_KEY_LEAF_QNAME, "baz"))
+ .build();
private final SystemMapNode mapNodeBazFuzWithNodes = ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(MIN_MAX_LIST_QNAME))
.withChild(bazEntryNode).withChild(bazEntryNodeWithValue).withChild(fooEntryNode)
@Test
void minMaxListNoMinMaxDeleteTest() throws DataValidationFailedException {
- final var fooEntryNoMinMaxNode =
- ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME_NO_MINMAX, MIN_MAX_KEY_LEAF_QNAME, "foo");
+ final var fooEntryNoMinMaxNode = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(MIN_MAX_LIST_QNAME_NO_MINMAX, MIN_MAX_KEY_LEAF_QNAME, "foo"))
+ .withChild(ImmutableNodes.leafNode(MIN_MAX_KEY_LEAF_QNAME, "foo"))
+ .build();
final var mapNode1 = ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(MIN_MAX_LIST_QNAME_NO_MINMAX))
.withChild(fooEntryNoMinMaxNode).build();
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
-import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntryBuilder;
-import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapNodeBuilder;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes;
.nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID)
.build();
- private static final MapEntryNode FOO_NODE = mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID)
- .withChild(mapNodeBuilder(TestModel.INNER_LIST_QNAME).build())
- .build();
-
- private static final MapEntryNode BAR_NODE = mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID)
- .withChild(mapNodeBuilder(TestModel.INNER_LIST_QNAME).build())
- .build();
+ private static final MapEntryNode FOO_NODE = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, ONE_ID))
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.INNER_LIST_QNAME))
+ .build())
+ .build();
+
+ private static final MapEntryNode BAR_NODE = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, TWO_ID))
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.INNER_LIST_QNAME))
+ .build())
+ .build();
private DataTree inMemoryDataTree;
private static ContainerNode createFooTestContainerNode() {
return ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
- .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME).withChild(FOO_NODE).build())
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
+ .withChild(FOO_NODE)
+ .build())
.build();
}
private static ContainerNode createBarTestContainerNode() {
return ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
- .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME).withChild(BAR_NODE).build())
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
+ .withChild(BAR_NODE)
+ .build())
.build();
}
void writeWriteFooBar2ndLevelEmptyContainerTest() throws DataValidationFailedException {
final var initialDataTreeModification = inMemoryDataTree.takeSnapshot().newModification();
initialDataTreeModification.write(TestModel.TEST_PATH, emptyContainer(TestModel.TEST_QNAME));
- initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+ initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
.build());
initialDataTreeModification.ready();
inMemoryDataTree.commit(inMemoryDataTree.prepare(initialDataTreeModification));
void writeMergeFooBar2ndLevelEmptyContainerTest() throws DataValidationFailedException {
final var initialDataTreeModification = inMemoryDataTree.takeSnapshot().newModification();
initialDataTreeModification.write(TestModel.TEST_PATH, emptyContainer(TestModel.TEST_QNAME));
- initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+ initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
.build());
initialDataTreeModification.ready();
inMemoryDataTree.commit(inMemoryDataTree.prepare(initialDataTreeModification));
void mergeWriteFooBar2ndLevelEmptyContainerTest() throws DataValidationFailedException {
final var initialDataTreeModification = inMemoryDataTree.takeSnapshot().newModification();
initialDataTreeModification.write(TestModel.TEST_PATH, emptyContainer(TestModel.TEST_QNAME));
- initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+ initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
.build());
initialDataTreeModification.ready();
inMemoryDataTree.commit(inMemoryDataTree.prepare(initialDataTreeModification));
void mergeMergeFooBar2ndLevelEmptyContainerTest() throws DataValidationFailedException {
final var initialDataTreeModification = inMemoryDataTree.takeSnapshot().newModification();
initialDataTreeModification.write(TestModel.TEST_PATH, emptyContainer(TestModel.TEST_QNAME));
- initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+ initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
.build());
initialDataTreeModification.ready();
inMemoryDataTree.commit(inMemoryDataTree.prepare(initialDataTreeModification));
void deleteWriteFooBar2ndLevelEmptyContainerTest() throws DataValidationFailedException {
final var initialDataTreeModification = inMemoryDataTree.takeSnapshot().newModification();
initialDataTreeModification.write(TestModel.TEST_PATH, emptyContainer(TestModel.TEST_QNAME));
- initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+ initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
.build());
initialDataTreeModification.ready();
inMemoryDataTree.commit(inMemoryDataTree.prepare(initialDataTreeModification));
void deleteMergeFooBar2ndLevelEmptyContainerTest() throws DataValidationFailedException {
final var initialDataTreeModification = inMemoryDataTree.takeSnapshot().newModification();
initialDataTreeModification.write(TestModel.TEST_PATH, emptyContainer(TestModel.TEST_QNAME));
- initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+ initialDataTreeModification.write(TestModel.OUTER_LIST_PATH, ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
.build());
initialDataTreeModification.ready();
inMemoryDataTree.commit(inMemoryDataTree.prepare(initialDataTreeModification));
package org.opendaylight.yangtools.yang.data.tree.impl;
import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntryBuilder;
-import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapNodeBuilder;
import org.junit.jupiter.api.Test;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes;
.builder(TestModel.OUTER_LIST_PATH).nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID)
.build();
- private static final MapEntryNode INNER_FOO_ENTRY_NODE = ImmutableNodes.mapEntry(TestModel.INNER_LIST_QNAME,
- TestModel.NAME_QNAME, "foo");
-
- private static final MapEntryNode INNER_BAR_ENTRY_NODE =
- mapEntryBuilder(QName.create(TestModel.TEST_QNAME, "inner-list2"), TestModel.NAME_QNAME, "foo")
- .withChild(ImmutableNodes.leafNode(TestModel.VALUE_QNAME, "value")).build();
-
- private static final MapEntryNode FOO_NODE = mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID)
- .withChild(mapNodeBuilder(TestModel.INNER_LIST_QNAME).withChild(INNER_FOO_ENTRY_NODE)
- .build())
- .build();
-
- private static final MapEntryNode BAR_NODE = mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID)
- .withChild(mapNodeBuilder(TestModel.INNER_LIST_QNAME).withChild(INNER_BAR_ENTRY_NODE)
- .build())
- .build();
+ private static final MapEntryNode INNER_FOO_ENTRY_NODE = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, "foo"))
+ .withChild(ImmutableNodes.leafNode(TestModel.NAME_QNAME, "foo"))
+ .build();
+
+ private static final MapEntryNode INNER_BAR_ENTRY_NODE = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(QName.create(TestModel.TEST_QNAME, "inner-list2"),
+ TestModel.NAME_QNAME, "foo"))
+ .withChild(ImmutableNodes.leafNode(TestModel.NAME_QNAME, "foo"))
+ .withChild(ImmutableNodes.leafNode(TestModel.VALUE_QNAME, "value"))
+ .build();
+
+ private static final MapEntryNode FOO_NODE = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, ONE_ID))
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.INNER_LIST_QNAME))
+ .withChild(INNER_FOO_ENTRY_NODE)
+ .build())
+ .build();
+
+ private static final MapEntryNode BAR_NODE = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, TWO_ID))
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.INNER_LIST_QNAME))
+ .withChild(INNER_BAR_ENTRY_NODE)
+ .build())
+ .build();
private static ContainerNode createFooTestContainerNode() {
return ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
- .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME).withChild(FOO_NODE).build()).build();
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
+ .withChild(FOO_NODE)
+ .build())
+ .build();
}
private static ContainerNode createBarTestContainerNode() {
return ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
- .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME).withChild(BAR_NODE).build()).build();
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
+ .withChild(BAR_NODE)
+ .build())
+ .build();
}
@Test
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
import org.opendaylight.yangtools.yang.data.api.YangNetconfErrorAware;
import org.opendaylight.yangtools.yang.data.api.schema.DistinctNodeContainer;
+import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer;
import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes;
@Test
void minMaxListTestPass() throws DataValidationFailedException {
- final var fooEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, "foo");
- final var barEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, "bar");
+ final var fooEntryNode = minMaxEntry("foo");
+ final var barEntryNode = minMaxEntry("bar");
final var mapNode1 = ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(MIN_MAX_LIST_QNAME))
.withChild(fooEntryNode).build();
assertEquals(2, ((NormalizedNodeContainer<?>) minMaxListRead.orElseThrow()).size());
}
+ private static MapEntryNode minMaxEntry(final String value) {
+ return ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, value))
+ .withChild(ImmutableNodes.leafNode(MIN_MAX_KEY_LEAF_QNAME, value))
+ .build();
+ }
+
@Test
void minMaxListFail() throws DataValidationFailedException {
assertThrows(DataValidationFailedException.class, () -> {
var modificationTree = inMemoryDataTree.takeSnapshot().newModification();
- final var fooEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME,
- "foo");
- final var barEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME,
- "bar");
- final var gooEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME,
- "goo");
+ final var fooEntryNode = minMaxEntry("foo");
+ final var barEntryNode = minMaxEntry("bar");
+ final var gooEntryNode = minMaxEntry("goo");
final var mapNode = ImmutableNodes.newSystemMapBuilder()
.withNodeIdentifier(new NodeIdentifier(MIN_MAX_LIST_QNAME))
- .withChild(fooEntryNode).build();
+ .withChild(fooEntryNode)
+ .build();
final var fooPath = MIN_MAX_LIST_PATH.node(fooEntryNode.name());
final var barPath = MIN_MAX_LIST_PATH.node(barEntryNode.name());
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntryBuilder;
-import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapNodeBuilder;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes;
.node(TestModel.VALUE_QNAME)
.build();
- private static final MapEntryNode BAR_NODE = mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID)
- .withChild(mapNodeBuilder(TestModel.INNER_LIST_QNAME)
- .withChild(ImmutableNodes.mapEntry(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, TWO_ONE_NAME))
- .withChild(ImmutableNodes.mapEntry(TestModel.INNER_LIST_QNAME,TestModel.NAME_QNAME, TWO_TWO_NAME))
+ private static final MapEntryNode BAR_NODE = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, TWO_ID))
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.INNER_LIST_QNAME))
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, TWO_ONE_NAME))
+ .withChild(ImmutableNodes.leafNode(TestModel.NAME_QNAME, TWO_ONE_NAME))
+ .build())
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(TestModel.INNER_LIST_QNAME,TestModel.NAME_QNAME, TWO_TWO_NAME))
+ .withChild(ImmutableNodes.leafNode(TestModel.NAME_QNAME, TWO_TWO_NAME))
+ .build())
.build())
.build();
private static ContainerNode createTestContainer() {
return ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
- .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
- .withChild(ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID))
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, ONE_ID))
+ .build())
.withChild(BAR_NODE).build())
.build();
}
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
-import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntryBuilder;
-import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapNodeBuilder;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNodes;
import org.opendaylight.yangtools.yang.data.tree.impl.node.TreeNode;
import org.opendaylight.yangtools.yang.data.tree.impl.node.Version;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class StoreTreeNodesTest extends AbstractTestModelTest {
- private static final Logger LOG = LoggerFactory.getLogger(StoreTreeNodesTest.class);
+class StoreTreeNodesTest extends AbstractTestModelTest {
private static final Short ONE_ID = 1;
private static final Short TWO_ID = 2;
private static final String TWO_ONE_NAME = "one";
.nodeWithKey(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, TWO_TWO_NAME)
.build();
- private static final MapEntryNode BAR_NODE = mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID)
- .withChild(mapNodeBuilder(TestModel.INNER_LIST_QNAME)
- .withChild(ImmutableNodes.mapEntry(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, TWO_ONE_NAME))
- .withChild(ImmutableNodes.mapEntry(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, TWO_TWO_NAME))
+ private static final MapEntryNode BAR_NODE = ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, TWO_ID))
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.INNER_LIST_QNAME))
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, TWO_ONE_NAME))
+ .withChild(ImmutableNodes.leafNode(TestModel.NAME_QNAME, TWO_ONE_NAME))
+ .build())
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, TWO_TWO_NAME))
+ .withChild(ImmutableNodes.leafNode(TestModel.NAME_QNAME, TWO_TWO_NAME))
+ .build())
.build())
.build();
final var inMemoryDataTreeSnapshot = new InMemoryDataTreeSnapshot(SCHEMA_CONTEXT,
TreeNode.of(createDocumentOne(), Version.initial()), rootOper);
final var rootNode = inMemoryDataTreeSnapshot.getRootNode();
- TreeNode foundNode = null;
- try {
- foundNode = StoreTreeNodes.findNodeChecked(rootNode, OUTER_LIST_1_PATH);
- } catch (final IllegalArgumentException e) {
- fail("Illegal argument exception was thrown and should not have been" + e.getMessage());
- }
+ TreeNode foundNode = StoreTreeNodes.findNodeChecked(rootNode, OUTER_LIST_1_PATH);
assertNotNull(foundNode);
}
final var outerList1InvalidPath = YangInstanceIdentifier.builder(TestModel.OUTER_LIST_PATH)
.nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 3) //
.build();
- try {
- StoreTreeNodes.findNodeChecked(rootNode, outerList1InvalidPath);
- fail("Illegal argument exception should have been thrown");
- } catch (final IllegalArgumentException e) {
- LOG.debug("Illegal argument exception was thrown as expected: '{}' - '{}'", e.getClass(), e.getMessage());
- }
+ assertThrows(IllegalArgumentException.class,
+ () -> StoreTreeNodes.findNodeChecked(rootNode, outerList1InvalidPath));
}
@Test
private static ContainerNode createTestContainer() {
return ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
- .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
- .withChild(ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID))
+ .withChild(ImmutableNodes.newSystemMapBuilder()
+ .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_LIST_QNAME))
+ .withChild(ImmutableNodes.newMapEntryBuilder()
+ .withNodeIdentifier(
+ NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID))
+ .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, ONE_ID))
+ .build())
.withChild(BAR_NODE)
.build())
.build();