public int cleanUp(String workflowId, long instanceId, long runId) {
    int deleted =
        withMetricLogError(
            () ->
                withRetryableUpdate(
                    DELETE_ACTIONS_QUERY,
                    stmt -> {
                      int idx = 0;
                      stmt.setString(++idx, workflowId);
                      stmt.setLong(++idx, instanceId);
                      stmt.setLong(++idx, runId);
                    }),
            "cleanUp",
            "Failed to delete actions for any steps in workflow [{}][{}][{}]",
            workflowId,
            instanceId,
            runId);
    LOG.debug(
        "cleanup [{}] remaining actions for workflow instance: [{}][{}][{}]",
        deleted,
        workflowId,
        instanceId,
        runId);
    return deleted;
  }
@Test
  public void testCleanUp() {
    testRestartDirectly();
    StepInstanceUpdateJobEvent event = new StepInstanceUpdateJobEvent();
    event.setWorkflowId(stepInstance.getWorkflowId());
    event.setWorkflowInstanceId(stepInstance.getWorkflowInstanceId());
    event.setWorkflowRunId(stepInstance.getWorkflowRunId());
    event.setStepId(stepInstance.getStepId());
    Assert.assertEquals(1, actionDao.cleanUp(event));
  }