public WorkflowActionResponse activate(String workflowId, String version, User caller) {
    Checks.notNull(
        caller, "caller cannot be null to activate workflow [%s][%s]", workflowId, version);
    WorkflowVersionUpdateJobEvent jobEvent =
        (WorkflowVersionUpdateJobEvent) workflowDao.activate(workflowId, version, caller);
    LOG.info(jobEvent.getLog());
    TimelineEvent event =
        TimelineActionEvent.builder()
            .action(Actions.WorkflowAction.ACTIVATE)
            .author(caller)
            .message(jobEvent.getLog())
            .build();
    return WorkflowActionResponse.from(workflowId, jobEvent.getCurrentActiveVersion(), event);
  }
@Test
  public void testActivateError() {
    AssertHelper.assertThrows(
        "caller cannot be null to activate workflow",
        NullPointerException.class,
        "caller cannot be null to activate workflow [sample-minimal-wf][1]",
        () -> actionHandler.activate("sample-minimal-wf", "1", null));
    when(workflowDao.activate("sample-minimal-wf", "0", tester))
        .thenThrow(new InvalidWorkflowVersionException("sample-minimal-wf", "0"));
    AssertHelper.assertThrows(
        "Workflow version must be larger than 0",
        InvalidWorkflowVersionException.class,
        "Invalid workflow version [0] for workflow [sample-minimal-wf]",
        () -> actionHandler.activate("sample-minimal-wf", "0", tester));
  }