Inline xml_sub_container.xml 12/109112/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 28 Nov 2023 21:30:46 +0000 (22:30 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 28 Nov 2023 21:30:46 +0000 (22:30 +0100)
This is a simple document, inline it directly in tests.

Change-Id: Ib0bbc244f9b599c1cdc5f4073fe0c361041cae16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/databind/XmlChildBodyTest.java
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/databind/XmlResourceBodyTest.java
restconf/restconf-nb/src/test/resources/instanceidentifier/xml/xml_sub_container.xml [deleted file]

index eed11fa9b399d11ef54e5f56a607c96bf1bbc5f8..9bad88ab6f68dedc9e022af64b8f749da75c9e7a 100644 (file)
@@ -64,8 +64,14 @@ class XmlChildBodyTest extends AbstractBodyTest {
 
     @Test
     void moduleSubContainerDataPostTest() {
-        final var body = new XmlChildBody(
-            XmlChildBodyTest.class.getResourceAsStream("/instanceidentifier/xml/xml_sub_container.xml"));
+        final var body = new XmlChildBody(stringInputStream("""
+            <cont1 xmlns="instance:identifier:module">
+              <lflst11 xmlns="augment:module:leaf:list">lflst11_1</lflst11>
+              <lflst11 xmlns="augment:module:leaf:list">lflst11_2</lflst11>
+              <lflst11 xmlns="augment:module:leaf:list">lflst11_3</lflst11>
+              <lf11 xmlns:a="instance:identifier:module" xmlns:b="augment:module:leaf:list" \
+            xmlns="augment:module:leaf:list">/a:cont/a:cont1/b:lflst11[.="lflst11_1"]</lf11>
+            </cont1>"""));
         final var payload = body.toPayload(CONT_PATH);
 
         final var lflst11 = QName.create("augment:module:leaf:list", "2014-01-27", "lflst11");
index db5d1a5011853a246a767ec1622992175d243977..adfa9fdfb538517e881b9c22854bc01a71faa90d 100644 (file)
@@ -174,6 +174,13 @@ class XmlResourceBodyTest extends AbstractResourceBodyTest {
                 .build())
             .withChild(ImmutableNodes.leafNode(LF11, YangInstanceIdentifier.of(CONT_NID, CONT1_NID,
                 new NodeIdentifier(LFLST11), new NodeWithValue<>(LFLST11, "lflst11_1"))))
-            .build(), parseResource(uriPath, "/instanceidentifier/xml/xml_sub_container.xml"));
+            .build(), parse(uriPath, """
+                <cont1 xmlns="instance:identifier:module">
+                  <lflst11 xmlns="augment:module:leaf:list">lflst11_1</lflst11>
+                  <lflst11 xmlns="augment:module:leaf:list">lflst11_2</lflst11>
+                  <lflst11 xmlns="augment:module:leaf:list">lflst11_3</lflst11>
+                  <lf11 xmlns:a="instance:identifier:module" xmlns:b="augment:module:leaf:list" \
+                xmlns="augment:module:leaf:list">/a:cont/a:cont1/b:lflst11[.="lflst11_1"]</lf11>
+                </cont1>"""));
     }
 }
diff --git a/restconf/restconf-nb/src/test/resources/instanceidentifier/xml/xml_sub_container.xml b/restconf/restconf-nb/src/test/resources/instanceidentifier/xml/xml_sub_container.xml
deleted file mode 100644 (file)
index f76e08d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<cont1 xmlns="instance:identifier:module">
-    <lflst11 xmlns="augment:module:leaf:list">lflst11_1</lflst11>
-    <lflst11 xmlns="augment:module:leaf:list">lflst11_2</lflst11>
-    <lflst11 xmlns="augment:module:leaf:list">lflst11_3</lflst11>
-    <lf11 xmlns:a="instance:identifier:module" xmlns:b="augment:module:leaf:list" xmlns="augment:module:leaf:list">/a:cont/a:cont1/b:lflst11[.="lflst11_1"]</lf11>
-</cont1>
\ No newline at end of file