@JsonIgnore
  public LongParamDefinition getCompletedByTsParam() {
    if (completedByTs != null) {
      return ParamDefinition.buildParamDefinition(PARAM_NAME, completedByTs);
    }
    if (completedByHour != null) {
      String timeZone = tz == null ? "WORKFLOW_CRON_TIMEZONE" : String.format("'%s'", tz);
      return LongParamDefinition.builder()
          .name(PARAM_NAME)
          .expression(String.format(COMPLETED_HOUR_TCT_TS, timeZone, completedByHour))
          .build();
    }
    if (durationMinutes != null) {
      return LongParamDefinition.builder()
          .name(PARAM_NAME)
          .expression(String.format(DURATION_MINUTES_TCT_TS, durationMinutes))
          .build();
    }
    throw new MaestroInternalError(
        "Invalid TCT definition, neither of time fields is set: %s", this);
  }
@Test
  public void testGetCompletedByTsParamWithDurationMinutes() {
    Tct tct = new Tct();
    tct.setDurationMinutes(60);
    tct.setTz("UTC");
    LongParamDefinition expected =
        LongParamDefinition.builder()
            .name("completed_by_ts")
            .expression("return new DateTime(RUN_TS).plusMinutes(60).getMillis();")
            .build();

    LongParamDefinition actual = tct.getCompletedByTsParam();
    assertEquals(expected, actual);
  }