Update MRI projects for Aluminium
[openflowplugin.git] / applications / topology-manager / src / test / java / org / opendaylight / openflowplugin / applications / topology / manager / NodeChangeListenerImplTest.java
index 526012ddde339fae406bb6163a383113845b5304..bc7f67b8a0952f2e7c48a8ce6f7514f345d83440 100644 (file)
@@ -27,6 +27,7 @@ import static org.opendaylight.openflowplugin.applications.topology.manager.Test
 import static org.opendaylight.openflowplugin.applications.topology.manager.TestUtils.waitForDeletes;
 import static org.opendaylight.openflowplugin.applications.topology.manager.TestUtils.waitForSubmit;
 
+import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.Arrays;
 import java.util.Collections;
@@ -68,7 +69,7 @@ public class NodeChangeListenerImplTest extends DataTreeChangeListenerBase {
         List<Link> linkList = Arrays.asList(
                 newLink("link1", newSourceNode("node1"), newDestNode("dest")),
                 newLink("link2", newSourceNode("source"), newDestNode("node1")),
-                newLink("link2", newSourceNode("source2"), newDestNode("dest2")));
+                newLink("link3", newSourceNode("source2"), newDestNode("dest2")));
         final Topology topology = new TopologyBuilder().setLink(linkList).build();
 
         final InstanceIdentifier[] expDeletedIIDs = {
@@ -80,11 +81,11 @@ public class NodeChangeListenerImplTest extends DataTreeChangeListenerBase {
         SettableFuture<Optional<Topology>> readFuture = SettableFuture.create();
         readFuture.set(Optional.of(topology));
         ReadWriteTransaction mockTx1 = mock(ReadWriteTransaction.class);
-        doReturn(readFuture).when(mockTx1).read(LogicalDatastoreType.OPERATIONAL, topologyIID);
+        doReturn(FluentFuture.from(readFuture)).when(mockTx1).read(LogicalDatastoreType.OPERATIONAL, topologyIID);
 
         SettableFuture<Optional<Node>> readFutureNode = SettableFuture.create();
         readFutureNode.set(Optional.of(topoNode));
-        doReturn(readFutureNode).when(mockTx1).read(LogicalDatastoreType.OPERATIONAL, topoNodeII);
+        doReturn(FluentFuture.from(readFutureNode)).when(mockTx1).read(LogicalDatastoreType.OPERATIONAL, topoNodeII);
 
         final CountDownLatch submitLatch1 = setupStubbedSubmit(mockTx1);
 
@@ -173,8 +174,8 @@ public class NodeChangeListenerImplTest extends DataTreeChangeListenerBase {
 
         ArgumentCaptor<Node> mergedNode = ArgumentCaptor.forClass(Node.class);
         NodeId expNodeId = new NodeId("node1");
-        verify(mockTx).merge(eq(LogicalDatastoreType.OPERATIONAL), eq(topologyIID.child(Node.class,
-                new NodeKey(expNodeId))), mergedNode.capture(), eq(true));
+        verify(mockTx).mergeParentStructureMerge(eq(LogicalDatastoreType.OPERATIONAL), eq(topologyIID.child(Node.class,
+                new NodeKey(expNodeId))), mergedNode.capture());
         assertEquals("getNodeId", expNodeId, mergedNode.getValue().getNodeId());
         InventoryNode augmentation = mergedNode.getValue().augmentation(InventoryNode.class);
         assertNotNull("Missing augmentation", augmentation);