Do not reference immutable node builders
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / modification / WriteModificationTest.java
index 416b9ae0ef95cc9063149ad6e8de23e1e1226e84..20409999d804d7a60bc193e346e117791263a21b 100644 (file)
@@ -14,10 +14,9 @@ import org.apache.commons.lang.SerializationUtils;
 import org.junit.Test;
 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
 
 public class WriteModificationTest extends AbstractModificationTest {
     @Test
@@ -34,12 +33,10 @@ public class WriteModificationTest extends AbstractModificationTest {
 
     @Test
     public void testSerialization() {
-        YangInstanceIdentifier path = TestModel.TEST_PATH;
-        NormalizedNode data = ImmutableContainerNodeBuilder.create()
-                .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME))
-                .withChild(ImmutableNodes.leafNode(TestModel.DESC_QNAME, "foo")).build();
-
-        WriteModification expected = new WriteModification(path, data);
+        WriteModification expected = new WriteModification(TestModel.TEST_PATH, Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+            .withChild(ImmutableNodes.leafNode(TestModel.DESC_QNAME, "foo"))
+            .build());
 
         WriteModification clone = (WriteModification) SerializationUtils.clone(expected);
         assertEquals("getPath", expected.getPath(), clone.getPath());