RemoteActionRegistryMXBeanImpl extends AbstractRegistryMXBean<ActionRoutingTable, DOMActionInstance> implements RemoteActionRegistryMXBean { @Override public Map<String, String> findActionByName(final String name) { ActionRoutingTable localTable = localData(); Map<String, String> rpcMap = new HashMap<>(getActionMemberMapByName(localTable, name, LOCAL_CONSTANT)); Map<Address, Bucket<ActionRoutingTable>> buckets = remoteBuckets(); for (Map.Entry<Address, Bucket<ActionRoutingTable>> entry : buckets.entrySet()) { ActionRoutingTable table = entry.getValue().getData(); rpcMap.putAll(getActionMemberMapByName(table, name, entry.getKey().toString())); } log.debug("list of Actions {} searched by name {}", rpcMap, name); return rpcMap; } RemoteActionRegistryMXBeanImpl(final BucketStoreAccess actionRegistryAccess, final Timeout timeout); @Override Set<String> getLocalRegisteredAction(); @Override Map<String, String> findActionByName(final String name); @Override Map<String, String> findActionByRoute(final String routeId); @Override String getBucketVersions();  }
@Test public void testFindActionByNameEmptyBuckets() { final Map<String, String> rpcByName = mxBean.findActionByName(""); Assert.assertNotNull(rpcByName); Assert.assertTrue(rpcByName.isEmpty()); }
@Test public void testFindActionByName() { testActor.tell(new ActionRegistry.Messages.UpdateActions(Lists.newArrayList(buckets), Collections.emptyList()), ActorRef.noSender()); final Map<String, String> rpcByName = mxBean.findActionByName(""); Assert.assertNotNull(rpcByName); Assert.assertEquals(1, rpcByName.size()); Assert.assertTrue(rpcByName.containsValue(LOCAL_QNAME.getLocalName())); }