BUG-5903: do not rely on primary info on failure
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / utils / NormalizedNodeAggregatorTest.java
index e1764954bcc70740e34bc930ce3859318525d245..453262a8bd6442e42a0f4f9ce2b303e77c905b02 100644 (file)
@@ -11,7 +11,7 @@ package org.opendaylight.controller.cluster.datastore.utils;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import com.google.common.base.Optional;
-import com.google.common.collect.Lists;
+import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.CheckedFuture;
 import java.util.Collection;
 import java.util.concurrent.ExecutionException;
@@ -41,8 +41,8 @@ public class NormalizedNodeAggregatorTest {
         NormalizedNode<?, ?> expectedNode1 = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
         NormalizedNode<?, ?> expectedNode2 = ImmutableNodes.containerNode(CarsModel.CARS_QNAME);
 
-        Optional<NormalizedNode<?, ?>> optional = NormalizedNodeAggregator.aggregate(YangInstanceIdentifier.builder().build(),
-                Lists.newArrayList(
+        Optional<NormalizedNode<?, ?>> optional = NormalizedNodeAggregator.aggregate(YangInstanceIdentifier.EMPTY,
+                ImmutableList.of(
                         Optional.<NormalizedNode<?, ?>>of(getRootNode(expectedNode1, schemaContext)),
                         Optional.<NormalizedNode<?, ?>>of(getRootNode(expectedNode2, schemaContext))),
                 schemaContext);
@@ -77,7 +77,7 @@ public class NormalizedNodeAggregatorTest {
 
             DOMStoreWriteTransaction writeTransaction = store.newWriteOnlyTransaction();
 
-            writeTransaction.merge(YangInstanceIdentifier.builder().node(moduleNode.getNodeType()).build(), moduleNode);
+            writeTransaction.merge(YangInstanceIdentifier.of(moduleNode.getNodeType()), moduleNode);
 
             DOMStoreThreePhaseCommitCohort ready = writeTransaction.ready();
 
@@ -88,7 +88,7 @@ public class NormalizedNodeAggregatorTest {
             DOMStoreReadTransaction readTransaction = store.newReadOnlyTransaction();
 
             CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read = readTransaction
-                    .read(YangInstanceIdentifier.builder().build());
+                    .read(YangInstanceIdentifier.EMPTY);
 
             Optional<NormalizedNode<?, ?>> nodeOptional = read.checkedGet();