import org.opendaylight.lispflowmapping.southbound.lisp.LispSouthboundHandler;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.inet.binary.types.rev160303.IpAddressBinary;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.inet.binary.types.rev160303.Ipv4AddressBinary;
lispSouthboundPlugin = new LispSouthboundPlugin(
Mockito.mock(DataBroker.class),
Mockito.mock(NotificationPublishService.class),
- Mockito.mock(ClusterSingletonServiceProvider.class));
- lispSouthboundPlugin.setBindingAddress(ADDRESS_1);
- lispSouthboundPlugin.setMapRegisterCacheEnabled(false);
+ Mockito.mock(ClusterSingletonServiceProvider.class),
+ ADDRESS_1, false, 0);
channel = Mockito.mock(NioDatagramChannel.class);
xtrChannel = Mockito.mock(NioDatagramChannel.class);
injectField("bootstrap", BOOTSTRAP_MOCK);
lispSouthboundPlugin.setLispAddress(ADDRESS_1);
- Mockito.verifyZeroInteractions(BOOTSTRAP_MOCK);
- Mockito.verifyZeroInteractions(channel);
+ Mockito.verifyNoInteractions(BOOTSTRAP_MOCK);
+ Mockito.verifyNoInteractions(channel);
}
/**
public void shouldListenOnXtrPortTest_false() throws NoSuchFieldException, IllegalAccessException {
lispSouthboundPlugin.shouldListenOnXtrPort(false);
- Mockito.verifyZeroInteractions(xtrChannel);
+ Mockito.verifyNoInteractions(xtrChannel);
}
/**
Mockito.verify(elgMock).shutdownGracefully();
Mockito.verify(handlerMock).close();
assertNull(getField("lispSouthboundHandler"));
- assertNull(getField("lispXtrSouthboundHandler"));
Channel[] channels = getField("channel");
assertNull(channels[0]);
}
xtrChannelField.set(lispSouthboundPlugin, xtrChannel);
}
- private static ByteBuffer parseHexString(String packet) {
+ private static ByteBuffer parseHexString(final String packet) {
final String[] tokens = packet.split("\\s+");
final ByteBuffer buffer = ByteBuffer.allocate(tokens.length);
for (String token : tokens) {
return buffer;
}
- private static <T> void injectField(String fieldName, T obj) throws NoSuchFieldException, IllegalAccessException {
+ private static <T> void injectField(final String fieldName, final T obj)
+ throws NoSuchFieldException, IllegalAccessException {
Field field = LispSouthboundPlugin.class.getDeclaredField(fieldName);
field.setAccessible(true);
field.set(lispSouthboundPlugin, obj);
}
@SuppressWarnings("unchecked")
- private static <T> T getField(String fieldName) throws NoSuchFieldException, IllegalAccessException {
+ private static <T> T getField(final String fieldName) throws NoSuchFieldException, IllegalAccessException {
Field field = LispSouthboundPlugin.class.getDeclaredField(fieldName);
field.setAccessible(true);