Skip to content

Commit

Permalink
add test to cover getNomisNumberWithPrisonFilter returning null
Browse files Browse the repository at this point in the history
  • Loading branch information
emmalanigan committed Mar 11, 2025
1 parent 215418d commit 4b31ac1
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,12 @@ internal class GetCellLocationForPersonServiceTest(
.type
.shouldBe(UpstreamApiError.Type.ENTITY_NOT_FOUND)
}

it("failed to get prisoners nomis number") {
val err = listOf(UpstreamApiError(UpstreamApi.NOMIS, UpstreamApiError.Type.ENTITY_NOT_FOUND))
whenever(getPersonService.getNomisNumberWithPrisonFilter(hmppsId, filters)).thenReturn(Response(data = NomisNumber(), errors = emptyList()))
val response = getCellLocationForPersonService.execute(hmppsId, filters)
response.errors.shouldBe(err)
}
},
)

0 comments on commit 4b31ac1

Please sign in to comment.