use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapReplyInputBuilder in project lispflowmapping by opendaylight.
the class LispMappingServiceTest method onRequestMappingTest.
/**
* Tests {@link LispMappingService#onRequestMapping} method.
*/
@Test
public void onRequestMappingTest() {
final RequestMapping requestMapping = Mockito.mock(RequestMapping.class);
final org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequestnotification.MapRequest mapRequest = Mockito.mock(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequestnotification.MapRequest.class);
final MapReply mapReply = new MapReplyBuilder().build();
Mockito.when(requestMapping.getMapRequest()).thenReturn(mapRequest);
Mockito.when(requestMapping.getTransportAddress()).thenReturn(TRANSPORT_ADDRESS_1);
Mockito.when(mapRequest.getEidItem()).thenReturn(Lists.newArrayList(EID_ITEM_BUILDER.build()));
Mockito.when(tlsMapReplyMock.get()).thenReturn(mapReply);
// result
final SendMapReplyInputBuilder smrib = new SendMapReplyInputBuilder().setMapReply(new MapReplyBuilder(mapReply).build()).setTransportAddress(TRANSPORT_ADDRESS_1);
lispMappingService.onRequestMapping(requestMapping);
Mockito.verify(odlLispSbService).sendMapReply(smrib.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapReplyInputBuilder in project lispflowmapping by opendaylight.
the class LispMappingService method onRequestMapping.
@Override
public void onRequestMapping(RequestMapping mapRequestNotification) {
MapReply mapReply = handleMapRequest(mapRequestNotification.getMapRequest());
if (mapReply != null) {
SendMapReplyInputBuilder smrib = new SendMapReplyInputBuilder();
smrib.setMapReply((new MapReplyBuilder(mapReply).build()));
smrib.setTransportAddress(mapRequestNotification.getTransportAddress());
getLispSB().sendMapReply(smrib.build());
} else {
LOG.debug("handleMapRequest: Got null MapReply");
}
}
Aggregations