- try {
- final DataTreeModification modificationTree2 = inMemoryDataTree.takeSnapshot().newModification();
- modificationTree2.write(TestModel.TEST_PATH.node(choice1Id), choice);
- modificationTree2.ready();
- inMemoryDataTree.validate(modificationTree2);
- final DataTreeCandidate prepare2 = inMemoryDataTree.prepare(modificationTree2);
- inMemoryDataTree.commit(prepare2);
- } catch (final IllegalArgumentException e) {
- assertEquals("Node (urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?"
+ // Choice write
+ final var choice1Id = new NodeIdentifier(QName.create(TestModel.TEST_QNAME, "choice1"));
+ final var choice = Builders.choiceBuilder()
+ .withNodeIdentifier(choice1Id)
+ .withChild(Builders.containerBuilder()
+ .withNodeIdentifier(new NodeIdentifier(QName.create(TestModel.TEST_QNAME, "case2-cont")))
+ .withChild(leafNode(QName.create(TestModel.TEST_QNAME, "case2-leaf2"), "leaf-value2"))
+ .build())
+ .build();
+
+ try {
+ final var modificationTree2 = inMemoryDataTree.takeSnapshot().newModification();
+ modificationTree2.write(TestModel.TEST_PATH.node(choice1Id), choice);
+ modificationTree2.ready();
+ inMemoryDataTree.validate(modificationTree2);
+ final var prepare2 = inMemoryDataTree.prepare(modificationTree2);
+ inMemoryDataTree.commit(prepare2);
+ } catch (final IllegalArgumentException e) {
+ assertEquals("Node (urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?"