final ExecutionVertex vertex = new ExecutionVertex(ejv, 0, new IntermediateResult[0]);
final ExecutionAttemptID eid = vertex.getCurrentExecutionAttempt().getAttemptId();
// the deployment call succeeds regularly
when(taskManager.submitTask(any(TaskDeploymentDescriptor.class))).thenReturn(new TaskOperationResult(eid, true));
// first cancel call does not find a task, second one finds it
when(taskManager.cancelTask(any(ExecutionAttemptID.class))).thenReturn(
new TaskOperationResult(eid, false), new TaskOperationResult(eid, true));
assertEquals(ExecutionState.CREATED, vertex.getExecutionState());
vertex.deployToSlot(slot);
assertEquals(ExecutionState.DEPLOYING, vertex.getExecutionState());