### Question:
PDSGetJobResultService { @UseCaseUserFetchesJobResult(@PDSStep(name="service call",description = "job result fetch from database, when not done a failure will be shown",number=2)) @RolesAllowed({PDSRoleConstants.ROLE_SUPERADMIN, PDSRoleConstants.ROLE_USER}) public String getJobResult(UUID jobUUID) { return getJobResult(jobUUID, true); }  @UseCaseUserFetchesJobResult(@PDSStep(name="service call",description = "job result fetch from database, when not done a failure will be shown",number=2)) @RolesAllowed({PDSRoleConstants.ROLE_SUPERADMIN, PDSRoleConstants.ROLE_USER}) String getJobResult(UUID jobUUID); @RolesAllowed(PDSRoleConstants.ROLE_SUPERADMIN) @UseCaseAdminFetchesJobResultOrFailureText(@PDSStep(name="service call",description = "result data will be returned - can be empty or even a failure text from job execution.",number=2)) String getJobResultOrFailureText(UUID jobUUID);  }### Answer:
@Test public void job_not_found_throws_pds_not_found_exception() { expected.expect(PDSNotFoundException.class); expected.expectMessage("Given job does not exist"); UUID notExistingJobUUID = UUID.randomUUID(); serviceToTest.getJobResult(notExistingJobUUID); }
@Test public void job_rdone_esult_found_and_returned() { job.state=PDSJobStatusState.DONE; job.result="the result"; String result = serviceToTest.getJobResult(jobUUID); assertEquals("the result", result); }