use of org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoInputBuilder in project openflowplugin by opendaylight.
the class SalEchoServiceImplTest method testSendEcho.
@Test
public void testSendEcho() throws Exception {
final EchoOutput echoOut = new EchoOutputBuilder().setData(DUMMY_DATA).build();
final RpcResult<EchoOutput> replyRpcResult = RpcResultBuilder.success(echoOut).build();
final ListenableFuture<RpcResult<EchoOutput>> replyFt = Futures.immediateFuture(replyRpcResult);
Mockito.when(mockedRequestContext.getFuture()).thenReturn(replyFt);
SendEchoInput sendEchoInput = new SendEchoInputBuilder().setData(DUMMY_DATA).build();
final Future<RpcResult<SendEchoOutput>> echoOutput = salEchoService.sendEcho(sendEchoInput);
Assert.assertNotNull(echoOutput);
Assert.assertTrue(echoOutput.isDone());
Assert.assertTrue(echoOutput.get().isSuccessful());
verify(mockedRequestContextStack).createRequestContext();
verify(mockedOutboundQueue).commitEntry(Matchers.eq(2121L), Matchers.<OfHeader>any(), Matchers.<FutureCallback<OfHeader>>any());
}
Aggregations