Bug 3640 - RPC call error - impossible to call rpc
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / rest / impl / test / providers / TestXmlBodyReaderMountPoint.java
index f1be296c4dc642542fa5bdd4c63c5c2d1db7bac4..888008ca604b02573d0d29b8a9cf9bf41f2741d6 100644 (file)
@@ -132,13 +132,16 @@ public class TestXmlBodyReaderMountPoint extends AbstractBodyReaderTest {
                 null, null, mediaType, null, inputStream);
         checkNormalizedNodeContext(returnValue);
         final ContainerNode contNode = (ContainerNode) returnValue.getData();
-        final YangInstanceIdentifier yangleaf = YangInstanceIdentifier.of(QName
-                .create(contNode.getNodeType(), "lf"));
-        final Optional<DataContainerChild<? extends PathArgument, ?>> leafDataNode = contNode
-                .getChild(yangleaf.getLastPathArgument());
+        final YangInstanceIdentifier yangCont = YangInstanceIdentifier.of(QName.create(contNode.getNodeType(), "cont"));
+        final Optional<DataContainerChild<? extends PathArgument, ?>> contDataNodePotential = contNode.getChild(yangCont
+                .getLastPathArgument());
+        assertTrue(contDataNodePotential.isPresent());
+        final ContainerNode contDataNode = (ContainerNode) contDataNodePotential.get();
+        final YangInstanceIdentifier yangLeaf = YangInstanceIdentifier.of(QName.create(contDataNode.getNodeType(), "lf"));
+        final Optional<DataContainerChild<? extends PathArgument, ?>> leafDataNode = contDataNode.getChild(yangLeaf
+                .getLastPathArgument());
         assertTrue(leafDataNode.isPresent());
-        assertTrue("lf-test".equalsIgnoreCase(leafDataNode.get().getValue()
-                .toString()));
+        assertTrue("lf-test".equalsIgnoreCase(leafDataNode.get().getValue().toString()));
     }
 
     private void checkExpectValueNormalizeNodeContext(