+
+ /**
+ * Test reading simple leaf value.
+ */
+ @Test
+ public void modulePatchSimpleLeafValueTest() throws Exception {
+ mockBodyReader("instance-identifier-patch-module:patch-cont/my-list1=leaf1", xmlToPatchBodyReader, false);
+ final var inputStream = new ByteArrayInputStream("""
+ <yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
+ <patch-id>test-patch</patch-id>
+ <comment>this is test patch</comment>
+ <edit>
+ <edit-id>edit1</edit-id>
+ <operation>replace</operation>
+ <target>/my-list2=my-leaf20/name</target>
+ <value>
+ <name xmlns="instance:identifier:patch:module">my-leaf20</name>
+ </value>
+ </edit>
+ </yang-patch>
+ """.getBytes(StandardCharsets.UTF_8));
+ final var returnValue = xmlToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
+ checkPatchContext(returnValue);
+ final var data = returnValue.getData().get(0).getNode();
+ assertEquals(LEAF_NAME_QNAME, data.getIdentifier().getNodeType());
+ assertEquals(ImmutableNodes.leafNode(LEAF_NAME_QNAME, "my-leaf20"), data);
+ }