File tree 1 file changed +48
-0
lines changed
src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/smoke/person
1 file changed +48
-0
lines changed 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 StatusInformationSmokeTest : DescribeSpec (
13
+ {
14
+ val hmppsId = " 2010/15229L"
15
+ val encodedHmppsId = URLEncoder .encode(hmppsId, StandardCharsets .UTF_8 )
16
+ val basePath = " v1/persons/$encodedHmppsId /status-information"
17
+ val httpClient = IntegrationAPIHttpClient ()
18
+
19
+ it("returns status information 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
+ "code": "ASFO ",
29
+ "description": "Serious Further Offence - Subject to SFO review/investigation",
30
+ "startDate": "2019-08-24",
31
+ "reviewDate": "2019-08-24",
32
+ "notes": "string"
33
+ }
34
+ ],
35
+ "pagination": {
36
+ "isLastPage": true,
37
+ "count": 3,
38
+ "page": 1,
39
+ "perPage": 10,
40
+ "totalCount": 3,
41
+ "totalPages": 1
42
+ }
43
+ }
44
+ """.removeWhitespaceAndNewlines(),
45
+ )
46
+ }
47
+ },
48
+ )
You can’t perform that action at this time.
0 commit comments