Bug 527: fixed augment deserialization from xml.
[yangtools.git] / restconf / restconf-util / src / test / java / org / opendaylight / yangtools / restconf / utils / RestconfUtilsTest.java
index 67bbf150300e9a393a473c35358cb7e861893317..3fc33384e7d5f0217afe06edc69a8b2995634d49 100644 (file)
@@ -11,6 +11,8 @@ import static junit.framework.Assert.assertNotNull;
 import static org.junit.Assert.assertEquals;
 
 import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
 
 import javassist.ClassPool;
 
@@ -26,9 +28,12 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp
 import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
 import org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 
+import com.google.common.collect.Lists;
+
 public class RestconfUtilsTest {
 
     private RuntimeGeneratedMappingServiceImpl mappingService;
@@ -47,7 +52,7 @@ public class RestconfUtilsTest {
     @Test
     public void testToDataObjectMappingWithNestedAugmentations() {
         final InstanceIdentifier<Topology> topologyIdentifier = InstanceIdentifier.builder(NetworkTopology.class)
-                .child(Topology.class, new TopologyKey(new TopologyId("topology"))).toInstance();
+                .child(Topology.class).build();
         final InputStream is = this.getClass().getClassLoader().getResourceAsStream("topology.xml");
         final DataSchemaNode dataSchema = RestconfUtils.toRestconfIdentifier(topologyIdentifier, this.mappingService,
                 this.mappingService.getSchemaContext()).getValue();