Skip to content

Commit c9d1ae7

Browse files
committed
PI-2517 - update integration tests
1 parent c5c60bc commit c9d1ae7

File tree

6 files changed

+93
-12
lines changed

6 files changed

+93
-12
lines changed

src/main/resources/application-integration-test.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ services:
1414
password: client-secret
1515
adjudications:
1616
base-url: http://localhost:4010
17-
prisoner-offender-search:
18-
base-url: http://localhost:4017
19-
probation-offender-search:
20-
base-url: http://localhost:4019
21-
ndelius:
22-
base-url: http://localhost:4015
2317
assess-risks-and-needs:
2418
base-url: http://localhost:4011
25-
probation-integration-epf:
26-
base-url: http://localhost:4005
27-
create-and-vary-licence:
28-
base-url: http://localhost:4013
2919
case-notes:
3020
base-url: http://localhost:4012
21+
create-and-vary-licence:
22+
base-url: http://localhost:4013
3123
manage-pom-case-api:
3224
base-url: http://localhost:4014
25+
ndelius:
26+
base-url: http://localhost:4015
27+
prisoner-offender-search:
28+
base-url: http://localhost:4017
29+
probation-integration-epf:
30+
base-url: http://localhost:4018
31+
probation-offender-search:
32+
base-url: http://localhost:4019
3333

3434
hmpps.sqs:
3535
provider: localstack
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.integration
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+
7+
class EPFPersonDetailIntegrationTest : IntegrationTestBase() {
8+
@Test
9+
fun `returns a person detail for a probation case, by HmppsID`() {
10+
callApi("/v1/epf/person-details/$crn/1234")
11+
.andExpect(status().isOk)
12+
.andExpect(content().json(getExpectedResponse("person-probation-information")))
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.integration
2+
3+
import org.junit.jupiter.params.ParameterizedTest
4+
import org.junit.jupiter.params.provider.ValueSource
5+
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.content
6+
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
7+
8+
class HealthCheckIntegrationTest : IntegrationTestBase() {
9+
@ParameterizedTest
10+
@ValueSource(strings = ["/health", "/health/ping", "/health/readiness"])
11+
fun `health check test`(path: String) {
12+
callApi(path)
13+
.andExpect(status().isOk)
14+
.andExpect(
15+
content().json(
16+
"""
17+
{"status":"UP"}
18+
""",
19+
),
20+
)
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.integration
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+
7+
class ImageIntegrationTest : IntegrationTestBase() {
8+
@Test
9+
fun `returns an image from NOMIS`() {
10+
callApi("/v1/images/2461788")
11+
.andExpect(status().isOk)
12+
.andExpect(content().contentType("image/jpeg"))
13+
}
14+
}

src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/integration/person/StatusInformationIntegrationTest.kt

-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
66
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.integration.IntegrationTestBase
77

88
class StatusInformationIntegrationTest : IntegrationTestBase() {
9-
109
@Test
1110
fun `returns status information for a person`() {
1211
callApi("$basePath/$pnc/status-information")
1312
.andExpect(status().isOk)
1413
.andExpect(content().json(getExpectedResponse("person-status-information")))
1514
}
16-
1715
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"data": {
3+
"nomsId": "string",
4+
"name": {
5+
"forename": "string",
6+
"middleName": "string",
7+
"surname": "string"
8+
},
9+
"dateOfBirth": "2019-08-24",
10+
"gender": "string",
11+
"courtAppearance": {
12+
"date": "2019-08-24",
13+
"court": {
14+
"name": "string"
15+
}
16+
},
17+
"sentence": {
18+
"date": null,
19+
"sentencingCourt": null,
20+
"releaseDate": null,
21+
"expectedReleaseDate": "2019-08-24"
22+
},
23+
"responsibleProvider": {
24+
"code": "string",
25+
"name": "string"
26+
},
27+
"ogrsScore": -9007199254740991,
28+
"rsrScore": -1.7976931348623157E308,
29+
"age": -9007199254740991,
30+
"ageAtRelease": -9007199254740991
31+
},
32+
"errors": []
33+
}

0 commit comments

Comments
 (0)