public StepInstanceActionResponse bypassStepDependencies(
      WorkflowInstance instance, String stepId, User user, boolean blocking) {
    validateStepId(instance, stepId, Actions.StepInstanceAction.BYPASS_STEP_DEPENDENCIES);
    StepInstance stepInstance =
        getStepInstanceAndValidateBypassStepDependencyConditions(instance, stepId);

    StepAction stepAction = StepAction.createBypassStepDependencies(stepInstance, user);
    saveAction(stepInstance, stepAction);
    if (blocking) {
      return waitBypassStepDependenciesResponseWithTimeout(stepInstance, stepAction);
    } else {
      return createActionResponseFrom(stepInstance, null, stepAction.toTimelineEvent());
    }
  }
@Test
  public void testInvalidBypassSignalDependencies() {
    AssertHelper.assertThrows(
        "Cannot manually RESTART the step",
        MaestroBadRequestException.class,
        "Cannot manually BYPASS_STEP_DEPENDENCIES the step [not-existing] because the latest workflow run",
        () -> actionDao.bypassStepDependencies(instance, "not-existing", user, true));

    stepInstance.getRuntimeState().setStatus(StepInstance.Status.RUNNING);
    stepInstanceDao.insertOrUpsertStepInstance(stepInstance, true);

    AssertHelper.assertThrows(
        "Cannot manually bypass the step dependencies",
        MaestroInvalidStatusException.class,
        "Cannot manually bypass-step-dependencies the step as its status [RUNNING] is not waiting for signals",
        () -> actionDao.bypassStepDependencies(instance, "job1", user, true));
  }