Skip to content

Commit

Permalink
updated to return actual results from PLP
Browse files Browse the repository at this point in the history
  • Loading branch information
stevomcallister committed Dec 12, 2024
1 parent 1363411 commit 967ef23
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 207 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class PLPGateway(
val result =
webClient.request<ReviewSchedules>(
HttpMethod.GET,
"/inductions/$prisonerNumber/review-schedule",
"/action-plans/$prisonerNumber/reviews/review-schedules",
authenticationHeader(),
UpstreamApi.PLP,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,114 +24,4 @@ class PLPIntegrationTest : IntegrationTestBase() {
),
)
}

@Test
fun `returns a persons review schedule`() {
callApi("$basePath/K5995YZ/plp-review-schedule")
.andExpect(status().isOk)
.andExpect(
content().json(
"""
[
{
"reference": "91130fff-d6ce-4ead-8461-1507140a2ae0",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "COMPLETED",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.268Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:38.268Z",
"updatedAtPrison": "BXI",
"version": 4
},
{
"reference": "91130fff-d6ce-4ead-8461-1507140a2ae0",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "SCHEDULED",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.256Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:36.256Z",
"updatedAtPrison": "BXI",
"version": 3
},
{
"reference": "91130fff-d6ce-4ead-8461-1507140a2ae0",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "EXEMPT_PRISONER_DRUG_OR_ALCOHOL_DEPENDENCY",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.244Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:36.244Z",
"updatedAtPrison": "BXI",
"version": 2
},
{
"reference": "91130fff-d6ce-4ead-8461-1507140a2ae0",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "SCHEDULED",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.229Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:35.229Z",
"updatedAtPrison": "BXI",
"version": 1
},
{
"reference": "3eba9e8a-9144-408f-b4bf-2692aa4c2c97",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "COMPLETED",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.214Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:34.214Z",
"updatedAtPrison": "BXI",
"version": 2
},
{
"reference": "3eba9e8a-9144-408f-b4bf-2692aa4c2c97",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "SCHEDULED",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.087Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:33.086Z",
"updatedAtPrison": "BXI",
"version": 1
}
]
""",
),
)
}
}
114 changes: 18 additions & 96 deletions src/test/resources/expected-responses/plp-review-schedule
Original file line number Diff line number Diff line change
@@ -1,98 +1,20 @@
[
{
"reference": "91130fff-d6ce-4ead-8461-1507140a2ae0",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "COMPLETED",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.268Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:38.268Z",
"updatedAtPrison": "BXI",
"version": 4
},
{
"reference": "91130fff-d6ce-4ead-8461-1507140a2ae0",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "SCHEDULED",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.256Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:36.256Z",
"updatedAtPrison": "BXI",
"version": 3
},
{
"reference": "91130fff-d6ce-4ead-8461-1507140a2ae0",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "EXEMPT_PRISONER_DRUG_OR_ALCOHOL_DEPENDENCY",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.244Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:36.244Z",
"updatedAtPrison": "BXI",
"version": 2
},
{
"reference": "91130fff-d6ce-4ead-8461-1507140a2ae0",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "SCHEDULED",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.229Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:35.229Z",
"updatedAtPrison": "BXI",
"version": 1
},
{
"reference": "3eba9e8a-9144-408f-b4bf-2692aa4c2c97",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "COMPLETED",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.214Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:34.214Z",
"updatedAtPrison": "BXI",
"version": 2
},
{
"reference": "3eba9e8a-9144-408f-b4bf-2692aa4c2c97",
"reviewDateFrom": "2024-11-11",
"reviewDateTo": "2025-01-11",
"status": "SCHEDULED",
"calculationRule": "BETWEEN_12_AND_60_MONTHS_TO_SERVE",
"createdBy": "auser_gen",
"createdByDisplayName": "Albert User",
"createdAt": "2024-12-11T18:40:39.087Z",
"createdAtPrison": "BXI",
"updatedBy": "auser_gen",
"updatedByDisplayName": "Albert User",
"updatedAt": "2024-12-11T18:40:33.086Z",
"updatedAtPrison": "BXI",
"version": 1
"reviewSchedules": [
{
"createdBy": "asmith_gen",
"createdByDisplayName": "Alex Smith",
"createdAt": "2023-06-19T09:39:44Z",
"createdAtPrison": "BXI",
"updatedBy": "asmith_gen",
"updatedByDisplayName": "Alex Smith",
"updatedAt": "2023-06-19T09:39:44Z",
"updatedAtPrison": "BXI",
"reference": "c88a6c48-97e2-4c04-93b5-98619966447b",
"reviewDateFrom": "2023-11-19",
"reviewDateTo": "2023-12-19",
"status": "SCHEDULED",
"calculationRule": "PRISONER_READMISSION",
"version": 0
}
]
}
]

0 comments on commit 967ef23

Please sign in to comment.