@Test
public void testGetRequestStatusResponse() {

  ActionManager actionManager = createStrictMock(ActionManager.class);
  Stage stage1 = createNiceMock(Stage.class);
  Stage stage2 = createNiceMock(Stage.class);
  HostRoleCommand command1 = createNiceMock(HostRoleCommand.class);
  Role role = createNiceMock(Role.class);
  List<Stage> stages = new ArrayList<Stage>();
  RoleCommand roleCommand = RoleCommand.INSTALL;
  HostRoleStatus status = HostRoleStatus.IN_PROGRESS;
  stages.add(stage1);
  stages.add(stage2);
  List<HostRoleCommand> hostRoleCommands = new ArrayList<HostRoleCommand>();
  hostRoleCommands.add(command1);
  expect(actionManager.getRequestTasks(100)).andReturn(hostRoleCommands);
  expect(actionManager.getRequestContext(100)).andReturn("test");
  expect(command1.getTaskId()).andReturn(1L);
  expect(command1.getRoleCommand()).andReturn(roleCommand);
  expect(command1.getRole()).andReturn(role);
  expect(command1.getStatus()).andReturn(status);
  replay(actionManager, stage1, stage2, command1, role);
  RequestStageContainer requestStages = new RequestStageContainer(100L, stages, null, actionManager);
  RequestStatusResponse response = requestStages.getRequestStatusResponse();
  assertEquals(100, response.getRequestId());
  List<ShortTaskStatus> tasks = response.getTasks();
  assertEquals(1, tasks.size());
  ShortTaskStatus task = tasks.get(0);
  assertEquals(1, task.getTaskId());
  assertEquals(roleCommand.toString(), task.getCommand());
  assertEquals(status.toString(), task.getStatus());
  assertEquals("test", response.getRequestContext());
  verify(actionManager, stage1, stage2, command1, role);
}