@Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        String host = (String) invocation.getArguments()[0];
        String role = (String) invocation.getArguments()[3];
        CommandReport commandReport = (CommandReport) invocation.getArguments()[4];

        HostRoleCommand command = null;
        if (null == host) {
          command = s.getHostRoleCommand(null, role);
        } else {
          command = s.getHostRoleCommand(host, role);
        }

        command.setStatus(HostRoleStatus.valueOf(commandReport.getStatus()));
        return null;
      }
Ensures that the task is timed out and that it will be skipped.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java