@Test
public void testTimeOutWithHostNull() throws AmbariException {

  Stage s = getStageWithServerAction(1, 977, null, "test", 2, false, false);
  s.setHostRoleStatus(null, Role.AMBARI_SERVER_ACTION.toString(), HostRoleStatus.IN_PROGRESS);
  ActionScheduler scheduler = EasyMock.createMockBuilder(ActionScheduler.class)
    .withConstructor(long.class, long.class, ActionDBAccessor.class, ActionQueue.class, Clusters.class, int.class,
          HostsMap.class, UnitOfWork.class, AmbariEventPublisher.class, Configuration.class,
          Provider.class, HostRoleCommandDAO.class, HostRoleCommandFactory.class)
    .withArgs(100L, 50L, null, null, null, -1, null, null, null, null, entityManagerProviderMock,
          mock(HostRoleCommandDAO.class), mock(HostRoleCommandFactory.class))
    .createNiceMock();
  EasyMock.replay(scheduler);
  // currentTime should be set to -1 and taskTimeout to 1 because it is needed for timeOutActionNeeded method will return false value
  Assert.assertEquals(false, scheduler.timeOutActionNeeded(HostRoleStatus.IN_PROGRESS, s, null, Role.AMBARI_SERVER_ACTION.toString(), -1L, 1L));
  EasyMock.verify(scheduler);
}