Search in sources :

Example 1 with SendMapRequestInput

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

the class LispSouthboundRpcTest method sendMapRequestTest_inputNotNull.

/**
 * Tests {@link LispSouthboundRPC#sendMapRequest} method.
 */
@Test
public void sendMapRequestTest_inputNotNull() throws ExecutionException, InterruptedException {
    final MapRequest mapRequest = new MapRequestBuilder().build();
    final TransportAddress transportAddress = new TransportAddressBuilder().build();
    final SendMapRequestInput sendMapRequestInputMock = Mockito.mock(SendMapRequestInput.class);
    Mockito.when(sendMapRequestInputMock.getTransportAddress()).thenReturn(transportAddress);
    Mockito.when(sendMapRequestInputMock.getMapRequest()).thenReturn(mapRequest);
    assertEquals(RPC_RESULT_SUCCESS.isSuccessful(), lispSouthboundRPC.sendMapRequest(sendMapRequestInputMock).get().isSuccessful());
    Mockito.verify(lispSouthboundPlugin).handleSerializedLispBuffer(transportAddress, MapRequestSerializer.getInstance().serialize(mapRequest), MessageType.MapRequest);
}
Also used : MapRequest(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequestmessage.MapRequest) TransportAddress(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddress) MapRequestBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequestmessage.MapRequestBuilder) TransportAddressBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder) SendMapRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapRequestInput) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 MapRequest (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequestmessage.MapRequest)1 MapRequestBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequestmessage.MapRequestBuilder)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 SendMapRequestInput (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapRequestInput)1