@Test
public void testFetchRecentlyFinishedFlows() throws Exception {

  final ExecutableFlow flow1 = createExecution(System.currentTimeMillis(), Status.SUCCEEDED);
  flow1.setEndTime(System.currentTimeMillis());
  this.executionFlowDao.updateExecutableFlow(flow1);
  //Flow just finished. Fetch recently finished flows immediately. Should get it.
  final List<ExecutableFlow> flows = this.executionFlowDao.fetchRecentlyFinishedFlows(
      RECENTLY_FINISHED_LIFETIME);
  assertThat(flows.size()).isEqualTo(1);
  assertTwoFlowSame(flow1, flows.get(0));
}