final JobVertexID jid = new JobVertexID();
// mock taskmanager to simply accept the call
final TaskOperationProtocol taskManager = mock(TaskOperationProtocol.class);
final Instance instance = getInstance(taskManager);
final AllocatedSlot slot = instance.allocateSlot(new JobID());
final ExecutionJobVertex ejv = getJobVertexExecutingAsynchronously(jid);
final ExecutionVertex vertex = new ExecutionVertex(ejv, 0, new IntermediateResult[0]);
when(taskManager.submitTask(Matchers.any(TaskDeploymentDescriptor.class))).thenReturn(new TaskOperationResult(vertex.getCurrentExecutionAttempt().getAttemptId(), false, ERROR_MESSAGE));