use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapNotifyInputBuilder in project lispflowmapping by opendaylight.
the class LispMappingServiceTest method onAddMappingTest_noTransportAddress.
/**
* Tests {@link LispMappingService#onAddMapping} method with no TransportAddress.
*/
@Test
public void onAddMappingTest_noTransportAddress() {
final org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapregisternotification.MapRegister mapRegister = Mockito.mock(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapregisternotification.MapRegister.class);
final AddMapping addMapping = Mockito.mock(AddMapping.class);
final MapNotify mapNotify = new MapNotifyBuilder().setKeyId((short) 1).build();
Mockito.when(addMapping.getMapRegister()).thenReturn(mapRegister);
Mockito.when(mapRegister.getMappingRecordItem()).thenReturn(Lists.newArrayList(MAPPING_RECORD_ITEM_BUILDER.build()));
Mockito.when(tlsMapNotifyMock.get()).thenReturn(new MutablePair<>(mapNotify, null));
Mockito.when(addMapping.getTransportAddress()).thenReturn(TRANSPORT_ADDRESS_1);
// result
final SendMapNotifyInputBuilder smnib = new SendMapNotifyInputBuilder().setMapNotify(new org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapnotifymessage.MapNotifyBuilder().setKeyId((short) 1).build()).setTransportAddress(TRANSPORT_ADDRESS);
lispMappingService.onAddMapping(addMapping);
Mockito.verify(odlLispSbService).sendMapNotify(smnib.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapNotifyInputBuilder in project lispflowmapping by opendaylight.
the class LispMappingService method sendMapNotify.
private void sendMapNotify(MapNotify mapNotify, TransportAddress address) {
SendMapNotifyInputBuilder smnib = new SendMapNotifyInputBuilder();
smnib.setMapNotify(new MapNotifyBuilder(mapNotify).build());
smnib.setTransportAddress(address);
getLispSB().sendMapNotify(smnib.build());
}
Aggregations