File tree 2 files changed +50
-1
lines changed
test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/smoke/person
2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ services:
12
12
probation-integration-epf :
13
13
base-url : http://probation-integration-epf-api:4010
14
14
adjudications :
15
- base-url : http://localhost :4010
15
+ base-url : http://adjudications-api :4010
16
16
hmpps-auth :
17
17
base-url : http://hmpps-auth:8080
18
18
Original file line number Diff line number Diff line change
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.extensions.removeWhitespaceAndNewlines
8
+ import uk.gov.justice.digital.hmpps.hmppsintegrationapi.helpers.IntegrationAPIHttpClient
9
+ import java.net.URLEncoder
10
+ import java.nio.charset.StandardCharsets
11
+
12
+ class AdjudicationsSmokeTest : DescribeSpec (
13
+ {
14
+ val hmppsId = " G2996UX"
15
+ val encodedHmppsId = URLEncoder .encode(hmppsId, StandardCharsets .UTF_8 )
16
+ val basePath = " v1/persons/$encodedHmppsId /reported-adjudications"
17
+ val httpClient = IntegrationAPIHttpClient ()
18
+
19
+ it("returns adjudications for a person") {
20
+ val response = httpClient.performAuthorised(basePath)
21
+
22
+ response.statusCode().shouldBe(HttpStatus .OK .value())
23
+ response.body().shouldEqualJson(
24
+ """
25
+ {
26
+ "data": [
27
+ {
28
+ "incidentDetails": {
29
+ "locationId": null,
30
+ "dateTimeOfIncident": "2021-07-05T10:35:17",
31
+ "dateTimeOfDiscovery": null,
32
+ "handoverDeadline": null
33
+ }
34
+ }
35
+ ],
36
+ "pagination": {
37
+ "isLastPage": true,
38
+ "count": 1,
39
+ "page": 1,
40
+ "perPage": 8,
41
+ "totalCount": 1,
42
+ "totalPages": 1
43
+ }
44
+ }
45
+ """.removeWhitespaceAndNewlines(),
46
+ )
47
+ }
48
+ },
49
+ )
You can’t perform that action at this time.
0 commit comments