ExecutionFlowDao { public ExecutableFlow fetchExecutableFlow(final int execId) throws ExecutorManagerException { final FetchExecutableFlows flowHandler = new FetchExecutableFlows(); try { final List<ExecutableFlow> properties = this.dbOperator .query(FetchExecutableFlows.FETCH_EXECUTABLE_FLOW, flowHandler, execId); if (properties.isEmpty()) { return null; } else { return properties.get(0); } } catch (final SQLException e) { throw new ExecutorManagerException("Error fetching flow id " + execId, e); } } @Inject  ExecutionFlowDao(final DatabaseOperator dbOperator, final MysqlNamedLock mysqlNamedLock); void uploadExecutableFlow(final ExecutableFlow flow); List<ExecutableFlow> fetchAgedQueuedFlows(final Duration minAge); List<Pair<ExecutionReference, ExecutableFlow>> fetchQueuedFlows(); List<ExecutableFlow> fetchFlowHistory(final int projectId, final String flowId, final
  long startTime); ExecutableFlow fetchExecutableFlow(final int execId); void unsetExecutorIdForExecution(final int executionId); int selectAndUpdateExecution(final int executorId, final boolean isActive); int selectAndUpdateExecutionWithLocking(final int executorId, final boolean isActive);  }
@Test public void testFlowStatusWithFetchExecutableFlows() throws Exception { final ExecutableFlow flow = submitNewFlow("exectest1", "exec1", System.currentTimeMillis(), ExecutionOptions.DEFAULT_FLOW_PRIORITY); int execId = flow.getExecutionId(); makeFlowStatusInconsistent(execId, Status.FAILED_FINISHING); final ExecutableFlow fetchedFlow = this.executionFlowDao.fetchExecutableFlow(execId); assertThat(fetchedFlow.getStatus()).isEqualTo(Status.FAILED_FINISHING); }