private void resetAgentCommandPublisherMock(AgentCommandsPublisher agentCommandsPublisher,
                                              AtomicLongMap<Long> callCounterByHost,
                                              AtomicInteger methodCallCounter) throws AmbariException {
    reset(agentCommandsPublisher);
    Mockito.doAnswer((i) -> {
      Multimap<Long, AgentCommand> host = (Multimap<Long, AgentCommand>) i.getArguments()[0];
      if (host != null) {
        host.asMap().forEach((h, l) -> callCounterByHost.addAndGet(h, 1));
      }
      methodCallCounter.incrementAndGet();
      return null;
    }).when(agentCommandsPublisher).sendAgentCommand(any(Multimap.class));
  }
This test sends a new action to the action scheduler and verifies that the action
shows up in the action queue.
ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java