Skip to content

Commit c0a9eb4

Browse files
committed
PI-2517 - update integration tests
1 parent e4dd348 commit c0a9eb4

File tree

3 files changed

+168
-0
lines changed

3 files changed

+168
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.integration.person
2+
3+
import org.junit.jupiter.api.Test
4+
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.content
5+
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
6+
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.integration.IntegrationTestBase
7+
8+
class SentencesIntegrationTest : IntegrationTestBase() {
9+
10+
final var path = "$basePath/$pnc/sentences"
11+
12+
@Test
13+
fun `returns sentences for a person`() {
14+
callApi(path)
15+
.andExpect(status().isOk)
16+
.andExpect(content().json(getExpectedResponse("person-sentence")))
17+
}
18+
19+
@Test
20+
fun `returns latest sentence key dates and adjustments for a person`() {
21+
callApi("$path/latest-key-dates-and-adjustments")
22+
.andExpect(status().isOk)
23+
.andExpect(content().json(getExpectedResponse("person-sentence-key-dates")))
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"data": [
3+
{
4+
"serviceSource": "NOMIS",
5+
"systemSource": "PRISON_SYSTEMS",
6+
"dateOfSentencing": "2019-08-24",
7+
"description": "string",
8+
"isActive": null,
9+
"isCustodial": true,
10+
"fineAmount": -1.7976931348623157E308,
11+
"length": {
12+
"duration": null,
13+
"units": null,
14+
"terms": [
15+
{
16+
"years": 1,
17+
"months": 2,
18+
"weeks": 3,
19+
"days": 4,
20+
"hours": null,
21+
"prisonTermCode": "string"
22+
}
23+
]
24+
}
25+
},
26+
{
27+
"serviceSource": "NDELIUS",
28+
"systemSource": "PROBATION_SYSTEMS",
29+
"dateOfSentencing": "2019-08-24",
30+
"description": "string",
31+
"isActive": true,
32+
"isCustodial": false,
33+
"fineAmount": null,
34+
"length": {
35+
"duration": -2147483648,
36+
"units": "Hours",
37+
"terms": []
38+
}
39+
}
40+
],
41+
"pagination": {
42+
"isLastPage": true,
43+
"count": 2,
44+
"page": 1,
45+
"perPage": 10,
46+
"totalCount": 2,
47+
"totalPages": 1
48+
}
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"data": {
3+
"adjustments": {
4+
"additionalDaysAwarded": 12,
5+
"unlawfullyAtLarge": 12,
6+
"lawfullyAtLarge": 12,
7+
"restoredAdditionalDaysAwarded": 12,
8+
"specialRemission": 12,
9+
"recallSentenceRemand": 12,
10+
"recallSentenceTaggedBail": 12,
11+
"remand": 12,
12+
"taggedBail": 12,
13+
"unusedRemand": 12
14+
},
15+
"automaticRelease": {
16+
"date": "2020-02-03",
17+
"overrideDate": "2020-02-03"
18+
},
19+
"conditionalRelease": {
20+
"date": "2020-02-03",
21+
"overrideDate": "2020-02-03"
22+
},
23+
"dtoPostRecallRelease": {
24+
"date": "2020-02-03",
25+
"overrideDate": "2020-04-01"
26+
},
27+
"earlyTerm": {
28+
"date": "2020-02-03",
29+
"overrideDate": "2019-04-02",
30+
"calculatedDate": "2019-04-02"
31+
},
32+
"homeDetentionCurfew": {
33+
"actualDate": "2020-02-03",
34+
"eligibilityCalculatedDate": "2020-02-03",
35+
"eligibilityDate": "2020-02-03",
36+
"eligibilityOverrideDate": "2020-02-03",
37+
"endDate": "2019-04-01"
38+
},
39+
"lateTerm": {
40+
"date": "2020-02-03",
41+
"overrideDate": "2019-04-02",
42+
"calculatedDate": "2019-04-02"
43+
},
44+
"licenceExpiry": {
45+
"date": "2020-02-03",
46+
"overrideDate": "2020-02-03",
47+
"calculatedDate": "2020-02-03"
48+
},
49+
"midTerm": {
50+
"date": "2020-02-03",
51+
"overrideDate": "2019-04-02",
52+
"calculatedDate": "2019-04-02"
53+
},
54+
"nonDto": {
55+
"date": "2020-04-01",
56+
"releaseDateType": "ARD"
57+
},
58+
"nonParole": {
59+
"date": "2020-02-03",
60+
"overrideDate": "2020-02-03"
61+
},
62+
"paroleEligibility": {
63+
"date": "2020-02-03",
64+
"overrideDate": "2020-02-03",
65+
"calculatedDate": "2020-02-03"
66+
},
67+
"postRecallRelease": {
68+
"date": "2020-02-03",
69+
"overrideDate": "2020-04-01"
70+
},
71+
"release": {
72+
"date": "2020-04-01",
73+
"confirmedDate": "2020-04-20"
74+
},
75+
"sentence": {
76+
"effectiveEndDate": "2020-02-03",
77+
"expiryCalculatedDate": "2020-02-03",
78+
"expiryDate": "2020-02-03",
79+
"expiryOverrideDate": "2020-02-03",
80+
"startDate": "2010-02-03"
81+
},
82+
"topupSupervision": {
83+
"expiryCalculatedDate": "2020-02-03",
84+
"expiryDate": "2020-02-03",
85+
"expiryOverrideDate": "2020-02-03",
86+
"startDate": "2019-04-01"
87+
},
88+
"actualParoleDate": "2020-02-03",
89+
"earlyRemovalSchemeEligibilityDate": "2020-02-03",
90+
"releaseOnTemporaryLicenceDate": "2020-02-03",
91+
"tariffDate": "2020-02-03",
92+
"tariffEarlyRemovalSchemeEligibilityDate": "2020-02-03"
93+
}
94+
}

0 commit comments

Comments
 (0)