public void updateRuntimeState(
      WorkflowInstance.Status status, WorkflowRuntimeOverview overview, Long curTime) {
    if (WorkflowInstance.Status.IN_PROGRESS.equals(status)) {
      this.startTime = curTime;
    } else {
      this.endTime = curTime;
    }
    this.instanceStatus = status;
    this.modifyTime = System.currentTimeMillis();
    this.runtimeOverview = overview;
  }
@Test
  public void testUpdateRuntimeState() {
    WorkflowRuntimeSummary summary = new WorkflowRuntimeSummary();
    summary.updateRuntimeState(WorkflowInstance.Status.IN_PROGRESS, null, 123456L);
    assertEquals(123456L, summary.getStartTime().longValue());
    assertNull(summary.getEndTime());
    assertEquals(WorkflowInstance.Status.IN_PROGRESS, summary.getInstanceStatus());
    assertNull(summary.getRuntimeOverview());

    WorkflowRuntimeOverview overview =
        WorkflowRuntimeOverview.of(
            1,
            singletonEnumMap(StepInstance.Status.SUCCEEDED, WorkflowStepStatusSummary.of(1L)),
            null);
    summary.updateRuntimeState(WorkflowInstance.Status.SUCCEEDED, overview, 654321L);
    assertEquals(123456L, summary.getStartTime().longValue());
    assertEquals(654321L, summary.getEndTime().longValue());
    assertEquals(WorkflowInstance.Status.SUCCEEDED, summary.getInstanceStatus());
    assertEquals(overview, summary.getRuntimeOverview());
  }