Skip to content

Commit 4037eb5

Browse files
HIA-697 - WIP Smoke test
1 parent ea14064 commit 4037eb5

File tree

5 files changed

+55
-0
lines changed

5 files changed

+55
-0
lines changed

src/main/resources/application-dev.yml

+1
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,4 @@ authorisation:
6262
- "/v1/persons/.*/risks/scores"
6363
- "/v1/persons/.*/risks"
6464
- "/v1/persons/.*/licences/conditions"
65+
- "/v1/persons/.*/person-responsible-officer"

src/main/resources/application-local-docker.yml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ authorisation:
3939
- "/v1/persons/.*/risks"
4040
- "/v1/persons/.*/reported-adjudications"
4141
- "/v1/persons/.*/case-notes"
42+
- "/v1/persons/.*/person-responsible-officer"
4243
- "/v1/epf/person-details/.*/.*"
4344
- "/health"
4445
- "/health/ping"

src/main/resources/application-local.yml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ authorisation:
4646
- "/v1/persons/.*/risks"
4747
- "/v1/persons/.*/reported-adjudications"
4848
- "/v1/persons/.*/case-notes"
49+
- "/v1/persons/.*/person-responsible-officer"
4950
- "/v1/epf/person-details/.*/.*"
5051
- "/health"
5152
- "/health/ping"

src/main/resources/application-test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ authorisation:
5757
- "/v1/persons/.*/adjudications"
5858
- "/v1/persons/.*/licences/conditions"
5959
- "/v1/persons/.*/case-notes"
60+
- "/v1/persons/.*/person-responsible-officer"
6061
- "/health"
6162
- "/health/ping"
6263
- "/health/readiness"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.smoke.person
2+
3+
import io.kotest.assertions.json.shouldEqualJson
4+
import io.kotest.core.spec.style.DescribeSpec
5+
import io.kotest.matchers.shouldBe
6+
import org.springframework.http.HttpStatus
7+
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.helpers.IntegrationAPIHttpClient
8+
import java.net.URLEncoder
9+
import java.nio.charset.StandardCharsets
10+
11+
class PersonResponsibleOfficerSmokeTest : DescribeSpec(
12+
{
13+
val hmppsId = "A1234AA"
14+
val encodedHmppsId = URLEncoder.encode(hmppsId, StandardCharsets.UTF_8)
15+
16+
val basePath = "v1/persons/$encodedHmppsId/person-responsible-officer"
17+
val httpClient = IntegrationAPIHttpClient()
18+
19+
it("returns the person responsible officer for a person") {
20+
val response = httpClient.performAuthorised(basePath)
21+
response.statusCode().shouldBe(HttpStatus.OK.value())
22+
response.body().shouldEqualJson(
23+
"""
24+
"data": {
25+
"prisonOffenderManager": {
26+
"forename": "Paul",
27+
"surname": "Reds",
28+
"prison": {
29+
"code": "PrisonCode1"
30+
}
31+
},
32+
"communityOffenderManager": {
33+
"name": {
34+
"forename": "Helen",
35+
"surname": "Miller"
36+
},
37+
"email": "helenemail@email.com",
38+
"telephoneNumber": "0987654321",
39+
"team": {
40+
"code": "PrisonCode2",
41+
"description": "Description",
42+
"email": "email_again@email.com",
43+
"telephoneNumber": "01234567890"
44+
}
45+
}
46+
}
47+
""".trimIndent(),
48+
)
49+
}
50+
},
51+
)

0 commit comments

Comments
 (0)