public WorkflowTimeline getWorkflowTimeline(String workflowId) {
    List<WorkflowVersionUpdateJobEvent> jobEvents =
        withMetricLogError(
            () ->
                getPayloads(
                    GET_WORKFLOW_TIMELINE_QUERY,
                    stmt -> {
                      stmt.setString(1, workflowId);
                    },
                    WorkflowVersionUpdateJobEvent.class),
            "getWorkflowTimeline",
            "Failed getting timeline events for workflow id [{}]",
            workflowId);

    return new WorkflowTimeline(
        workflowId,
        jobEvents.stream()
            .map(
                e ->
                    new WorkflowTimeline.WorkflowTimelineEvent(
                        e.getAuthor(), e.getLog(), e.getEventTime()))
            .collect(Collectors.toList()));
  }
@Test
  public void testGetWorkflowTimeline() throws Exception {
    WorkflowDefinition wfd = loadWorkflow(TEST_WORKFLOW_ID1);
    WorkflowDefinition definition =
        workflowDao.addWorkflowDefinition(wfd, wfd.getPropertiesSnapshot().extractProperties());
    assertNotNull(wfd.getInternalId());
    assertEquals(wfd, definition);
    WorkflowTimeline results = workflowDao.getWorkflowTimeline(TEST_WORKFLOW_ID1);
    assertEquals(TEST_WORKFLOW_ID1, results.getWorkflowId());
    assertEquals(1, results.getTimelineEvents().size());
    assertEquals(
        "Created a new workflow version [1] for workflow id [sample-active-wf-with-props]",
        results.getTimelineEvents().get(0).getLog());
    assertEquals(1598399975650L, results.getTimelineEvents().get(0).getTimestamp());
  }