public boolean shouldStepResume(
      String workflowId,
      long version,
      long instanceId,
      long runId,
      String stepId,
      long stepAttemptId) {
    return withMetricLogError(
        () ->
            withRetryableTransaction(
                conn -> {
                  try (PreparedStatement stmt = conn.prepareStatement(CHECK_PAUSED_STEP_ATTEMPT)) {
                    int idx = 0;
                    stmt.setString(++idx, workflowId);
                    stmt.setLong(++idx, version);
                    stmt.setLong(++idx, instanceId);
                    stmt.setLong(++idx, runId);
                    stmt.setString(++idx, stepId);
                    stmt.setLong(++idx, stepAttemptId);
                    ResultSet result = stmt.executeQuery();
                    return !result.next();
                  }
                }),
        "shouldStepResume",
        "Failed on shouldStepResume for stepIdentifier [{}][{}][{}][{}][{}][{}] ",
        workflowId,
        version,
        instanceId,
        runId,
        stepId,
        stepAttemptId);
  }
@Test
  public void testShouldStepResume() throws SQLException {
    maestroStepBreakpointDao.insertPausedStepInstanceAttempt(
        conn,
        TEST_WORKFLOW_ID1,
        TEST_WORKFLOW_VERSION1,
        TEST_WORKFLOW_INSTANCE1,
        TEST_WORKFLOW_RUN1,
        TEST_STEP_ID1,
        TEST_STEP_ATTEMPT1);
    conn.commit();
    conn.close();
    assertFalse(
        maestroStepBreakpointDao.shouldStepResume(
            TEST_WORKFLOW_ID1,
            TEST_WORKFLOW_VERSION1,
            TEST_WORKFLOW_INSTANCE1,
            TEST_WORKFLOW_RUN1,
            TEST_STEP_ID1,
            TEST_STEP_ATTEMPT1));
    maestroStepBreakpointDao.resumePausedStepInstanceAttempt(
        TEST_WORKFLOW_ID1,
        TEST_WORKFLOW_VERSION1,
        TEST_WORKFLOW_INSTANCE1,
        TEST_WORKFLOW_RUN1,
        TEST_STEP_ID1,
        TEST_STEP_ATTEMPT1);
    assertTrue(
        maestroStepBreakpointDao.shouldStepResume(
            TEST_WORKFLOW_ID1,
            TEST_WORKFLOW_VERSION1,
            TEST_WORKFLOW_INSTANCE1,
            TEST_WORKFLOW_RUN1,
            TEST_STEP_ID1,
            TEST_STEP_ATTEMPT1));
  }