Fix YANG patch request for augmented element
[netconf.git] / restconf / restconf-nb-rfc8040 / src / test / java / org / opendaylight / restconf / nb / rfc8040 / jersey / providers / test / AbstractBodyReaderTest.java
index a721718d76658cb5a87c6cea45c014b93780a9b5..f0c3889d714bf688872809aef0189f4462a89c6e 100644 (file)
@@ -28,7 +28,6 @@ import org.opendaylight.mdsal.dom.api.DOMMountPoint;
 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.mdsal.dom.spi.FixedDOMSchemaService;
-import org.opendaylight.restconf.common.context.NormalizedNodeContext;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.common.errors.RestconfError;
 import org.opendaylight.restconf.common.patch.PatchContext;
@@ -36,12 +35,17 @@ import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
 import org.opendaylight.restconf.nb.rfc8040.TestUtils;
 import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.spi.AbstractIdentifierAwareJaxRsProvider;
+import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
 import org.opendaylight.yangtools.yang.common.ErrorTag;
 import org.opendaylight.yangtools.yang.common.ErrorType;
+import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 
 public abstract class AbstractBodyReaderTest {
+    protected static final QName CONT_AUG_QNAME = QName.create("test-ns-aug", "container-aug").intern();
+    protected static final QName LEAF_AUG_QNAME = QName.create("test-ns-aug", "leaf-aug").intern();
+
     protected final MediaType mediaType;
     protected final SchemaContextHandler schemaContextHandler;
     protected final DOMMountPointService mountPointService;
@@ -53,7 +57,7 @@ public abstract class AbstractBodyReaderTest {
         schemaContextHandler = TestUtils.newSchemaContextHandler(schemaContext);
 
         mountPointService = mock(DOMMountPointService.class);
-        final DOMMountPoint mountPoint = mock(DOMMountPoint.class);
+        final var mountPoint = mock(DOMMountPoint.class);
         doReturn(Optional.of(mountPoint)).when(mountPointService).getMountPoint(any(YangInstanceIdentifier.class));
         doReturn(Optional.of(FixedDOMSchemaService.of(schemaContext))).when(mountPoint)
             .getService(DOMSchemaService.class);
@@ -90,14 +94,12 @@ public abstract class AbstractBodyReaderTest {
         normalizedNodeProvider.setRequest(request);
     }
 
-    protected static void checkMountPointNormalizedNodeContext(
-            final NormalizedNodeContext nnContext) {
-        checkNormalizedNodeContext(nnContext);
+    protected static void checkMountPointNormalizedNodePayload(final NormalizedNodePayload nnContext) {
+        checkNormalizedNodePayload(nnContext);
         assertNotNull(nnContext.getInstanceIdentifierContext().getMountPoint());
     }
 
-    protected static void checkNormalizedNodeContext(
-            final NormalizedNodeContext nnContext) {
+    protected static void checkNormalizedNodePayload(final NormalizedNodePayload nnContext) {
         assertNotNull(nnContext.getData());
         assertNotNull(nnContext.getInstanceIdentifierContext()
                 .getInstanceIdentifier());