snowe
06/13/2018, 4:28 PMzpearce
06/13/2018, 4:30 PMrook
06/13/2018, 4:32 PMkarelpeeters
06/13/2018, 4:34 PMzpearce
06/13/2018, 4:35 PMsnowe
06/13/2018, 4:38 PMfun testGetAllEmploymentGapForAnApplicant_ApplicantIdNotFound_ThrowsNotFoundException() {
fun `Get of all Employment Gaps for an Applicant when ApplicantId not found throws NotFoundException`() {
rook
06/13/2018, 4:40 PMsnowe
06/13/2018, 4:40 PMrook
06/13/2018, 4:41 PMsnowe
06/13/2018, 4:43 PMkarelpeeters
06/13/2018, 4:45 PMdatabase.getAllEmploymentGapForApplicant(applicantId)
?snowe
06/13/2018, 4:45 PMkarelpeeters
06/13/2018, 4:46 PMthrows
part: @Throws(NotFoundException::class)
fun getAllEmploymentGapForAnApplicant_ApplicantIdNotFound() {}
snowe
06/13/2018, 4:50 PM@Test(expected = NotFoundException::class)
@Throws(Exception::class)
fun testGetAllEmploymentGapForAnApplicant_ApplicantIdNotFound_ThrowsNotFoundException() {
val employmentGaps = Lists.newArrayList(employmentGap())
whenever(applicantDataService.findOne(applicantId)).thenReturn(Optional.empty())
val allEmploymentGapsForAnApplicant = employmentDataService.getAllEmploymentGapsForAnApplicant(applicantId)
assertNotNull(allEmploymentGapsForAnApplicant)
assertFalse(allEmploymentGapsForAnApplicant.isEmpty())
allEmploymentGapsForAnApplicant.forEach { dto -> verify(dto, findEmploymentGapById(employmentGaps, dto.employmentGapId)) }
}
karelpeeters
06/13/2018, 5:23 PMsnowe
06/13/2018, 5:31 PMkarelpeeters
06/13/2018, 5:33 PM