import org.opendaylight.controller.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.controller.sal.restconf.impl.test.TestUtils;
import org.opendaylight.controller.sal.restconf.impl.test.YangAndXmlAndDataSchemaLoader;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
+import org.opendaylight.yangtools.yang.data.api.Node;
public class CnSnToJsonBasicDataTypesTest extends YangAndXmlAndDataSchemaLoader {
@Test
public void simpleYangDataTest() throws Exception {
- CompositeNode compositeNode = TestUtils.readInputToCnSn("/cnsn-to-json/simple-data-types/xml/data.xml",
+ Node<?> node = TestUtils.readInputToCnSn("/cnsn-to-json/simple-data-types/xml/data.xml",
XmlToCompositeNodeProvider.INSTANCE);
- TestUtils.normalizeCompositeNode(compositeNode, modules, "simple-data-types:cont");
+ TestUtils.normalizeCompositeNode(node, modules, "simple-data-types:cont");
- String jsonOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(compositeNode, modules, dataSchemaNode,
+ String jsonOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(node, modules, dataSchemaNode,
StructuredDataToJsonProvider.INSTANCE);
assertNotNull(jsonOutput);
public void testBadData() throws Exception {
try {
- CompositeNode compositeNode = TestUtils.readInputToCnSn("/cnsn-to-json/simple-data-types/xml/bad-data.xml",
+ Node<?> node = TestUtils.readInputToCnSn("/cnsn-to-json/simple-data-types/xml/bad-data.xml",
XmlToCompositeNodeProvider.INSTANCE);
- TestUtils.normalizeCompositeNode(compositeNode, modules, "simple-data-types:cont");
+ TestUtils.normalizeCompositeNode(node, modules, "simple-data-types:cont");
fail("Expected RestconfDocumentedException");
} catch (RestconfDocumentedException e) {
assertEquals("getErrorTag", ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());