Skip to content

Commit 511ac42

Browse files
committed
PI-2517 - update integration tests
1 parent 85e033f commit 511ac42

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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 AlertsIntegrationTest : IntegrationTestBase() {
9+
final var path = "$basePath/$pnc/alerts"
10+
11+
@Test
12+
fun `returns alerts for a person`() {
13+
callApi(path)
14+
.andExpect(status().isOk)
15+
.andExpect(content().json(getExpectedResponse("person-alerts")))
16+
}
17+
18+
@Test
19+
fun `returns PND alerts for a person`() {
20+
callApi("$path/pnd")
21+
.andExpect(status().isOk)
22+
.andExpect(content().json(getExpectedResponse("person-alerts-pnd")))
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"data": [
3+
{
4+
"offenderNo": "G3878UK",
5+
"type": "X",
6+
"typeDescription": "Security",
7+
"code": "XER",
8+
"codeDescription": "Escape Risk",
9+
"comment": "Profession lock pick.",
10+
"dateCreated": "2019-08-20",
11+
"dateExpired": "2020-08-20",
12+
"expired": true,
13+
"active": false
14+
}
15+
],
16+
"pagination": {
17+
"isLastPage": true,
18+
"count": 1,
19+
"page": 1,
20+
"perPage": 10,
21+
"totalCount": 1,
22+
"totalPages": 1
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"data": [
3+
{
4+
"offenderNo": "G3878UK",
5+
"type": "X",
6+
"typeDescription": "Security",
7+
"code": "XER",
8+
"codeDescription": "Escape Risk",
9+
"comment": "Profession lock pick.",
10+
"dateCreated": "2019-08-20",
11+
"dateExpired": "2020-08-20",
12+
"expired": true,
13+
"active": false
14+
}
15+
],
16+
"pagination": {
17+
"isLastPage": true,
18+
"count": 1,
19+
"page": 1,
20+
"perPage": 10,
21+
"totalCount": 1,
22+
"totalPages": 1
23+
}
24+
}

0 commit comments

Comments
 (0)