public TimelineEvent stop(String workflowId, User caller) {
    return terminate(workflowId, Actions.WorkflowInstanceAction.STOP, caller);
  }
@Test
  public void testStop() {
    when(instanceDao.terminateQueuedInstances(
            eq("sample-minimal-wf"),
            eq(Constants.TERMINATE_BATCH_LIMIT),
            eq(WorkflowInstance.Status.STOPPED),
            anyString()))
        .thenReturn(Constants.TERMINATE_BATCH_LIMIT)
        .thenReturn(Constants.TERMINATE_BATCH_LIMIT)
        .thenReturn(Constants.TERMINATE_BATCH_LIMIT - 1);
    when(instanceDao.terminateRunningInstances(
            eq("sample-minimal-wf"),
            eq(Constants.TERMINATE_BATCH_LIMIT),
            eq(Actions.WorkflowInstanceAction.STOP),
            any(),
            anyString()))
        .thenReturn(Constants.TERMINATE_BATCH_LIMIT - 1);
    String res = actionHandler.stop("sample-minimal-wf", tester).getMessage();
    assertEquals("Terminated [29] queued instances and terminating [9] running instances", res);
  }