}
/**
- * 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
}
-
}