/**
   * This method creates a new State object which is sufficient to create a new
   * FinishDeploymentWorkflowService instance.
   */
  private InitializeDeploymentMigrationWorkflowService.State buildValidStartState(
      @Nullable InitializeDeploymentMigrationWorkflowService.TaskState.TaskStage startStage,
      @Nullable InitializeDeploymentMigrationWorkflowService.TaskState.SubStage startSubStage)
      throws Throwable {
    InitializeDeploymentMigrationWorkflowService.State startState =
        new InitializeDeploymentMigrationWorkflowService.State();
    startState.controlFlags = ControlFlags.CONTROL_FLAG_OPERATION_PROCESSING_DISABLED;
    startState.sourceLoadBalancerAddress = "lbLink1";
    startState.destinationDeploymentId = "deployment1";
    startState.taskPollDelay = 1;

    if (null != startStage) {
      startState.taskState = new InitializeDeploymentMigrationWorkflowService.TaskState();
      startState.taskState.stage = startStage;
      startState.taskState.subStage = startSubStage;

      if (TaskState.TaskStage.STARTED == startStage) {
        switch (startSubStage) {
          case CONTIONUS_MIGRATE_DATA:
          case UPLOAD_VIBS:
            startState.sourceZookeeperQuorum = "quorum";
            // fall through
          case PAUSE_DESTINATION_SYSTEM:
            startState.sourceDeploymentId = "deployment1";
            break;
        }
      }
    }

    return startState;
  }
  /**
   * This method creates a patch State object which is sufficient to patch a
   * InitializeDeploymentMigrationWorkflowService instance.
   */
  private InitializeDeploymentMigrationWorkflowService.State buildValidPatchState(
      TaskState.TaskStage patchStage,
      InitializeDeploymentMigrationWorkflowService.TaskState.SubStage patchSubStage) {

    InitializeDeploymentMigrationWorkflowService.State patchState =
        new InitializeDeploymentMigrationWorkflowService.State();
    patchState.taskState = new InitializeDeploymentMigrationWorkflowService.TaskState();
    patchState.taskState.stage = patchStage;
    patchState.taskState.subStage = patchSubStage;

    if (TaskState.TaskStage.STARTED == patchStage) {
      switch (patchSubStage) {
        case CONTIONUS_MIGRATE_DATA:
        case UPLOAD_VIBS:
          patchState.sourceZookeeperQuorum = "quorum";
          break;
        case PAUSE_DESTINATION_SYSTEM:
          patchState.sourceDeploymentId = "deployment1";
          break;
      }
    }

    return patchState;
  }