Inject RPC input QName into LazySerializedContainerNode
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / test / java / org / opendaylight / mdsal / binding / dom / adapter / LazySerializedContainerNodeTest.java
index 2bdbaf8855bb9c5cd4344cbf55551ffe7849ee2c..0605d527d562204fff1dffaf338e0447d3c16868 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.mdsal.binding.dom.adapter;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
@@ -47,20 +48,21 @@ public class LazySerializedContainerNodeTest {
 
         final ImmutableBiMap<?, ?> biMap = bindingTestContext.getCodec().currentSerializer()
                 .getRpcMethodToSchema(OpendaylightTestRpcServiceService.class);
-        final QName rpcName = ((RpcDefinition) biMap.values().iterator().next()).getQName();
+        final NodeIdentifier name = new NodeIdentifier(((RpcDefinition) biMap.values().iterator().next()).getInput()
+            .getQName());
         final LeafNode<?> leafNode = ImmutableLeafNodeBuilder.create().withNodeIdentifier(NodeIdentifier
                 .create(QName.create("", "test"))).withValue("").build();
-        final ContainerNode normalizedNode = LazySerializedContainerNode.create(rpcName, dataObject, codec);
+        final ContainerNode normalizedNode = LazySerializedContainerNode.create(name, dataObject, codec);
         assertNotNull(normalizedNode);
         final LazySerializedContainerNode lazySerializedContainerNode =
-                (LazySerializedContainerNode) LazySerializedContainerNode.withContextRef(rpcName, dataObject, leafNode,
+                (LazySerializedContainerNode) LazySerializedContainerNode.withContextRef(name, dataObject, leafNode,
                         codec);
         assertNotNull(lazySerializedContainerNode);
         assertEquals(leafNode, lazySerializedContainerNode.childByArg(leafNode.getIdentifier()));
         assertNull(lazySerializedContainerNode.childByArg(mock(PathArgument.class)));
 
         assertTrue(lazySerializedContainerNode.body().isEmpty());
-        assertEquals(rpcName, lazySerializedContainerNode.getIdentifier().getNodeType());
+        assertSame(name, lazySerializedContainerNode.getIdentifier());
         assertEquals(dataObject, lazySerializedContainerNode.getDataObject());
     }
 }
\ No newline at end of file