@@ -13,37 +13,37 @@ import uk.gov.justice.digital.hmpps.hmppsintegrationapi.gateways.ManagePOMCaseGa
13
13
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.Identifiers
14
14
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.Person
15
15
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.Prison
16
- import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.PrisonOfficerManager
16
+ import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.PrisonOffenderManager
17
17
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.Response
18
18
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.UpstreamApi
19
19
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.UpstreamApiError
20
20
21
21
@ContextConfiguration(
22
22
initializers = [ConfigDataApplicationContextInitializer ::class ],
23
- classes = [GetPrisonOfficerManagerForPersonService ::class ],
23
+ classes = [GetPrisonOffenderManagerForPersonService ::class ],
24
24
)
25
- class GetPrisonOfficerManagerForPersonServiceTest (
25
+ class GetPrisonOffenderManagerForPersonServiceTest (
26
26
@MockBean val managePOMCaseGateway : ManagePOMCaseGateway ,
27
27
@MockBean val getPersonService : GetPersonService ,
28
- private val getPrisonOfficerManagerForPersonService : GetPrisonOfficerManagerForPersonService ,
28
+ private val getPrisonOffenderManagerForPersonService : GetPrisonOffenderManagerForPersonService ,
29
29
) : DescribeSpec(
30
30
{
31
31
val hmppsId = " 1234/56789B"
32
32
val nomisNumber = " Z99999ZZ"
33
33
val person = Person (firstName = "Julianna ", lastName = "Blake ", identifiers = Identifiers (nomisNumber = nomisNumber))
34
34
35
- val prisonOfficerManager = PrisonOfficerManager (forename = "Paul ", surname = "Smith ", prison = Prison (code = "RED "))
35
+ val prisonOffenderManager = PrisonOffenderManager (forename = "Paul ", surname = "Smith ", prison = Prison (code = "RED "))
36
36
37
37
beforeEach {
38
38
Mockito .reset(getPersonService)
39
39
Mockito .reset(managePOMCaseGateway)
40
40
41
41
whenever(getPersonService.execute(hmppsId = hmppsId)).thenReturn(Response (person))
42
- whenever(managePOMCaseGateway.getPrimaryPOMForNomisNumber(id = nomisNumber)).thenReturn(Response (prisonOfficerManager ))
42
+ whenever(managePOMCaseGateway.getPrimaryPOMForNomisNumber(id = nomisNumber)).thenReturn(Response (prisonOffenderManager ))
43
43
}
44
44
45
45
it("performs a search according to hmpps Id ") {
46
- getPrisonOfficerManagerForPersonService .execute(hmppsId)
46
+ getPrisonOffenderManagerForPersonService .execute(hmppsId)
47
47
verify(getPersonService, VerificationModeFactory .times(1)).execute(hmppsId = hmppsId)
48
48
}
49
49
@@ -53,8 +53,8 @@ class GetPrisonOfficerManagerForPersonServiceTest(
53
53
data = person,
54
54
),
55
55
)
56
- val result = getPrisonOfficerManagerForPersonService .execute(hmppsId)
57
- result.shouldBe(Response (data = prisonOfficerManager ))
56
+ val result = getPrisonOffenderManagerForPersonService .execute(hmppsId)
57
+ result.shouldBe(Response (data = prisonOffenderManager ))
58
58
}
59
59
60
60
it("should return a list of errors if person not found") {
@@ -70,8 +70,8 @@ class GetPrisonOfficerManagerForPersonServiceTest(
70
70
),
71
71
),
72
72
)
73
- val result = getPrisonOfficerManagerForPersonService .execute("NOT_FOUND ")
74
- result.data.shouldBe(PrisonOfficerManager ())
73
+ val result = getPrisonOffenderManagerForPersonService .execute("NOT_FOUND ")
74
+ result.data.shouldBe(PrisonOffenderManager ())
75
75
result.errors.first().type.shouldBe(UpstreamApiError .Type .ENTITY_NOT_FOUND )
76
76
}
77
77
},
0 commit comments