Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pi 2510 migrate nomis number endpoint to conform to naming convention #487

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import uk.gov.justice.digital.hmpps.hmppsintegrationapi.services.GetHmppsIdServi
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.services.internal.AuditService

@RestController
@RequestMapping("/v1/hmpps-id")
@RequestMapping("/v1/hmpps/id")
@Tag(name = "default")
class HmppsIdController(
@Autowired val getHmppsIdService: GetHmppsIdService,
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ authorisation:
- "/v1/epf/person-details/.*/[^/]*$"
moj-pes:
- "/v1/persons/.*/name"
- "/v1/hmpps-id/nomis-number/[^/]*$"
- "/v1/hmpps/id/nomis-number/[^/]*$"
- "/v1/persons/.*/cell-location"
kubernetes-health-check-client:
- "/health/liveness"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ authorisation:
- "/v1/persons/.*/risk-management-plan"
- "/v1/persons/.*/cell-location"
- "/v1/epf/person-details/.*/[^/]*$"
- "/v1/hmpps-id/nomis-number/[^/]*$"
- "/v1/hmpps/id/nomis-number/[^/]*$"
- "/health"
- "/health/ping"
- "/health/readiness"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-local-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ authorisation:
- "/v1/persons/.*/risk-management-plan"
- "/v1/persons/.*/cell-location"
- "/v1/epf/person-details/.*/[^/]*$"
- "/v1/hmpps-id/nomis-number/[^/]*$"
- "/v1/hmpps/id/nomis-number/[^/]*$"
- "/health"
- "/health/ping"
- "/health/readiness"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ authorisation:
- "/v1/persons/.*/risk-management-plan"
- "/v1/persons/.*/cell-location"
- "/v1/epf/person-details/.*/[^/]*$"
- "/v1/hmpps-id/nomis-number/[^/]*$"
- "/v1/hmpps/id/nomis-number/[^/]*$"
- "/health"
- "/health/ping"
- "/health/readiness"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-preprod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ authorisation:
- "/v1/epf/person-details/.*/[^/]*$"
moj-pes:
- "/v1/persons/.*/name"
- "/v1/hmpps-id/nomis-number/[^/]*$"
- "/v1/hmpps/id/nomis-number/[^/]*$"
- "/v1/persons/.*/cell-location"
- "/v1/hmpps/reference-data"
kubernetes-health-check-client:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ authorisation:
- "/v1/epf/person-details/.*/[^/]*$"
moj-pes:
- "/v1/persons/.*/name"
- "/v1/hmpps-id/nomis-number/[^/]*$"
- "/v1/hmpps/id/nomis-number/[^/]*$"
- "/v1/persons/.*/cell-location"
- "/v1/hmpps/reference-data"
kubernetes-health-check-client:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ authorisation:
- "/v1/persons/.*/risk-management-plan"
- "/v1/persons/.*/cell-location"
- "/v1/persons/.*/status-information"
- "/v1/hmpps-id/nomis-number/[^/]*$"
- "/v1/hmpps/id/nomis-number/[^/]*$"
- "/health"
- "/health/ping"
- "/health/readiness"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal class HmppsIdControllerTest(
@MockBean val auditService: AuditService,
) : DescribeSpec({
val nomisNumber = "A1234AA"
val path = "/v1/hmpps-id/nomis-number/$nomisNumber"
val path = "/v1/hmpps/id/nomis-number/$nomisNumber"
val mockMvc = IntegrationAPIMockMvc(springMockMvc)

describe("GET $path") {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.integration

import org.junit.jupiter.api.Test
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.content
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status

class HmppsIdIntegrationTest : IntegrationTestBase() {
@Test
fun `gets the person detail`() {
callApi("/v1/hmpps/id/nomis-number/$nomsId")
.andExpect(status().isOk)
.andExpect(
content().json(
"""
{"data":{"hmppsId":"A123456"}}
""",
),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import uk.gov.justice.digital.hmpps.hmppsintegrationapi.integration.IntegrationT
class AddressIntegrationTest : IntegrationTestBase() {
@Test
fun `returns addresses for a person`() {
callApi("$basePath/pnc/addresses")
callApi("$basePath/$pnc/addresses")
.andExpect(status().isOk)
.andExpect(content().json(getExpectedResponse("person-addresses")))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import uk.gov.justice.digital.hmpps.hmppsintegrationapi.integration.IntegrationT
class LicenceConditionIntegrationTest : IntegrationTestBase() {
@Test
fun `returns alerts for a person`() {
callApi("$basePath/$crn/licences/conditions")
callApi("$basePath/$nomsId/licences/conditions")
.andExpect(status().isOk)
.andExpect(content().json(getExpectedResponse("person-licence-conditions")))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"data": {
"hmppsId": "ABC123",
"hmppsId": "G2996UX",
"offenderNumber": "A1234AA",
"licences": [
{
Expand Down