RemoteRpcRegistryMXBeanImpl extends AbstractRegistryMXBean<RoutingTable, DOMRpcIdentifier> implements RemoteRpcRegistryMXBean { @Override public Set<String> getLocalRegisteredRoutedRpc() { RoutingTable table = localData(); Set<String> routedRpc = new HashSet<>(table.getItems().size()); for (DOMRpcIdentifier route : table.getItems()) { if (!route.getContextReference().isEmpty()) { routedRpc.add(ROUTE_CONSTANT + route.getContextReference() + NAME_CONSTANT + route.getType()); } } log.debug("Locally registered routed RPCs {}", routedRpc); return routedRpc; } RemoteRpcRegistryMXBeanImpl(final BucketStoreAccess rpcRegistryAccess, final Timeout timeout); @Override Set<String> getGlobalRpc(); @Override Set<String> getLocalRegisteredRoutedRpc(); @Override Map<String, String> findRpcByName(final String name); @Override Map<String, String> findRpcByRoute(final String routeId); @Override String getBucketVersions();  }
@Test public void testGetLocalRegisteredRoutedRpcEmptyBuckets() { final Set<String> localRegisteredRoutedRpc = mxBean.getLocalRegisteredRoutedRpc(); assertNotNull(localRegisteredRoutedRpc); assertTrue(localRegisteredRoutedRpc.isEmpty()); }
@Test public void testGetLocalRegisteredRoutedRpc() { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Set<String> localRegisteredRoutedRpc = mxBean.getLocalRegisteredRoutedRpc(); assertNotNull(localRegisteredRoutedRpc); assertEquals(1, localRegisteredRoutedRpc.size()); final String localRpc = localRegisteredRoutedRpc.iterator().next(); assertThat(localRpc, containsString(LOCAL_QNAME.toString())); }