Clean up moduleDataTest() 98/107498/2
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 25 Aug 2023 13:22:51 +0000 (15:22 +0200)
committerRobert Varga <nite@hq.sk>
Fri, 25 Aug 2023 14:47:54 +0000 (14:47 +0000)
Make sure this test is as close as possible to its non-mounpoint
counterpart.

Change-Id: Icfc9e9f0e9f7eb189cd37f3d98cf092976902f27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlPatchBodyReaderMountPointTest.java

index 7c01deb0d83a420a32ed1f45b82dcc294857c762..e49c6d77b6f56f1572a2e66a62b3cce56473d326 100644 (file)
@@ -14,7 +14,6 @@ import java.io.InputStream;
 import javax.ws.rs.core.MediaType;
 import org.junit.Test;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
-import org.opendaylight.restconf.common.patch.PatchContext;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.AbstractBodyReaderTest;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.XmlBodyReaderTest;
 import org.opendaylight.yangtools.yang.common.ErrorTag;
@@ -35,13 +34,10 @@ public class XmlPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
 
     @Test
     public void moduleDataTest() throws Exception {
-        final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
-        mockBodyReader(uri, xmlToPatchBodyReader, false);
-
-        final InputStream inputStream = XmlBodyReaderTest.class.getResourceAsStream(
-            "/instanceidentifier/xml/xmlPATCHdata.xml");
-        final PatchContext returnValue = xmlToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
-        checkPatchContextMountPoint(returnValue);
+        mockBodyReader(MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1", xmlToPatchBodyReader,
+            false);
+        checkPatchContextMountPoint(xmlToPatchBodyReader.readFrom(null, null, null, mediaType, null,
+            XmlBodyReaderTest.class.getResourceAsStream("/instanceidentifier/xml/xmlPATCHdata.xml")));
     }
 
     /**