### Question:
PDSCancelJobService { @UseCaseUserCancelsJob(@PDSStep(name="service call",description = "trigger change to execution service and marks job status as cancel requested",number=2)) public void cancelJob(UUID jobUUID) { notNull(jobUUID, "job uuid may not be null!"); PDSJob job = assertJobFound(jobUUID, repository); if (PDSJobStatusState.CANCEL_REQUESTED.equals(job.getState()) || PDSJobStatusState.CANCELED.equals(job.getState())) { LOG.info("Cancel ignored because in state:{}", job.getState()); return; } assertJobIsInState(job, PDSJobStatusState.RUNNING); executionService.cancel(jobUUID); job.setState(PDSJobStatusState.CANCEL_REQUESTED); repository.save(job); }  @UseCaseUserCancelsJob(@PDSStep(name="service call",description = "trigger change to execution service and marks job status as cancel requested",number=2)) void cancelJob(UUID jobUUID);  }### Answer:
@Test public void canceling_a_running_job_calls_execution_service_cancel_operation() { job.state = PDSJobStatusState.RUNNING; serviceToTest.cancelJob(jobUUID); verify(executionService).cancel(jobUUID); }
@Test public void canceling_a_running_job_does_change_job_state_to_canceeled() { job.state = PDSJobStatusState.RUNNING; serviceToTest.cancelJob(jobUUID); assertEquals(PDSJobStatusState.CANCEL_REQUESTED, job.getState()); }