use of org.opendaylight.yang.gen.v1.rpc.norev.SwitchOutputBuilder in project mdsal by opendaylight.
the class Mdsal500Test method testDOMRegistrationWithBindingInvocation.
@Test
public void testDOMRegistrationWithBindingInvocation() throws InterruptedException, ExecutionException, TimeoutException {
SwitchOutput baSwitchOutput = new SwitchOutputBuilder().build();
biRpcProviderService.registerRpcImplementation((rpc, input) -> FluentFutures.immediateFluentFuture(new DefaultDOMRpcResult(testContext.getCodec().currentSerializer().toNormalizedNodeRpcData(baSwitchOutput))), DOMRpcIdentifier.create(SWITCH_QNAME));
final Mdsal500Service baSwitchService = baRpcConsumerService.getRpcService(Mdsal500Service.class);
Future<RpcResult<SwitchOutput>> baResult = baSwitchService.switch$(switchBuilder(FOO).build());
assertNotNull(baResult);
assertEquals(baSwitchOutput, baResult.get(5, TimeUnit.SECONDS).getResult());
}
Aggregations