This is a simplistic XML fragment, inline it.
Change-Id: I817fb9f29757d5e3a23a068699667138dcedbfc2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
@Test
void postXmlTest() {
- final var body = new XmlChildBody(XmlChildBodyTest.class.getResourceAsStream("/foo-xml-test/foo.xml"));
+ final var body = new XmlChildBody(stringInputStream("""
+ <top-level-list xmlns="foo">
+ <key-leaf>key-value</key-leaf>
+ <ordinary-leaf>leaf-value</ordinary-leaf>
+ </top-level-list>"""));
final var payload = body.toPayload(EMPTY_PATH);
final var entryId = NodeIdentifierWithPredicates.of(TOP_LEVEL_LIST,
.withNodeIdentifier(NodeIdentifierWithPredicates.of(TOP_LEVEL_LIST, keyName, "key-value"))
.withChild(ImmutableNodes.leafNode(keyName, "key-value"))
.withChild(ImmutableNodes.leafNode(QName.create(keyName, "ordinary-leaf"), "leaf-value"))
- .build(), parseResource("foo:top-level-list=key-value", "/foo-xml-test/foo.xml"));
+ .build(), parse("foo:top-level-list=key-value", """
+ <top-level-list xmlns="foo">
+ <key-leaf>key-value</key-leaf>
+ <ordinary-leaf>leaf-value</ordinary-leaf>
+ </top-level-list>"""));
}
@Test
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<top-level-list xmlns="foo">\r
- <key-leaf>key-value</key-leaf>\r
- <ordinary-leaf>leaf-value</ordinary-leaf>\r
-</top-level-list>
\ No newline at end of file