OpsListener implements DOMRpcAvailabilityListener, DOMActionAvailabilityExtension.AvailabilityListener { @Override public void onActionsChanged(final Set<DOMActionInstance> removed, final Set<DOMActionInstance> added) { LOG.debug("adding registration for [{}]", added); LOG.debug("removing registration for [{}]", removed); actionRegistry.tell(new ActionRegistry.Messages.UpdateActions(added, removed), ActorRef.noSender()); } OpsListener(final ActorRef rpcRegistry, final ActorRef actionRegistry); @Override void onRpcAvailable(final Collection<DOMRpcIdentifier> rpcs); @Override void onRpcUnavailable(final Collection<DOMRpcIdentifier> rpcs); @Override boolean acceptsImplementation(final DOMRpcImplementation impl); @Override boolean acceptsImplementation(final DOMActionImplementation impl); @Override void onActionsChanged(final Set<DOMActionInstance> removed, final Set<DOMActionInstance> added);  }
@Test public void testActionRouteAdd() { final TestKit probeReg = new TestKit(SYSTEM); final ActorRef actionRegistry = probeReg.getRef(); final OpsListener opsListener = new OpsListener(actionRegistry, actionRegistry); opsListener.onActionsChanged(Collections.emptySet(),Collections.singleton(ACTION_INSTANCE)); probeReg.expectMsgClass(ActionRegistry.Messages.UpdateActions.class); }