BUG 1082 Migrate sal-rest-connector to Async Data Broker API
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / xml / to / cnsn / test / XmlAugmentedElementToCnSnTest.java
index 5a5a621d930b68fc240140f76b086a0d57bc0a3c..e992e1214e9b44af05bf76bc0091afc623d11613 100644 (file)
@@ -8,12 +8,14 @@
 package org.opendaylight.controller.sal.restconf.impl.xml.to.cnsn.test;
 
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Set;
 import org.junit.Test;
 import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider;
 import org.opendaylight.controller.sal.restconf.impl.test.TestUtils;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
+import org.opendaylight.yangtools.yang.data.api.Node;
 import org.opendaylight.yangtools.yang.model.api.Module;
 
 public class XmlAugmentedElementToCnSnTest {
@@ -25,12 +27,15 @@ public class XmlAugmentedElementToCnSnTest {
     }
 
     private void loadAndNormalizeData(String xmlPath, String yangPath, String topLevelElementName, String moduleName) {
-        CompositeNode compNode = TestUtils.readInputToCnSn(xmlPath, false, XmlToCompositeNodeProvider.INSTANCE);
-        assertNotNull(compNode);
+        Node<?> node = TestUtils.readInputToCnSn(xmlPath, false,
+                XmlToCompositeNodeProvider.INSTANCE);
+        assertTrue(node instanceof CompositeNode);
+        CompositeNode cnSn = (CompositeNode)node;
+
         Set<Module> modules = TestUtils.loadModulesFrom(yangPath);
 
         assertNotNull(modules);
-        TestUtils.normalizeCompositeNode(compNode, modules, topLevelElementName + ":" + moduleName);
+        TestUtils.normalizeCompositeNode(cnSn, modules, topLevelElementName + ":" + moduleName);
     }
 
 }