Use Topology Node in place of Inventory Node
[ovsdb.git] / openstack / net-virt-providers / src / test / java / org / opendaylight / ovsdb / openstack / netvirt / providers / openflow13 / services / RoutingServiceTest.java
index be8c076777297335be9e38b44cbc1b4dce1951ba..b09340405b06c85b7340fc85034ac50b3b35a5bf 100644 (file)
@@ -74,41 +74,53 @@ public class RoutingServiceTest {
     }
 
     /**
-     * Test method {@link RoutingService#programRouterInterface(Node, Long, String, String, String, InetAddress, int, Action)}
+     * Test method {@link RoutingService#programRouterInterface(Long, String, String, String, InetAddress, int, Action)}
      */
     @Test
     public void testProgramRouterInterface() throws Exception {
         InetAddress address = mock(InetAddress.class);
         when(address.getHostAddress()).thenReturn(HOST_ADDRESS);
 
-        assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), routingService.programRouterInterface(mock(Node.class), Long.valueOf(123), SEGMENTATION_ID, SEGMENTATION_ID, MAC_ADDRESS, address, 1, Action.ADD));
+        assertEquals("Error, did not return the expected StatusCode",
+                new Status(StatusCode.SUCCESS),
+                routingService.programRouterInterface(Long.valueOf(123),
+                        SEGMENTATION_ID, SEGMENTATION_ID, MAC_ADDRESS, address, 1, Action.ADD));
         verify(readWriteTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
         verify(readWriteTransaction, times(1)).submit();
         verify(commitFuture, times(1)).get();
 
-        assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), routingService.programRouterInterface(mock(Node.class), Long.valueOf(123), SEGMENTATION_ID, SEGMENTATION_ID, MAC_ADDRESS, address, 1, Action.DELETE));
+        assertEquals("Error, did not return the expected StatusCode",
+                new Status(StatusCode.SUCCESS),
+                routingService.programRouterInterface(Long.valueOf(123),
+                        SEGMENTATION_ID, SEGMENTATION_ID, MAC_ADDRESS, address, 1, Action.DELETE));
         verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(readWriteTransaction, times(1)).submit();
         verify(commitFuture, times(2)).get(); // 1 + 1 above
     }
 
     /**
-     * Test method {@link RoutingService#programDefaultRouteEntry(Node, Long, String, String, InetAddress, Action)}
+     * Test method {@link RoutingService#programDefaultRouteEntry(Long, String, String, InetAddress, Action)}
      */
     @Test
     public void testProgramDefaultRouteEntry() throws Exception {
         InetAddress address = mock(InetAddress.class);
         when(address.getHostAddress()).thenReturn(HOST_ADDRESS);
 
-        assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), routingService.programDefaultRouteEntry(mock(Node.class), Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, address, Action.ADD));
-        verify(readWriteTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
+        assertEquals("Error, did not return the expected StatusCode",
+                new Status(StatusCode.SUCCESS),
+                routingService.programDefaultRouteEntry(Long.valueOf(123),
+                        SEGMENTATION_ID, MAC_ADDRESS, address, Action.ADD));
+        verify(readWriteTransaction, times(2)).put(any(LogicalDatastoreType.class),
+                any(InstanceIdentifier.class), any(Node.class), anyBoolean());
         verify(readWriteTransaction, times(1)).submit();
         verify(commitFuture, times(1)).get();
 
-        assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), routingService.programDefaultRouteEntry(mock(Node.class), Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, address, Action.DELETE));
+        assertEquals("Error, did not return the expected StatusCode",
+                new Status(StatusCode.SUCCESS),
+                routingService.programDefaultRouteEntry(Long.valueOf(123),
+                        SEGMENTATION_ID, MAC_ADDRESS, address, Action.DELETE));
         verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(readWriteTransaction, times(1)).submit();
         verify(commitFuture, times(2)).get(); // 1 + 1 above
     }
-
 }