final InstanceID iid = new InstanceID();
when(jm.registerTaskManager(Matchers.any(InstanceConnectionInfo.class), Matchers.any(HardwareDescription.class), Matchers.anyInt()))
.thenReturn(iid);
when(jm.sendHeartbeat(iid)).thenReturn(true);
when(jm.updateTaskExecutionState(any(TaskExecutionState.class))).thenReturn(true);
return jm;
}