@Test
public void testFetchQueuedFlows() throws Exception {

  final ExecutableFlow flow1 = submitNewFlow("exectest1", "exec1", System.currentTimeMillis(),
      ExecutionOptions.DEFAULT_FLOW_PRIORITY);
  final ExecutableFlow flow2 = submitNewFlow("exectest1", "exec2", System.currentTimeMillis(),
      ExecutionOptions.DEFAULT_FLOW_PRIORITY);
  final List<Pair<ExecutionReference, ExecutableFlow>> fetchedQueuedFlows =
      this.executionFlowDao.fetchQueuedFlows();
  assertThat(fetchedQueuedFlows.size()).isEqualTo(2);
  final Pair<ExecutionReference, ExecutableFlow> fetchedFlow1 = fetchedQueuedFlows.get(0);
  final Pair<ExecutionReference, ExecutableFlow> fetchedFlow2 = fetchedQueuedFlows.get(1);
  assertTwoFlowSame(flow1, fetchedFlow1.getSecond());
  assertTwoFlowSame(flow2, fetchedFlow2.getSecond());
}