@Test public void basicTest() { final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> rpcImplementations = new HashMap<>(); final List<DOMRpcImplementation> rpcImplementation = new ArrayList<>(); final RpcDefinition rpcDefinition = mock(RpcDefinition.class); final YangInstanceIdentifier yangInstanceIdentifier = YangInstanceIdentifier.builder().build(); doReturn(TestModel.TEST2_QNAME).when(rpcDefinition).getQName(); final GlobalDOMRpcRoutingTableEntry globalDOMRpcRoutingTableEntry = new GlobalDOMRpcRoutingTableEntry( rpcDefinition, new HashMap<>()); rpcImplementation.add(getTestRpcImplementation()); rpcImplementations.put(yangInstanceIdentifier, rpcImplementation); assertEquals(TestModel.TEST2_QNAME, globalDOMRpcRoutingTableEntry.getType()); assertTrue(globalDOMRpcRoutingTableEntry.getImplementations().isEmpty()); assertFalse(globalDOMRpcRoutingTableEntry.newInstance(rpcImplementations).getImplementations().isEmpty()); assertTrue(globalDOMRpcRoutingTableEntry.newInstance(rpcImplementations).getImplementations().containsValue( rpcImplementation)); final ListenableFuture<?> future = OperationInvocation.invoke( globalDOMRpcRoutingTableEntry.newInstance(rpcImplementations), TEST_CONTAINER); final ExecutionException ex = assertThrows(ExecutionException.class, () -> future.get(5, TimeUnit.SECONDS)); final Throwable cause = ex.getCause(); assertThat(cause, instanceOf(DOMRpcImplementationNotAvailableException.class)); assertThat(cause.getMessage(), containsString(EXCEPTION_TEXT)); }
@Override protected GlobalDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) { return new GlobalDOMRpcRoutingTableEntry(getRpcId(), impls); }
GlobalDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntry { @Override protected GlobalDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) { return new GlobalDOMRpcRoutingTableEntry(getRpcId(), impls); } }
GlobalDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntry { @Override protected GlobalDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) { return new GlobalDOMRpcRoutingTableEntry(getRpcId(), impls); } private  GlobalDOMRpcRoutingTableEntry(final DOMRpcIdentifier rpcId,
            final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls);   GlobalDOMRpcRoutingTableEntry(final RpcDefinition def, final Map<YangInstanceIdentifier,
            List<DOMRpcImplementation>> impls); }
GlobalDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntry { @Override protected GlobalDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) { return new GlobalDOMRpcRoutingTableEntry(getRpcId(), impls); } private  GlobalDOMRpcRoutingTableEntry(final DOMRpcIdentifier rpcId,
            final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls);   GlobalDOMRpcRoutingTableEntry(final RpcDefinition def, final Map<YangInstanceIdentifier,
            List<DOMRpcImplementation>> impls);  }
GlobalDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntry { @Override protected GlobalDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) { return new GlobalDOMRpcRoutingTableEntry(getRpcId(), impls); } private  GlobalDOMRpcRoutingTableEntry(final DOMRpcIdentifier rpcId,
            final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls);   GlobalDOMRpcRoutingTableEntry(final RpcDefinition def, final Map<YangInstanceIdentifier,
            List<DOMRpcImplementation>> impls);   }