Stage { public String getRequestContext() { return requestContext; } @AssistedInject  Stage(@Assisted long requestId,
      @Assisted("logDir") String logDir,
      @Assisted("clusterName") @Nullable String clusterName,
      @Assisted("clusterId") long clusterId,
      @Assisted("requestContext") @Nullable String requestContext,
      @Assisted("clusterHostInfo") String clusterHostInfo,
      @Assisted("commandParamsStage") String commandParamsStage,
      @Assisted("hostParamsStage") String hostParamsStage,
      HostRoleCommandFactory hostRoleCommandFactory, ExecutionCommandWrapperFactory ecwFactory); @AssistedInject  Stage(@Assisted StageEntity stageEntity, HostRoleCommandDAO hostRoleCommandDAO,
      ActionDBAccessor dbAccessor, Clusters clusters, HostRoleCommandFactory hostRoleCommandFactory,
      ExecutionCommandWrapperFactory ecwFactory); synchronized StageEntity constructNewPersistenceEntity(); List<HostRoleCommand> getOrderedHostRoleCommands(); Set<RoleCommandPair> getHostRolesInProgress(); String getClusterHostInfo(); void setClusterHostInfo(String clusterHostInfo); String getCommandParamsStage(); void setCommandParamsStage(String commandParamsStage); String getHostParamsStage(); void setHostParamsStage(String hostParamsStage); CommandExecutionType getCommandExecutionType(); void setCommandExecutionType(CommandExecutionType commandExecutionType); HostRoleStatus getStatus(); void setStatus(HostRoleStatus status); synchronized void setStageId(long stageId); synchronized long getStageId(); String getActionId(); synchronized void addHostRoleExecutionCommand(String host, Role role, RoleCommand command,
      ServiceComponentHostEvent event, String clusterName, String serviceName, boolean retryAllowed,
      boolean autoSkipFailure); synchronized void addHostRoleExecutionCommand(Host host, Role role, RoleCommand command,
      ServiceComponentHostEvent event, Cluster cluster, String serviceName, boolean retryAllowed,
      boolean autoSkipFailure); synchronized void addServerActionCommand(String actionName, @Nullable String userName,
      Role role, RoleCommand command, String clusterName,
      ServiceComponentHostServerActionEvent event, @Nullable Map<String, String> commandParams,
      @Nullable String commandDetail, @Nullable Map<String, Map<String, String>> configTags,
      @Nullable Integer timeout, boolean retryAllowed, boolean autoSkipFailure); synchronized void addCancelRequestCommand(List<Long> cancelTargets, String clusterName, String hostName); synchronized List<String> getHosts(); synchronized void setSuccessFactors(Map<Role, Float> suc); synchronized Map<Role, Float> getSuccessFactors(); long getRequestId(); String getClusterName(); long getClusterId(); String getRequestContext(); long getLastAttemptTime(String hostname, String role); short getAttemptCount(String hostname, String role); void incrementAttemptCount(String hostname, String role); void setLastAttemptTime(String hostname, String role, long t); ExecutionCommandWrapper getExecutionCommandWrapper(String hostname,
      String role); List<ExecutionCommandWrapper> getExecutionCommands(String hostname); long getStartTime(String hostname, String role); void setStartTime(String hostname, String role, long startTime); HostRoleStatus getHostRoleStatus(String hostname, String role); void setHostRoleStatus(String hostname, String role,
      HostRoleStatus status); ServiceComponentHostEventWrapper getFsmEvent(String hostname, String roleStr); void setExitCode(String hostname, String role, int exitCode); int getExitCode(String hostname, String role); void setStderr(String hostname, String role, String stdErr); void setStdout(String hostname, String role, String stdOut); synchronized boolean isStageInProgress(); synchronized boolean doesStageHaveHostRoleStatus(
      Set<HostRoleStatus> statuses); Map<String, List<ExecutionCommandWrapper>> getExecutionCommands(); String getLogDir(); Map<String, Map<String, HostRoleCommand>> getHostRoleCommands(); HostRoleCommand getHostRoleCommand(long taskId); synchronized void addExecutionCommandWrapper(Stage origStage,
      String hostname, Role r); HostRoleCommand getHostRoleCommand(String hostname, String role); synchronized int getStageTimeout(); boolean isSkippable(); void setSkippable(boolean skippable); boolean isAutoSkipOnFailureSupported(); void setAutoSkipFailureSupported(boolean supportsAutoSkipOnFailure); @Override //Object synchronized String toString(); static final String INTERNAL_HOSTNAME; }
@Test public void testGetRequestContext() { Stage stage = stageFactory.createNew(1, "/logDir", "c1", 1L, "My Context", CLUSTER_HOST_INFO, "", ""); assertEquals("My Context", stage.getRequestContext()); assertEquals(CLUSTER_HOST_INFO, stage.getClusterHostInfo()); }