@Test
public void testSelectAndUpdateExecution() throws Exception {

  final ExecutableFlow flow = TestUtils.createTestExecutableFlow("exectest1", "exec1");
  flow.setStatus(Status.PREPARING);
  flow.setSubmitTime(System.currentTimeMillis());
  this.executionFlowDao.uploadExecutableFlow(flow);
  final Executor executor = this.executorDao.addExecutor("localhost", 12345);
  assertThat(this.executionFlowDao.selectAndUpdateExecution(executor.getId(), true))
      .isEqualTo(flow.getExecutionId());
  assertThat(this.executorDao.fetchExecutorByExecutionId(flow.getExecutionId())).isEqualTo
      (executor);
}