Search in sources :

Example 1 with SendMapNotifyInputBuilder

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());
}
Also used : SendMapNotifyInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapNotifyInputBuilder) GotMapNotify(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapNotify) MapNotify(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapNotify) AddMapping(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.AddMapping) MapNotifyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapnotifymessage.MapNotifyBuilder) Test(org.junit.Test)

Example 2 with SendMapNotifyInputBuilder

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());
}
Also used : SendMapNotifyInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapNotifyInputBuilder) MapNotifyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapnotifymessage.MapNotifyBuilder)

Aggregations

MapNotifyBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapnotifymessage.MapNotifyBuilder)2 SendMapNotifyInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapNotifyInputBuilder)2 Test (org.junit.Test)1 AddMapping (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.AddMapping)1 GotMapNotify (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapNotify)1 MapNotify (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapNotify)1