Search in sources :

Example 1 with SendMapReplyInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapReplyInput in project lispflowmapping by opendaylight.

the class LispSouthboundRpcTest method sendMapReplyTest_inputNotNull.

/**
 * Tests {@link LispSouthboundRPC#sendMapReply} method.
 */
@Test
public void sendMapReplyTest_inputNotNull() throws ExecutionException, InterruptedException {
    final MapReply mapReply = getDefaultMapReplyBuilder().build();
    final TransportAddress transportAddress = new TransportAddressBuilder().build();
    final SendMapReplyInput sendMapReplyInputMock = Mockito.mock(SendMapReplyInput.class);
    Mockito.when(sendMapReplyInputMock.getTransportAddress()).thenReturn(transportAddress);
    Mockito.when(sendMapReplyInputMock.getMapReply()).thenReturn(mapReply);
    assertEquals(RPC_RESULT_SUCCESS.isSuccessful(), lispSouthboundRPC.sendMapReply(sendMapReplyInputMock).get().isSuccessful());
    Mockito.verify(lispSouthboundPlugin).handleSerializedLispBuffer(transportAddress, MapReplySerializer.getInstance().serialize(mapReply), MessageType.MapReply);
}
Also used : MapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapreplymessage.MapReply) TransportAddress(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddress) SendMapReplyInput(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapReplyInput) TransportAddressBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 MapReply (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapreplymessage.MapReply)1 TransportAddress (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddress)1 TransportAddressBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder)1 SendMapReplyInput (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapReplyInput)1