Revert "Remove SchemaNode#getPath from XML writer test in rfc8040" 90/100190/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 21 Mar 2022 07:51:14 +0000 (08:51 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 21 Mar 2022 10:06:03 +0000 (11:06 +0100)
This reverts commit ed024cc0db69c3f026f5e109af680e162a484572. The
proposed transformation is not valid.

Change-Id: Ia56b7cd18d940d418b2f52f280b4545811dde8cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3d20b6b9e8a69584859acae0c6ef92e888596e99)

restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/XmlNormalizedNodeBodyWriterTest.java

index af665e85b5e6a2b6dea807be5b0da020318fce96..7d0b37d4d27bc00405d34c08bae58164f994028e 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.restconf.nb.rfc8040.jersey.providers;
 
 import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 
 import java.io.ByteArrayOutputStream;
@@ -24,6 +25,7 @@ import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
 public class XmlNormalizedNodeBodyWriterTest {
     @Test
@@ -31,6 +33,7 @@ public class XmlNormalizedNodeBodyWriterTest {
         final EffectiveModelContext schemaContext = mock(EffectiveModelContext.class);
 
         final SchemaNode schemaNode = mock(SchemaNode.class);
+        doReturn(SchemaPath.ROOT).when(schemaNode).getPath();
 
         final NormalizedNodePayload nodePayload = NormalizedNodePayload.of(
             new InstanceIdentifierContext<>(YangInstanceIdentifier.empty(), schemaNode, null, schemaContext),
@@ -50,6 +53,7 @@ public class XmlNormalizedNodeBodyWriterTest {
                 TestRestconfUtils.loadSchemaContext("/instanceidentifier/yang", null);
 
         final SchemaNode schemaNode = mock(SchemaNode.class);
+        doReturn(SchemaPath.ROOT).when(schemaNode).getPath();
 
         final NormalizedNodePayload nodePayload = NormalizedNodePayload.of(
             new InstanceIdentifierContext<>(YangInstanceIdentifier.empty(), schemaNode, null, schemaContext),