From 85c89b51e7279e8ef70d922a9bfd2adad506ae25 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Fri, 27 Feb 2026 22:39:58 +0000 Subject: [PATCH 01/39] court-list-data --- pom.xml | 2 +- .../progression/SearchCourtListDataIT.java | 49 +++++++ .../DefaultQueryApiCourtlistResource.java | 55 ++------ .../DefaultQueryApiCourtlistdataResource.java | 67 ++++++++++ .../QueryApiCourtlistdataResource.java | 33 +++++ .../query/api/CourtlistQueryApi.java | 10 ++ .../api/service/CourtlistQueryService.java | 77 +++++++++++ .../accesscontrol/query-access-control.drl | 18 +++ .../progression.search.court.list.data.json | 112 ++++++++++++++++ .../progression.search.court.list.data.json | 70 ++++++++++ .../src/raml/progression-query-api.raml | 51 ++++++++ .../DefaultQueryApiCourtlistResourceTest.java | 73 ++++------- ...aultQueryApiCourtlistdataResourceTest.java | 122 ++++++++++++++++++ 13 files changed, 645 insertions(+), 94 deletions(-) create mode 100644 progression-integration-test/src/test/java/uk/gov/moj/cpp/progression/SearchCourtListDataIT.java create mode 100644 progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResource.java create mode 100644 progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/QueryApiCourtlistdataResource.java create mode 100644 progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java create mode 100644 progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json create mode 100644 progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json create mode 100644 progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java diff --git a/pom.xml b/pom.xml index c94112bf05..28e3cad58c 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 17.0.72 1.0.6 6.4.1 - 17.103.124 + 17.103.125 17.0.125 17.0.144 17.0.37 diff --git a/progression-integration-test/src/test/java/uk/gov/moj/cpp/progression/SearchCourtListDataIT.java b/progression-integration-test/src/test/java/uk/gov/moj/cpp/progression/SearchCourtListDataIT.java new file mode 100644 index 0000000000..dd1825e0b7 --- /dev/null +++ b/progression-integration-test/src/test/java/uk/gov/moj/cpp/progression/SearchCourtListDataIT.java @@ -0,0 +1,49 @@ +package uk.gov.moj.cpp.progression; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; +import static uk.gov.moj.cpp.progression.helper.RestHelper.getJsonObject; +import static uk.gov.moj.cpp.progression.helper.RestHelper.pollForResponse; +import static uk.gov.moj.cpp.progression.helper.StubUtil.setupListingQueryStub; +import static uk.gov.moj.cpp.progression.helper.StubUtil.setupReferenceDataQueryCourtCenterDataByCourtNameStub; + +import javax.json.JsonObject; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +/** + * Integration tests for GET /courtlistdata (court list and prison court list data as JSON). + */ +public class SearchCourtListDataIT extends AbstractIT { + + @BeforeAll + public static void setUpClass() { + setupListingQueryStub(); + setupReferenceDataQueryCourtCenterDataByCourtNameStub(); + } + + @Test + public void shouldReturnCourtListDataAsJson() { + final String responseBody = pollForResponse( + "/courtlistdata?listId=STANDARD&courtCentreId=f8254db1-1683-483e-afb3-b87fde5a0a26&startDate=2022-07-12&endDate=2022-07-12&_=bc9153c0-8278-494e-8f72-d63973bab35f", + "application/vnd.progression.search.court.list.data+json"); + + final JsonObject json = getJsonObject(responseBody); + assertThat(json.getString("listType"), equalTo("public")); + assertThat(json.containsKey("courtCentreName"), equalTo(true)); + assertThat(json.containsKey("hearingDates"), equalTo(true)); + } + + @Test + public void shouldReturnPrisonCourtListDataAsJson() { + final String responseBody = pollForResponse( + "/courtlistdata?courtCentreId=f8254db1-1683-483e-afb3-b87fde5a0a26&startDate=2022-07-12&endDate=2022-07-12&_=bc9153c0-8278-494e-8f72-d63973bab35f", + "application/vnd.progression.search.prison.court.list.data+json"); + + final JsonObject json = getJsonObject(responseBody); + assertThat(json.containsKey("listType"), equalTo(true)); + assertThat(json.containsKey("courtCentreName"), equalTo(true)); + assertThat(json.containsKey("hearingDates"), equalTo(true)); + } +} diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResource.java b/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResource.java index ab0d6704dd..849ff0044e 100644 --- a/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResource.java +++ b/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResource.java @@ -1,18 +1,14 @@ package uk.gov.justice.api.resource; -import static java.util.Objects.nonNull; import static java.util.Optional.of; -import static java.util.UUID.randomUUID; import static javax.ws.rs.core.HttpHeaders.CONTENT_DISPOSITION; import static javax.ws.rs.core.HttpHeaders.CONTENT_TYPE; import static javax.ws.rs.core.Response.Status.FORBIDDEN; import static javax.ws.rs.core.Response.Status.OK; import static javax.ws.rs.core.Response.status; import static uk.gov.justice.services.core.interceptor.InterceptorContext.interceptorContextWithInput; -import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom; -import static uk.gov.justice.services.messaging.JsonEnvelope.metadataBuilder; -import uk.gov.justice.api.resource.service.ReferenceDataService; +import uk.gov.moj.cpp.progression.query.api.service.CourtlistQueryService; import uk.gov.justice.api.resource.service.StagingPubHubService; import uk.gov.justice.services.adapter.rest.mapping.ActionMapper; import uk.gov.justice.services.core.annotation.Adapter; @@ -32,9 +28,7 @@ import javax.ejb.Stateless; import javax.inject.Inject; import javax.inject.Named; -import javax.json.Json; import javax.json.JsonObject; -import javax.json.JsonObjectBuilder; import javax.json.JsonValue; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Context; @@ -80,6 +74,9 @@ public class DefaultQueryApiCourtlistResource implements QueryApiCourtlistResour @Inject private ServiceContextSystemUserProvider serviceContextSystemUserProvider; + @Inject + private CourtlistQueryService courtlistQueryService; + @Inject private InterceptorChainProcessor interceptorChainProcessor; @@ -89,9 +86,6 @@ public class DefaultQueryApiCourtlistResource implements QueryApiCourtlistResour @Inject private StagingPubHubService stagingPubHubService; - @Inject - private ReferenceDataService referenceDataService; - @Override public Response getCourtlist(final String courtCentreId, final String courtRoomId, final String listId, final String startDate, final String endDate, final boolean restricted, final UUID userId) { @@ -107,45 +101,14 @@ public Response getPrisonCourtlist(final String courtCentreId, final String cour } private Response getCourtListInternal(final String courtCentreId, final String courtRoomId, final String listId, final String startDate, final String endDate, final boolean restricted, final UUID userId, final String courtListAction) { - final JsonObjectBuilder payloadBuilder = Json.createObjectBuilder() - .add("courtCentreId", courtCentreId) - .add("listId", listId) - .add("startDate", startDate) - .add("endDate", endDate) - .add("restricted", restricted); - - if (nonNull(courtRoomId)) { - payloadBuilder.add("courtRoomId", courtRoomId); - } + final JsonEnvelope queryEnvelope = courtlistQueryService.buildCourtlistQueryEnvelope( + courtCentreId, courtRoomId, listId, startDate, endDate, restricted, userId, courtListAction); + final JsonEnvelope document = interceptorChainProcessor.process(interceptorContextWithInput(queryEnvelope)).get(); - final JsonEnvelope documentQuery = envelopeFrom( - metadataBuilder() - .withId(randomUUID()) - .withName(courtListAction) - .withUserId(userId.toString()) - .build(), - payloadBuilder.build()); - - final JsonEnvelope document = interceptorChainProcessor.process(interceptorContextWithInput(documentQuery)).get(); - - final JsonObjectBuilder standardListJsonObjectBuilder = Json.createObjectBuilder(); - - document - .payloadAsJsonObject() - .keySet() - .forEach(key -> standardListJsonObjectBuilder - .add(key, document.payloadAsJsonObject().get(key)) - ); - - final Optional courtCentreDataOptional = referenceDataService.getCourtCenterDataByCourtName(document, document.payloadAsJsonObject().getString("courtCentreName")); - if (courtCentreDataOptional.isPresent()) { - final JsonObject courtCentreData = courtCentreDataOptional.get(); - standardListJsonObjectBuilder.add("ouCode", courtCentreData.getJsonString("oucode")); - standardListJsonObjectBuilder.add("courtId", courtCentreData.getJsonString("id")); - } + final JsonObject enrichedPayload = courtlistQueryService.buildEnrichedPayload(document); if (!PRISON_COURT_LIST.equalsIgnoreCase(listId)) { - stagingPubHubService.publishStandardList(standardListJsonObjectBuilder.build(), userId); + stagingPubHubService.publishStandardList(enrichedPayload, userId); } return getDocumentContent(document); diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResource.java b/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResource.java new file mode 100644 index 0000000000..f07e826d89 --- /dev/null +++ b/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResource.java @@ -0,0 +1,67 @@ +package uk.gov.justice.api.resource; + +import static javax.ws.rs.core.Response.Status.FORBIDDEN; +import static javax.ws.rs.core.Response.ok; +import static javax.ws.rs.core.Response.status; +import static uk.gov.justice.services.core.interceptor.InterceptorContext.interceptorContextWithInput; + +import uk.gov.moj.cpp.progression.query.api.service.CourtlistQueryService; +import uk.gov.justice.services.core.annotation.Adapter; +import uk.gov.justice.services.core.annotation.Component; +import uk.gov.justice.services.core.interceptor.InterceptorChainProcessor; +import uk.gov.justice.services.messaging.JsonEnvelope; + +import java.util.UUID; + +import javax.ejb.Stateless; +import javax.inject.Inject; +import javax.json.JsonObject; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +/** + * Returns court list data as JSON. Same parameters and access control as /courtlist, + * but no PDF/Word generation and no pubhub. Shares logic with DefaultQueryApiCourtlistResource + * via CourtlistQueryService. + */ +@Stateless +@Adapter(Component.QUERY_API) +public class DefaultQueryApiCourtlistdataResource implements QueryApiCourtlistdataResource { + + private static final String PRISON_COURT_LIST = "PRISON"; + private static final String COURT_LIST_DATA_QUERY_NAME = "progression.search.court.list.data"; + private static final String PRISON_COURT_LIST_DATA_QUERY_NAME = "progression.search.prison.court.list.data"; + + @Inject + private CourtlistQueryService courtlistQueryService; + + @Inject + private InterceptorChainProcessor interceptorChainProcessor; + + @Override + public Response getCourtlistdata(final String courtCentreId, final String courtRoomId, final String listId, + final String startDate, final String endDate, final boolean restricted, final UUID userId) { + if (PRISON_COURT_LIST.equals(listId)) { + return status(FORBIDDEN).build(); + } + return getCourtlistdataInternal(courtCentreId, courtRoomId, listId, startDate, endDate, restricted, userId, COURT_LIST_DATA_QUERY_NAME); + } + + @Override + public Response getPrisonCourtlistdata(final String courtCentreId, final String courtRoomId, + final String startDate, final String endDate, final UUID userId) { + return getCourtlistdataInternal(courtCentreId, courtRoomId, PRISON_COURT_LIST, startDate, endDate, false, userId, PRISON_COURT_LIST_DATA_QUERY_NAME); + } + + private Response getCourtlistdataInternal(final String courtCentreId, final String courtRoomId, final String listId, + final String startDate, final String endDate, final boolean restricted, + final UUID userId, final String courtListAction) { + final JsonEnvelope queryEnvelope = courtlistQueryService.buildCourtlistQueryEnvelope( + courtCentreId, courtRoomId, listId, startDate, endDate, restricted, userId, courtListAction); + final JsonEnvelope document = interceptorChainProcessor.process(interceptorContextWithInput(queryEnvelope)).get(); + + final JsonObject enrichedPayload = courtlistQueryService.buildEnrichedPayload(document); + + return ok(enrichedPayload).type(MediaType.APPLICATION_JSON_TYPE).build(); + } +} diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/QueryApiCourtlistdataResource.java b/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/QueryApiCourtlistdataResource.java new file mode 100644 index 0000000000..72e12dd426 --- /dev/null +++ b/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/QueryApiCourtlistdataResource.java @@ -0,0 +1,33 @@ +package uk.gov.justice.api.resource; + +import uk.gov.justice.services.common.http.HeaderConstants; + +import java.util.UUID; + +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Response; + +@Path("courtlistdata") +public interface QueryApiCourtlistdataResource { + @GET + @Produces("application/vnd.progression.search.court.list.data+json") + Response getCourtlistdata(@QueryParam("courtCentreId") String courtCentreId, + @QueryParam("courtRoomId") String courtRoomId, + @QueryParam("listId") String listId, + @QueryParam("startDate") String startDate, + @QueryParam("endDate") String endDate, + @QueryParam("restricted") boolean restricted, + @HeaderParam(HeaderConstants.USER_ID) UUID userId); + + @GET + @Produces("application/vnd.progression.search.prison.court.list.data+json") + Response getPrisonCourtlistdata(@QueryParam("courtCentreId") String courtCentreId, + @QueryParam("courtRoomId") String courtRoomId, + @QueryParam("startDate") String startDate, + @QueryParam("endDate") String endDate, + @HeaderParam(HeaderConstants.USER_ID) UUID userId); +} diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java index d01753872d..b89a43b3c4 100644 --- a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java +++ b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java @@ -23,4 +23,14 @@ public JsonEnvelope searchCourtlist(final JsonEnvelope query) { public JsonEnvelope searchPrisonCourtlist(final JsonEnvelope query) { return courtlistQueryView.searchPrisonCourtlist(query); } + + @Handles("progression.search.court.list.data") + public JsonEnvelope searchCourtlistData(final JsonEnvelope query) { + return courtlistQueryView.searchCourtlist(query); + } + + @Handles("progression.search.prison.court.list.data") + public JsonEnvelope searchPrisonCourtlistData(final JsonEnvelope query) { + return courtlistQueryView.searchPrisonCourtlist(query); + } } diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java new file mode 100644 index 0000000000..12d928baba --- /dev/null +++ b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java @@ -0,0 +1,77 @@ +package uk.gov.moj.cpp.progression.query.api.service; + +import static java.util.Objects.nonNull; +import static java.util.UUID.randomUUID; +import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom; +import static uk.gov.justice.services.messaging.JsonEnvelope.metadataBuilder; + +import uk.gov.justice.api.resource.service.ReferenceDataService; +import uk.gov.justice.services.messaging.JsonEnvelope; +import uk.gov.justice.services.messaging.MetadataBuilder; + +import java.util.UUID; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.json.Json; +import javax.json.JsonObject; +import javax.json.JsonObjectBuilder; + +/** + * Shared service for court list query: builds the query envelope and enriches the payload with court centre data. + * The interceptor chain is invoked by the adapter resources (which have the component annotation). + * Used by both /courtlist (PDF/Word + pubhub) and /courtlistdata (JSON only). + */ +@ApplicationScoped +public class CourtlistQueryService { + + @Inject + private ReferenceDataService referenceDataService; + + /** + * Builds the court list query envelope. The caller (adapter resource) must run it through the interceptor chain. + */ + public JsonEnvelope buildCourtlistQueryEnvelope(final String courtCentreId, final String courtRoomId, + final String listId, final String startDate, final String endDate, + final boolean restricted, final UUID userId, final String courtListAction) { + final JsonObjectBuilder payloadBuilder = Json.createObjectBuilder() + .add("courtCentreId", courtCentreId) + .add("listId", listId) + .add("startDate", startDate) + .add("endDate", endDate) + .add("restricted", restricted); + + if (nonNull(courtRoomId)) { + payloadBuilder.add("courtRoomId", courtRoomId); + } + + MetadataBuilder metadataBuilder = metadataBuilder() + .withId(randomUUID()) + .withName(courtListAction); + if (nonNull(userId)) { + metadataBuilder = metadataBuilder.withUserId(userId.toString()); + } + return envelopeFrom(metadataBuilder.build(), payloadBuilder.build()); + } + + /** + * Builds a JSON payload from the document, enriched with court centre data (ouCode, courtId) + * when available from reference data. + */ + public JsonObject buildEnrichedPayload(final JsonEnvelope document) { + final JsonObjectBuilder builder = Json.createObjectBuilder(); + document.payloadAsJsonObject().keySet().forEach(key -> + builder.add(key, document.payloadAsJsonObject().get(key))); + + final String courtCentreName = document.payloadAsJsonObject().getString("courtCentreName", null); + if (courtCentreName != null) { + referenceDataService.getCourtCenterDataByCourtName(document, courtCentreName) + .ifPresent(courtCentreData -> { + builder.add("ouCode", courtCentreData.getJsonString("oucode")); + builder.add("courtId", courtCentreData.getJsonString("id")); + }); + } + + return builder.build(); + } +} diff --git a/progression-query/progression-query-api/src/main/resources/uk/gov/moj/cpp/progression/query/api/accesscontrol/query-access-control.drl b/progression-query/progression-query-api/src/main/resources/uk/gov/moj/cpp/progression/query/api/accesscontrol/query-access-control.drl index 5bb221be87..f8f7ea31fa 100644 --- a/progression-query/progression-query-api/src/main/resources/uk/gov/moj/cpp/progression/query/api/accesscontrol/query-access-control.drl +++ b/progression-query/progression-query-api/src/main/resources/uk/gov/moj/cpp/progression/query/api/accesscontrol/query-access-control.drl @@ -615,6 +615,24 @@ rule "Query - API - progression.search.prison.court.list" $outcome.setSuccess(true); end +rule "Query - API - progression.search.court.list.data" + when + $outcome: Outcome(); + $action: Action(name == "progression.search.court.list.data"); + eval(userAndGroupProvider.isMemberOfAnyOfTheSuppliedGroups($action, "Listing Officers", "Court Clerks", "Legal Advisers", "Crown Court Admin", "Court Administrators", "Youth Offending Service Admin", "CPS", "Probation Admin", "Victims & Witness Care Admin", "Police Admin", "Court Associate", "Non CPS Prosecutors")); + then + $outcome.setSuccess(true); +end + +rule "Query - API - progression.search.prison.court.list.data" + when + $outcome: Outcome(); + $action: Action(name == "progression.search.prison.court.list.data"); + eval(userAndGroupProvider.isMemberOfAnyOfTheSuppliedGroups($action, "Prison Admin", "Listing Officers", "Legal Advisers", "Court Clerks", "CTSC Admin", "Operational Delivery Admin")); + then + $outcome.setSuccess(true); +end + rule "Command - Rule for query pet" when $outcome: Outcome(); diff --git a/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json b/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json new file mode 100644 index 0000000000..71e3acc2ef --- /dev/null +++ b/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json @@ -0,0 +1,112 @@ +{ + "listType": "public", + "courtCentreName": "Lavender Hill Magistrates' Court", + "courtCentreAddress1": "176A Lavender Hill London", + "courtCentreAddress2": " SW11 1JU", + "welshCourtCentreName": "Llys Ynadon Lavender Hill", + "welshCourtCentreAddress1": " ", + "welshCourtCentreAddress2": " SW11 1JU", + "hearingDates": [ + { + "hearingDate": "2022-04-07", + "hearingDateWelsh": "7 Ebrill 2022", + "courtRooms": [ + { + "courtRoomName": "Courtroom 01", + "welshCourtRoomName": "Courtroom 01", + "judiciaryNames": "Miss Atkins JP, Mrs Colman, District Judge (MC) Daber", + "welshJudiciaryNames": "Atkins, Mrs Colman, Daber", + "timeslots": [ + { + "hearings": [ + { + "id": "1a0f21ad-d9dc-4e42-9fb3-da2c5de0d7c2", + "sequence": 1, + "reportingRestrictionReason": "", + "welshReportingRestrictionReason": "", + "startTime": "10:00", + "hearingType": "First hearing", + "welshHearingType": "Gwrandawiad Cyntaf", + "caseNumber": "38GD1087222", + "caseId": "f0ea8a39-a9b7-4298-9d45-3cd2f64fcddc", + "prosecutorType": "CITYPF", + "defendants": [ + { + "id": "4e652c88-6efa-49b1-84a9-dc5b6aac5b64", + "organisationName": "", + "firstName": "Kiana", + "surname": "Hammes", + "dateOfBirth": "6 Feb 1980", + "age": "42", + "nationality": "", + "address": { + "address1": "Address line 1", + "address2": "Address line 2", + "address3": "Address line 3", + "address4": "Address line 4", + "address5": "West Keelymouth", + "postcode": "TW14 9XD" + }, + "reportingRestrictions": [], + "offences": [ + { + "id": "9e3cdd89-0fd6-4bc3-9a5c-5e82f8658899", + "offenceTitle": "Use / install a television set without a licence", + "welshOffenceTitle": "Defnyddio / gosod set deledu heb drwydded", + "offenceWording": "From 8 March 2022, used a television receiver without a licence." + } + ] + } + ], + "adjournedHearingDate": "", + "panel": "ADULT" + }, + { + "id": "26018ad1-dbb1-47ee-a3cb-425fd2d5b7ee", + "sequence": 2, + "reportingRestrictionReason": "", + "welshReportingRestrictionReason": "", + "startTime": "10:00", + "hearingType": "First hearing", + "welshHearingType": "Gwrandawiad Cyntaf", + "caseNumber": "63GD6903522", + "caseId": "a848c547-9993-46f8-bd99-6b8690cde6d9", + "prosecutorType": "CITYPF", + "defendants": [ + { + "id": "707f81d2-d519-48d1-a94f-8f0acd72112b", + "organisationName": "", + "firstName": "Yessenia", + "surname": "Marks", + "dateOfBirth": "27 Aug 1989", + "age": "32", + "nationality": "", + "address": { + "address1": "Address line 1", + "address2": "Address line 2", + "postcode": "TW14 9XD" + }, + "reportingRestrictions": [], + "offences": [ + { + "id": "c524ac7b-d923-4502-a644-ca6220601c77", + "offenceTitle": "Use / install a television set without a licence", + "offenceWording": "From 8 March 2022, used a television receiver without a licence." + } + ] + } + ], + "adjournedHearingDate": "", + "panel": "ADULT" + } + ] + } + ] + } + ] + } + ], + "templateName": "PublicCourtList", + "ouCode": "B01LY00", + "courtId": "f8254db1-1683-483e-afb3-b87fde5a0a26" +} diff --git a/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json b/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json new file mode 100644 index 0000000000..f4f71b7cca --- /dev/null +++ b/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json @@ -0,0 +1,70 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "http://justice.gov.uk/courts/progression/search/court.list.data.json", + "type": "object", + "description": "Court list data payload (same structure as court list document payload, with optional ouCode and courtId from reference data)", + "required": ["listType", "courtCentreName", "hearingDates"], + "properties": { + "listType": { + "type": "string", + "description": "Type of list e.g. public, ushers_crown, ushers_magistrate" + }, + "courtCentreName": { + "type": "string", + "description": "Name of the court centre" + }, + "courtCentreAddress1": { "type": "string" }, + "courtCentreAddress2": { "type": "string" }, + "welshCourtCentreName": { "type": "string" }, + "welshCourtCentreAddress1": { "type": "string" }, + "welshCourtCentreAddress2": { "type": "string" }, + "hearingDates": { + "type": "array", + "description": "Hearing dates with court rooms, time slots and hearings", + "items": { + "type": "object", + "properties": { + "hearingDate": { "type": "string" }, + "hearingDateWelsh": { "type": "string" }, + "courtRooms": { + "type": "array", + "items": { + "type": "object", + "properties": { + "courtRoomName": { "type": "string" }, + "welshCourtRoomName": { "type": "string" }, + "judiciaryNames": { "type": "string" }, + "welshJudiciaryNames": { "type": "string" }, + "timeslots": { + "type": "array", + "items": { + "type": "object", + "properties": { + "hearings": { + "type": "array", + "items": { "type": "object" } + } + } + } + } + } + } + } + } + } + }, + "templateName": { + "type": "string", + "description": "Document template name (e.g. PublicCourtList, UshersMagistrateList)" + }, + "ouCode": { + "type": "string", + "description": "Organisation unit code from reference data (when available)" + }, + "courtId": { + "type": "string", + "description": "Court centre UUID from reference data (when available)", + "format": "uuid" + } + } +} diff --git a/progression-query/progression-query-api/src/raml/progression-query-api.raml b/progression-query/progression-query-api/src/raml/progression-query-api.raml index 5e646ff082..625e018db9 100644 --- a/progression-query/progression-query-api/src/raml/progression-query-api.raml +++ b/progression-query/progression-query-api/src/raml/progression-query-api.raml @@ -1467,6 +1467,57 @@ protocols: [ HTTP, HTTPS ] body: application/vnd.progression.search.court.list+json: + +/courtlistdata: + description: get court list data as JSON (same parameters as /courtlist, no document generation or pubhub) + get: + description: | + Returns the court list payload as JSON. Same query parameters and access control as /courtlist. + ... + (mapping): + responseType: application/vnd.progression.search.court.list.data+json + name: progression.search.court.list.data + (mapping): + responseType: application/vnd.progression.search.prison.court.list.data+json + name: progression.search.prison.court.list.data + ... + queryParameters: + courtCentreId: + description: reference data id for the court centre + type: string + required: true + courtRoomId: + description: reference data id for the court room + type: string + required: false + listId: + description: court list name ( e.g. PUBLIC, STANDARD, ALPHABETICAL, USHERS_CROWN, USHERS_MAGISTRATE, ONLINE_PUBLIC) + type: string + required: true + startDate: + description: hearing start date in format 'YYYY-MM-DD'. + type: date + required: true + endDate: + description: hearing end date in format 'YYYY-MM-DD' + type: date + required: true + restricted: + description: only applicable for standard courtlist. Set true to get restricted standard court list + type: boolean + required: false + default: false + responses: + 200: + body: + application/vnd.progression.search.court.list.data+json: + example: !include json/progression.search.court.list.data.json + schema: !include json/schema/progression.search.court.list.data.json + application/vnd.progression.search.prison.court.list.data+json: + example: !include json/progression.search.court.list.data.json + schema: !include json/schema/progression.search.court.list.data.json + + /prosecutioncases/{prosecutionCaseId}/cotr-details-prosecutioncase: uriParameters: prosecutionCaseId: diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResourceTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResourceTest.java index f3943ba290..b324b21772 100644 --- a/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResourceTest.java +++ b/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResourceTest.java @@ -1,8 +1,6 @@ package uk.gov.justice.api.resource; import static com.jayway.jsonpath.matchers.JsonPathMatchers.withJsonPath; -import static java.util.Optional.of; -import static java.util.Optional.ofNullable; import static java.util.UUID.randomUUID; import static javax.ws.rs.core.HttpHeaders.CONTENT_DISPOSITION; import static javax.ws.rs.core.HttpHeaders.CONTENT_TYPE; @@ -10,12 +8,13 @@ import static org.apache.http.HttpStatus.SC_OK; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.any; -import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; +import static java.util.Optional.of; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.mockito.hamcrest.MockitoHamcrest.argThat; @@ -25,16 +24,14 @@ import static uk.gov.justice.api.resource.DefaultQueryApiCourtlistResource.WORD_DISPOSITION; import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom; import static uk.gov.justice.services.test.utils.core.matchers.JsonEnvelopeMatcher.jsonEnvelope; -import static uk.gov.justice.services.test.utils.core.matchers.JsonEnvelopeMetadataMatcher.metadata; import static uk.gov.justice.services.test.utils.core.matchers.JsonEnvelopePayloadMatcher.payload; import static uk.gov.justice.services.test.utils.core.messaging.MetadataBuilderFactory.metadataWithRandomUUID; import static uk.gov.justice.services.test.utils.core.random.RandomGenerator.STRING; -import uk.gov.justice.api.resource.service.ReferenceDataService; +import uk.gov.justice.services.core.interceptor.InterceptorChainProcessor; +import uk.gov.moj.cpp.progression.query.api.service.CourtlistQueryService; import uk.gov.justice.api.resource.service.StagingPubHubService; import uk.gov.justice.api.resource.utils.FileUtil; -import uk.gov.justice.services.core.interceptor.InterceptorChainProcessor; -import uk.gov.justice.services.core.interceptor.InterceptorContext; import uk.gov.justice.services.core.requester.Requester; import uk.gov.justice.services.messaging.JsonEnvelope; import uk.gov.moj.cpp.system.documentgenerator.client.DocumentGeneratorClient; @@ -81,13 +78,13 @@ public class DefaultQueryApiCourtlistResourceTest { private final String endDate = STRING.next(); @Mock - private InterceptorChainProcessor interceptorChainProcessor; + private CourtlistQueryService courtlistQueryService; @Mock - private StagingPubHubService stagingPubHubService; + private InterceptorChainProcessor interceptorChainProcessor; @Mock - private ReferenceDataService referenceDataService; + private StagingPubHubService stagingPubHubService; @Mock private ServiceContextSystemUserProvider serviceContextSystemUserProvider; @@ -98,9 +95,6 @@ public class DefaultQueryApiCourtlistResourceTest { @Mock private DocumentGeneratorClient documentGeneratorClient; - @Captor - private ArgumentCaptor interceptorContextCaptor; - @InjectMocks private DefaultQueryApiCourtlistResource defaultQueryApiCourtlistResource; @@ -130,14 +124,15 @@ public void shouldRunAllInterceptorsAndFetchAndStreamDocument() throws IOExcepti when(serviceContextSystemUserProvider.getContextSystemUserId()).thenReturn(Optional.of(systemUserId)); - when(interceptorChainProcessor.process(argThat((any(InterceptorContext.class))))).thenReturn(ofNullable(interceptorResponse)); + when(courtlistQueryService.buildCourtlistQueryEnvelope(any(), any(), any(), any(), any(), anyBoolean(), any(), any())) + .thenReturn(envelopeFrom(metadataWithRandomUUID(COURT_LIST_QUERY_NAME), FileUtil.jsonFromPath("stub-data/progression.search.court.list.json"))); + when(interceptorChainProcessor.process(any())).thenReturn(of(interceptorResponse)); + when(courtlistQueryService.buildEnrichedPayload(interceptorResponse)) + .thenReturn(FileUtil.jsonFromPath("stub-data/stagingpubhub.command.publish-standard-list.json")); when(documentGeneratorClientProducer.documentGeneratorClient()).thenReturn(documentGeneratorClient); assert interceptorResponse != null; when(documentGeneratorClient.generatePdfDocument(eq(interceptorResponse.payloadAsJsonObject()), anyString(), eq(systemUserId))) .thenReturn(documentGeneratorClientResponse); - when(referenceDataService.getCourtCenterDataByCourtName(argThat(any(JsonEnvelope.class)), anyString())) - .thenReturn(of(FileUtil.jsonFromPath("stub-data/referencedata.query.ou.courtrooms.ou-courtroom-name.json"))); - final Response actual = defaultQueryApiCourtlistResource .getCourtlist(courtCentreId.toString(), courtRoomId.toString(), listId.toString(), @@ -147,11 +142,7 @@ public void shouldRunAllInterceptorsAndFetchAndStreamDocument() throws IOExcepti assertThat(actual.getStatus(), is(SC_OK)); assertThat(actual.getHeaders(), is(headers)); assertThat(pdfContent.getBytes(), is(IOUtils.toByteArray(inputStream))); - verifyInterceptorChainExecution(); - - verify(referenceDataService).getCourtCenterDataByCourtName(envelopeArgumentCaptor.capture(), stringArgumentCaptor.capture()); - assertEquals("Lavender Hill Magistrates' Court", stringArgumentCaptor.getValue()); - assertEquals(interceptorResponse.payloadAsJsonObject(), envelopeArgumentCaptor.getValue().payloadAsJsonObject()); + verifyCourtlistQueryServiceExecution(); verify(stagingPubHubService).publishStandardList(jsonObjectArgumentCaptor.capture(), uuidArgumentCaptor.capture()); @@ -170,14 +161,15 @@ public void shouldRunAllInterceptorsAndFetchAndStreamDocumentForWord() throws IO final MultivaluedMap headers = new MultivaluedHashMap<>(ImmutableMap.of(CONTENT_TYPE, WORD_CONTENT_TYPE, CONTENT_DISPOSITION, WORD_DISPOSITION)); when(serviceContextSystemUserProvider.getContextSystemUserId()).thenReturn(Optional.of(systemUserId)); - when(interceptorChainProcessor.process(argThat((any(InterceptorContext.class))))).thenReturn(ofNullable(interceptorResponse)); + when(courtlistQueryService.buildCourtlistQueryEnvelope(any(), any(), any(), any(), any(), anyBoolean(), any(), any())) + .thenReturn(envelopeFrom(metadataWithRandomUUID(COURT_LIST_QUERY_NAME), FileUtil.jsonFromPath("stub-data/progression.search.usher.list.json"))); + when(interceptorChainProcessor.process(any())).thenReturn(of(interceptorResponse)); + when(courtlistQueryService.buildEnrichedPayload(interceptorResponse)) + .thenReturn(FileUtil.jsonFromPath("stub-data/stagingpubhub.command.ushers-standard-list.json")); when(documentGeneratorClientProducer.documentGeneratorClient()).thenReturn(documentGeneratorClient); assert interceptorResponse != null; when(documentGeneratorClient.generateWordDocument(eq(interceptorResponse.payloadAsJsonObject()), anyString(), eq(systemUserId))) .thenReturn(documentGeneratorClientResponse); - when(referenceDataService.getCourtCenterDataByCourtName(argThat(any(JsonEnvelope.class)), anyString())) - .thenReturn(of(FileUtil.jsonFromPath("stub-data/referencedata.query.ou.courtrooms.ou-courtroom-name.json"))); - final Response actual = defaultQueryApiCourtlistResource .getCourtlist(courtCentreId.toString(), courtRoomId.toString(), listId.toString(), @@ -187,11 +179,7 @@ public void shouldRunAllInterceptorsAndFetchAndStreamDocumentForWord() throws IO assertThat(actual.getStatus(), is(SC_OK)); assertThat(actual.getHeaders(), is(headers)); assertThat(wordContent.getBytes(), is(IOUtils.toByteArray(inputStream))); - verifyInterceptorChainExecution(); - - verify(referenceDataService).getCourtCenterDataByCourtName(envelopeArgumentCaptor.capture(), stringArgumentCaptor.capture()); - assertEquals("Lavender Hill Magistrates' Court", stringArgumentCaptor.getValue()); - assertEquals(interceptorResponse.payloadAsJsonObject(), envelopeArgumentCaptor.getValue().payloadAsJsonObject()); + verifyCourtlistQueryServiceExecution(); verify(stagingPubHubService).publishStandardList(jsonObjectArgumentCaptor.capture(), uuidArgumentCaptor.capture()); @@ -214,21 +202,12 @@ public void shouldErrorWhenCourtListCalledForPrisonList() { assertThat(courtlistResponse.getStatus(), is(FORBIDDEN.getStatusCode())); } - private void verifyInterceptorChainExecution() { - verify(interceptorChainProcessor).process(interceptorContextCaptor.capture()); - - assertThat(interceptorContextCaptor.getValue().inputEnvelope(), jsonEnvelope(metadata() - .withName(COURT_LIST_QUERY_NAME) - .withUserId(userId.toString()), - payload().isJson(allOf( - withJsonPath("$.courtCentreId", equalTo(courtCentreId.toString())), - withJsonPath("$.listId", equalTo(listId.toString())), - withJsonPath("$.courtRoomId", equalTo(courtRoomId.toString())), - withJsonPath("$.startDate", equalTo(startDate)), - withJsonPath("$.endDate", equalTo(endDate)), - withJsonPath("$.restricted", equalTo(false)) - )) - )); + private void verifyCourtlistQueryServiceExecution() { + verify(courtlistQueryService).buildCourtlistQueryEnvelope( + eq(courtCentreId.toString()), eq(courtRoomId.toString()), eq(listId.toString()), + eq(startDate), eq(endDate), eq(false), eq(userId), eq(COURT_LIST_QUERY_NAME)); + verify(interceptorChainProcessor).process(org.mockito.ArgumentMatchers.any()); + verify(courtlistQueryService).buildEnrichedPayload(org.mockito.ArgumentMatchers.any(JsonEnvelope.class)); } } \ No newline at end of file diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java new file mode 100644 index 0000000000..19129a4383 --- /dev/null +++ b/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java @@ -0,0 +1,122 @@ +package uk.gov.justice.api.resource; + +import static javax.ws.rs.core.Response.Status.FORBIDDEN; +import static org.apache.http.HttpStatus.SC_OK; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; +import static java.util.Optional.of; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom; +import static uk.gov.justice.services.test.utils.core.messaging.MetadataBuilderFactory.metadataWithRandomUUID; +import static uk.gov.justice.services.test.utils.core.random.RandomGenerator.STRING; + +import uk.gov.justice.api.resource.utils.FileUtil; +import uk.gov.justice.services.core.interceptor.InterceptorChainProcessor; +import uk.gov.justice.services.messaging.JsonEnvelope; +import uk.gov.moj.cpp.progression.query.api.service.CourtlistQueryService; + +import java.util.UUID; + +import javax.json.JsonObject; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +/** + * Integration tests for GET /courtlistdata (standard and prison list data as JSON). + */ +@ExtendWith(MockitoExtension.class) +public class DefaultQueryApiCourtlistdataResourceTest { + + private static final String COURT_LIST_DATA_QUERY_NAME = "progression.search.court.list.data"; + private static final String PRISON_COURT_LIST = "PRISON"; + private static final String PRISON_COURT_LIST_DATA_QUERY_NAME = "progression.search.prison.court.list.data"; + + private final UUID userId = UUID.randomUUID(); + private final String courtCentreId = UUID.randomUUID().toString(); + private final String courtRoomId = UUID.randomUUID().toString(); + private final String listId = "PUBLIC"; + private final String startDate = STRING.next(); + private final String endDate = STRING.next(); + + @Mock + private CourtlistQueryService courtlistQueryService; + + @Mock + private InterceptorChainProcessor interceptorChainProcessor; + + @InjectMocks + private DefaultQueryApiCourtlistdataResource defaultQueryApiCourtlistdataResource; + + @Test + public void shouldReturnCourtListDataAsJsonWhenGetCourtlistdata() { + final JsonEnvelope interceptorResponse = envelopeFrom( + metadataWithRandomUUID(COURT_LIST_DATA_QUERY_NAME), + FileUtil.jsonFromPath("stub-data/progression.search.court.list.json")); + final JsonObject enrichedPayload = FileUtil.jsonFromPath("stub-data/stagingpubhub.command.publish-standard-list.json"); + + when(courtlistQueryService.buildCourtlistQueryEnvelope(any(), any(), any(), any(), any(), anyBoolean(), any(), any())) + .thenReturn(envelopeFrom(metadataWithRandomUUID(COURT_LIST_DATA_QUERY_NAME), FileUtil.jsonFromPath("stub-data/progression.search.court.list.json"))); + when(interceptorChainProcessor.process(any())).thenReturn(of(interceptorResponse)); + when(courtlistQueryService.buildEnrichedPayload(interceptorResponse)) + .thenReturn(enrichedPayload); + + final Response response = defaultQueryApiCourtlistdataResource.getCourtlistdata( + courtCentreId, courtRoomId, listId, startDate, endDate, false, userId); + + assertThat(response.getStatus(), is(SC_OK)); + assertThat(response.getMediaType(), is(MediaType.APPLICATION_JSON_TYPE)); + assertEquals(enrichedPayload, response.getEntity()); + + verify(courtlistQueryService).buildCourtlistQueryEnvelope( + eq(courtCentreId), eq(courtRoomId), eq(listId), eq(startDate), eq(endDate), + eq(false), eq(userId), eq(COURT_LIST_DATA_QUERY_NAME)); + verify(interceptorChainProcessor).process(org.mockito.ArgumentMatchers.any()); + verify(courtlistQueryService).buildEnrichedPayload(interceptorResponse); + } + + @Test + public void shouldReturnForbiddenWhenGetCourtlistdataWithPrisonListId() { + final Response response = defaultQueryApiCourtlistdataResource.getCourtlistdata( + courtCentreId, courtRoomId, "PRISON", startDate, endDate, false, userId); + + assertThat(response.getStatus(), is(FORBIDDEN.getStatusCode())); + } + + @Test + public void shouldReturnPrisonCourtListDataAsJsonWhenGetPrisonCourtlistdata() { + final JsonEnvelope interceptorResponse = envelopeFrom( + metadataWithRandomUUID(PRISON_COURT_LIST_DATA_QUERY_NAME), + FileUtil.jsonFromPath("stub-data/progression.search.usher.list.json")); + final JsonObject enrichedPayload = FileUtil.jsonFromPath("stub-data/stagingpubhub.command.ushers-standard-list.json"); + + when(courtlistQueryService.buildCourtlistQueryEnvelope(any(), any(), any(), any(), any(), anyBoolean(), any(), any())) + .thenReturn(envelopeFrom(metadataWithRandomUUID(PRISON_COURT_LIST_DATA_QUERY_NAME), FileUtil.jsonFromPath("stub-data/progression.search.usher.list.json"))); + when(interceptorChainProcessor.process(any())).thenReturn(of(interceptorResponse)); + when(courtlistQueryService.buildEnrichedPayload(interceptorResponse)) + .thenReturn(enrichedPayload); + + final Response response = defaultQueryApiCourtlistdataResource.getPrisonCourtlistdata( + courtCentreId, courtRoomId, startDate, endDate, userId); + + assertThat(response.getStatus(), is(SC_OK)); + assertThat(response.getMediaType(), is(MediaType.APPLICATION_JSON_TYPE)); + assertEquals(enrichedPayload, response.getEntity()); + + verify(courtlistQueryService).buildCourtlistQueryEnvelope( + eq(courtCentreId), eq(courtRoomId), eq(PRISON_COURT_LIST), eq(startDate), eq(endDate), + eq(false), eq(userId), eq(PRISON_COURT_LIST_DATA_QUERY_NAME)); + verify(interceptorChainProcessor).process(org.mockito.ArgumentMatchers.any()); + verify(courtlistQueryService).buildEnrichedPayload(interceptorResponse); + } +} From 14ceab4f9c746f781c05608506f1e5a1dafc5e9c Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Fri, 27 Feb 2026 22:43:11 +0000 Subject: [PATCH 02/39] court-list-data --- pom.xml | 4 ++-- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- .../progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 30 insertions(+), 30 deletions(-) diff --git a/pom.xml b/pom.xml index c94112bf05..9c69cb0799 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT pom Progression services application @@ -65,7 +65,7 @@ 17.0.72 1.0.6 6.4.1 - 17.103.124 + 17.103.125 17.0.125 17.0.144 17.0.37 diff --git a/progression-command/pom.xml b/progression-command/pom.xml index a5b1084548..a2e4aaf454 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index 53530db411..5f718fe42b 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index ee31133b50..3a405ff7e1 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index 75c4e9df73..f8ce693695 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index 33f99a7c0c..85475b92cf 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 85b8026b65..54e141ed4f 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index 17aa75adc9..50a0c801f2 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index 401f5199bb..2664ff12b7 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index 0565d271bb..c341026c1a 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index bfd3f502e2..ac77cd1c44 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index 9fc9449f8a..2d76ba4e5c 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index 82cb78b419..f732d14a23 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index c70a25a252..6156c07a44 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index 355be8ed5a..c2caa96f44 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index 91b6f0ab76..af9c996894 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index 7852524cc3..427f089ee7 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index 2e5c378657..e87698f787 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index 78bd7bb416..e1d8aef276 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index 9e183992d4..6947ce2e90 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 2e8505ad74..3bc59503e2 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 8132cc1566..2b2623d81a 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index 18739adace..732b1623db 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index be227ac6b1..890a8d0a35 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index 507afcf48c..af05398941 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index 1f5778af1a..ef3384c657 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index 434f495419..29a2361c18 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index 52dcbf7e60..1f8c5ea699 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index 34c9722d83..a7c339f13e 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.228-SNAPSHOT + 17.0.228-cct-1981-SNAPSHOT progression-viewstore-persistence From 576f559e26b6f057550201a532856f085bb38abc Mon Sep 17 00:00:00 2001 From: devops-team Date: Fri, 27 Feb 2026 23:46:11 +0000 Subject: [PATCH 03/39] New 17.0.229-cct-1981-SNAPSHOT --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index 9c69cb0799..ac467d84e1 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index a2e4aaf454..cb3bc110ab 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index 5f718fe42b..4482eafe96 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index 3a405ff7e1..3592913e02 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index f8ce693695..2dfb021f32 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index 85475b92cf..07269181dd 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 54e141ed4f..32ed22ae22 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index 50a0c801f2..308281ffc4 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index 2664ff12b7..4bb1eda87b 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index c341026c1a..5a768bb63f 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index ac77cd1c44..780d021c44 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index 2d76ba4e5c..b1b2bd8150 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index f732d14a23..046957578a 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 6156c07a44..4ee05ac4bc 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index c2caa96f44..f895477c0d 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index af9c996894..2ffd2a4040 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index 427f089ee7..6541aea101 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index e87698f787..42a276d54d 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index e1d8aef276..c336085fba 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index 6947ce2e90..e62b7f8372 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 3bc59503e2..f48122b8b7 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 2b2623d81a..fc39390208 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index 732b1623db..46db580bb3 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index 890a8d0a35..4b86754a80 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index af05398941..deadb9b9f2 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index ef3384c657..b0c86f207e 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index 29a2361c18..24cf3b45f7 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index 1f8c5ea699..60250a7d6e 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index a7c339f13e..61e58422d6 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.228-cct-1981-SNAPSHOT + 17.0.229-cct-1981-SNAPSHOT progression-viewstore-persistence From fa5c2f71be8394bcbbd953d8e3e408b842302c07 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou HMCTS Date: Sun, 1 Mar 2026 22:21:12 +0000 Subject: [PATCH 04/39] Update runIntegrationTests.sh (#108) --- runIntegrationTests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/runIntegrationTests.sh b/runIntegrationTests.sh index c83d86bb87..4d5901ef27 100755 --- a/runIntegrationTests.sh +++ b/runIntegrationTests.sh @@ -48,3 +48,4 @@ function buildDeployAndTest { } buildDeployAndTest + From 63c069892094e8496b13f6c15086420b15fe0055 Mon Sep 17 00:00:00 2001 From: devops-team Date: Sun, 1 Mar 2026 23:38:55 +0000 Subject: [PATCH 05/39] New 17.0.230-cct-1981-SNAPSHOT --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index ac467d84e1..76280a8977 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index cb3bc110ab..a9c57868ad 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index 4482eafe96..92cfebe706 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index 3592913e02..71888bf4d7 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index 2dfb021f32..eac0cd78da 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index 07269181dd..85f3322875 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 32ed22ae22..4e0742e2eb 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index 308281ffc4..0748878bde 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index 4bb1eda87b..cfc8d77fc9 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index 5a768bb63f..c32b4f3558 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index 780d021c44..7c94e20f23 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index b1b2bd8150..43895d8950 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index 046957578a..8ce0e60299 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 4ee05ac4bc..ce0043e691 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index f895477c0d..b403721b09 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index 2ffd2a4040..3c130ed3e7 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index 6541aea101..cdde8400bf 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index 42a276d54d..3cd3a9b412 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index c336085fba..f811b1fb1e 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index e62b7f8372..71d2affab6 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index f48122b8b7..498a56a504 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index fc39390208..05e4e195ea 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index 46db580bb3..ce4c5fbad3 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index 4b86754a80..bb622dc0b0 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index deadb9b9f2..104ddf2b05 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index b0c86f207e..f583b582d4 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index 24cf3b45f7..16e958d2cb 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index 60250a7d6e..8d8ba83f2a 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index 61e58422d6..e9dcf43d91 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.229-cct-1981-SNAPSHOT + 17.0.230-cct-1981-SNAPSHOT progression-viewstore-persistence From dfc576e7d9049d1a7c860cb8d6b5c9b74e3afca8 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Thu, 5 Mar 2026 08:56:52 +0000 Subject: [PATCH 06/39] adding numeric court id --- .../progression/query/api/service/CourtlistQueryService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java index 12d928baba..034cdafc90 100644 --- a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java +++ b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java @@ -55,8 +55,8 @@ public JsonEnvelope buildCourtlistQueryEnvelope(final String courtCentreId, fina } /** - * Builds a JSON payload from the document, enriched with court centre data (ouCode, courtId) - * when available from reference data. + * Builds a JSON payload from the document, enriched with court centre data (ouCode, courtId, courtIdNumeric) + * when available from reference data. courtIdNumeric is taken from reference data field "courtId", default "0". */ public JsonObject buildEnrichedPayload(final JsonEnvelope document) { final JsonObjectBuilder builder = Json.createObjectBuilder(); @@ -69,6 +69,7 @@ public JsonObject buildEnrichedPayload(final JsonEnvelope document) { .ifPresent(courtCentreData -> { builder.add("ouCode", courtCentreData.getJsonString("oucode")); builder.add("courtId", courtCentreData.getJsonString("id")); + builder.add("courtIdNumeric", courtCentreData.getString("courtId", "0")); }); } From 079b6c19359b3b92b3e0c621459ccdfa7e2fd0b8 Mon Sep 17 00:00:00 2001 From: Ertugrul Duran Date: Thu, 5 Mar 2026 12:42:58 +0000 Subject: [PATCH 07/39] LPT-2124:[BE] CaTH publishing feedback 002 --- pom.xml | 2 +- .../progression.search.court.list.data.json | 40 +- .../progression.search.court.list.data.json | 36 +- .../progression/query/CourtlistQueryView.java | 177 ++++++- .../query/CourtlistQueryViewTest.java | 445 ++++++++++++++++++ .../listing-empty-hearing-dates.json | 5 + 6 files changed, 693 insertions(+), 12 deletions(-) create mode 100644 progression-query/progression-query-view/src/test/resources/listing-empty-hearing-dates.json diff --git a/pom.xml b/pom.xml index 76280a8977..8538bc91b5 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 17.0.72 1.0.6 6.4.1 - 17.103.125 + 17.103.126 17.0.125 17.0.144 17.0.37 diff --git a/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json b/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json index 71e3acc2ef..879e0d77ad 100644 --- a/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json +++ b/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json @@ -70,8 +70,44 @@ "hearingType": "First hearing", "welshHearingType": "Gwrandawiad Cyntaf", "caseNumber": "63GD6903522", - "caseId": "a848c547-9993-46f8-bd99-6b8690cde6d9", - "prosecutorType": "CITYPF", + "courtApplicationId": "528fe634-20f3-474b-a110-4c6141c58c99", + "courtApplication": { + "applicationType": "Application for first hearing summons for criminal case", + "applicationParticulars": "Application particulars text", + "applicant": { + "name": "John Smith", + "organisationName": "", + "welshOrganisationName": "", + "firstName": "John", + "surname": "Smith", + "welshSurname": "", + "dateOfBirth": "15 Aug 1965", + "age": "60", + "nationality": "", + "address": { + "address1": "1 Police House", + "address2": "Street Description", + "address3": "Locality", + "address4": "Town", + "address5": "", + "postcode": "TW14 9XD" + }, + "reportingRestrictions": [], + "offences": [ + { + "id": "2e098e56-6d6d-4434-bbb0-fb26d342ff05", + "offenceCode": "PS90010", + "offenceTitle": "Public service vehicle - passenger use altered / defaced travel mandate", + "offenceWording": "Application particulars wording", + "listingNumber": 1, + "offenceLegislation": "Contrary to regulation 7(1)(a) of the Public Service Vehicles (Conduct of Drivers, Inspectors, Conductors and Passengers) Regulations 1990." + } + ] + }, + "respondents": [ + { "name": "Police" } + ] + }, "defendants": [ { "id": "707f81d2-d519-48d1-a94f-8f0acd72112b", diff --git a/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json b/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json index f4f71b7cca..d9f590aa15 100644 --- a/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json +++ b/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json @@ -42,7 +42,41 @@ "properties": { "hearings": { "type": "array", - "items": { "type": "object" } + "items": { + "type": "object", + "description": "Hearing entry; when courtApplicationId is present, courtApplication contains application details", + "properties": { + "courtApplication": { + "type": "object", + "description": "Present for application hearings; application type, particulars, applicant and respondents", + "properties": { + "applicationType": { "type": "string" }, + "applicationParticulars": { "type": "string" }, + "applicant": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "organisationName": { "type": "string" }, + "welshOrganisationName": { "type": "string" }, + "firstName": { "type": "string" }, + "surname": { "type": "string" }, + "welshSurname": { "type": "string" }, + "dateOfBirth": { "type": "string" }, + "age": { "type": "string" }, + "nationality": { "type": "string" }, + "address": { "type": "object" }, + "reportingRestrictions": { "type": "array" }, + "offences": { "type": "array" } + } + }, + "respondents": { + "type": "array", + "items": { "type": "object", "properties": { "name": { "type": "string" } } } + } + } + } + } + } } } } diff --git a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java index 4125f082dd..59ee0900be 100644 --- a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java +++ b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java @@ -35,12 +35,14 @@ import uk.gov.justice.core.courts.MasterDefendant; import uk.gov.justice.core.courts.Offence; import uk.gov.justice.core.courts.OffenceFacts; +import uk.gov.justice.core.courts.Organisation; import uk.gov.justice.core.courts.Person; import uk.gov.justice.core.courts.PersonDefendant; import uk.gov.justice.core.courts.Plea; import uk.gov.justice.core.courts.ProsecutingAuthority; import uk.gov.justice.core.courts.ProsecutionCase; import uk.gov.justice.core.courts.ProsecutionCounsel; +import uk.gov.justice.core.courts.ReportingRestriction; import uk.gov.justice.services.common.converter.JsonObjectToObjectConverter; import uk.gov.justice.services.common.converter.ObjectToJsonObjectConverter; import uk.gov.justice.services.common.converter.StringToJsonObjectConverter; @@ -55,8 +57,10 @@ import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.Optional; import java.util.UUID; import java.util.concurrent.atomic.AtomicReference; @@ -79,6 +83,9 @@ public class CourtlistQueryView { private static final String DATE_OF_BIRTH = "dateOfBirth"; private static final String APPLICANT = "applicant"; private static final String RESPONDENTS = "respondents"; + private static final String APPLICATION_TYPE = "applicationType"; + private static final String APPLICATION_PARTICULARS = "applicationParticulars"; + private static final String REPORTING_RESTRICTIONS = "reportingRestrictions"; private static final DateTimeFormatter DATE_FORMATTER = ofPattern(STANDARD.getValue()); private static final DateTimeFormatter DOB_FORMATTER = DateTimeFormatter.ofPattern("d MMM yyyy"); private static final Logger LOGGER = LoggerFactory.getLogger(CourtlistQueryView.class); @@ -324,7 +331,14 @@ private JsonObject enrichHearingFromCourtApplication(JsonObject hearingFromListi final JsonObjectBuilder courtApplicationBuilder = createObjectBuilder(); hearingCourtApplication.ifPresent(courtApplication -> { - courtApplicationBuilder.add(APPLICANT, buildCourtApplicationParty(courtApplication.getApplicant())); + if (nonNull(courtApplication.getType())) { + courtApplicationBuilder.add(APPLICATION_TYPE, courtApplication.getType().getType()); + } + ofNullable(courtApplication.getApplicationParticulars()) + .ifPresent(particulars -> courtApplicationBuilder.add(APPLICATION_PARTICULARS, particulars)); + if (nonNull(courtApplication.getApplicant())) { + courtApplicationBuilder.add(APPLICANT, buildApplicantForCourtApplication(courtApplication, offencesForApplications)); + } ofNullable(courtApplication.getRespondents()).ifPresent(respondents -> { final JsonArrayBuilder respondentsBuilder = createArrayBuilder(); respondents.forEach(respondent -> respondentsBuilder.add(buildCourtApplicationParty(respondent))); @@ -367,17 +381,164 @@ private void addProsecutionAuthorityToPartyBuilder(final ProsecutingAuthority pr private void addMasterDefendantToPartyBuilder(final MasterDefendant masterDefendant, final JsonObjectBuilder partyBuilder) { if (masterDefendant.getPersonDefendant() != null - && masterDefendant.getPersonDefendant().getPersonDetails() != null) { + && masterDefendant.getPersonDefendant().getPersonDetails() != null) { final Person person = masterDefendant.getPersonDefendant().getPersonDetails(); partyBuilder.add(NAME, String.format("%s %s", person.getFirstName(), person.getLastName())); ofNullable(person.getDateOfBirth()).ifPresent(dateOfBirth -> partyBuilder.add(DATE_OF_BIRTH, dateOfBirth.format(DOB_FORMATTER))); } else if (masterDefendant.getLegalEntityDefendant() != null - && masterDefendant.getLegalEntityDefendant().getOrganisation() != null - && masterDefendant.getLegalEntityDefendant().getOrganisation().getName() != null) { + && masterDefendant.getLegalEntityDefendant().getOrganisation() != null + && masterDefendant.getLegalEntityDefendant().getOrganisation().getName() != null) { partyBuilder.add(NAME, masterDefendant.getLegalEntityDefendant().getOrganisation().getName()); } } + private JsonObject buildApplicantForCourtApplication(final CourtApplication courtApplication, final List offencesForApplications) { + final JsonObjectBuilder applicantBuilder = createObjectBuilder(); + final CourtApplicationParty applicant = courtApplication.getApplicant(); + + if (nonNull(applicant.getMasterDefendant())) { + final MasterDefendant masterDefendant = applicant.getMasterDefendant(); + if (nonNull(masterDefendant.getPersonDefendant()) && nonNull(masterDefendant.getPersonDefendant().getPersonDetails())) { + final Person person = masterDefendant.getPersonDefendant().getPersonDetails(); + final String fullName = String.format("%s %s", ofNullable(person.getFirstName()).orElse(""), ofNullable(person.getLastName()).orElse("")).trim(); + applicantBuilder.add(NAME, fullName.isEmpty() ? "" : fullName); + applicantBuilder.add("organisationName", ""); + applicantBuilder.add("welshOrganisationName", ""); + ofNullable(person.getFirstName()).ifPresent(fn -> applicantBuilder.add("firstName", fn)); + applicantBuilder.add("surname", ofNullable(person.getLastName()).orElse("")); + applicantBuilder.add("welshSurname", ofNullable(person.getLastName()).orElse("")); + ofNullable(person.getDateOfBirth()).ifPresent(dob -> applicantBuilder.add(DATE_OF_BIRTH, dob.format(DOB_FORMATTER))); + ofNullable(getAge(person.getDateOfBirth())).ifPresent(age -> applicantBuilder.add("age", String.valueOf(age))); + applicantBuilder.add("nationality", ofNullable(person.getNationalityDescription()).orElse("")); + ofNullable(person.getAddress()).ifPresent(addr -> applicantBuilder.add("address", objectToJsonObjectConverter.convert(addr))); + } else if (nonNull(masterDefendant.getLegalEntityDefendant()) && nonNull(masterDefendant.getLegalEntityDefendant().getOrganisation())) { + final Organisation org = masterDefendant.getLegalEntityDefendant().getOrganisation(); + applicantBuilder.add(NAME, ofNullable(org.getName()).orElse("")); + applicantBuilder.add("organisationName", ofNullable(org.getName()).orElse("")); + applicantBuilder.add("welshOrganisationName", ofNullable(org.getName()).orElse("")); + applicantBuilder.add("firstName", ""); + applicantBuilder.add("surname", ""); + applicantBuilder.add("welshSurname", ""); + applicantBuilder.add(DATE_OF_BIRTH, ""); + applicantBuilder.add("age", ""); + applicantBuilder.add("nationality", ""); + applicantBuilder.add("address", createObjectBuilder().build()); + } + } else if (nonNull(applicant.getPersonDetails())) { + final Person person = applicant.getPersonDetails(); + final String fullName = String.format("%s %s", ofNullable(person.getFirstName()).orElse(""), ofNullable(person.getLastName()).orElse("")).trim(); + applicantBuilder.add(NAME, fullName.isEmpty() ? "" : fullName); + applicantBuilder.add("organisationName", ofNullable(applicant.getOrganisation()).map(org -> ofNullable(org.getName()).orElse("")).orElse("")); + applicantBuilder.add("welshOrganisationName", ""); + ofNullable(person.getFirstName()).ifPresent(fn -> applicantBuilder.add("firstName", fn)); + applicantBuilder.add("surname", ofNullable(person.getLastName()).orElse("")); + applicantBuilder.add("welshSurname", ""); + ofNullable(person.getDateOfBirth()).ifPresent(dob -> applicantBuilder.add(DATE_OF_BIRTH, dob.format(DOB_FORMATTER))); + ofNullable(getAge(person.getDateOfBirth())).ifPresent(age -> applicantBuilder.add("age", String.valueOf(age))); + applicantBuilder.add("nationality", ofNullable(person.getNationalityDescription()).orElse("")); + ofNullable(person.getAddress()).ifPresent(addr -> applicantBuilder.add("address", objectToJsonObjectConverter.convert(addr))); + } else if (nonNull(applicant.getOrganisation())) { + final Organisation org = applicant.getOrganisation(); + applicantBuilder.add(NAME, ofNullable(org.getName()).orElse("")); + applicantBuilder.add("organisationName", ofNullable(org.getName()).orElse("")); + applicantBuilder.add("welshOrganisationName", ""); + applicantBuilder.add("firstName", ""); + applicantBuilder.add("surname", ""); + applicantBuilder.add("welshSurname", ""); + applicantBuilder.add(DATE_OF_BIRTH, ""); + applicantBuilder.add("age", ""); + applicantBuilder.add("nationality", ""); + ofNullable(org.getAddress()).ifPresent(addr -> applicantBuilder.add("address", objectToJsonObjectConverter.convert(addr))); + } else if (nonNull(applicant.getProsecutingAuthority())) { + final ProsecutingAuthority pa = applicant.getProsecutingAuthority(); + final String paName = ofNullable(pa.getName()).orElse(pa.getProsecutionAuthorityCode()); + applicantBuilder.add(NAME, ofNullable(paName).orElse("")); + applicantBuilder.add("organisationName", ""); + applicantBuilder.add("welshOrganisationName", ""); + applicantBuilder.add("firstName", ""); + applicantBuilder.add("surname", ""); + applicantBuilder.add("welshSurname", ""); + applicantBuilder.add(DATE_OF_BIRTH, ""); + applicantBuilder.add("age", ""); + applicantBuilder.add("nationality", ""); + applicantBuilder.add("address", createObjectBuilder().build()); + } else if (nonNull(applicant.getRepresentationOrganisation())) { + final String repName = applicant.getRepresentationOrganisation().getName(); + applicantBuilder.add(NAME, ofNullable(repName).orElse("")); + applicantBuilder.add("organisationName", ""); + applicantBuilder.add("welshOrganisationName", ""); + applicantBuilder.add("firstName", ""); + applicantBuilder.add("surname", ""); + applicantBuilder.add("welshSurname", ""); + applicantBuilder.add(DATE_OF_BIRTH, ""); + applicantBuilder.add("age", ""); + applicantBuilder.add("nationality", ""); + applicantBuilder.add("address", createObjectBuilder().build()); + } + + applicantBuilder.add(REPORTING_RESTRICTIONS, buildApplicantReportingRestrictions(courtApplication, offencesForApplications)); + applicantBuilder.add(OFFENCES, buildApplicationOffences(courtApplication, offencesForApplications)); + return applicantBuilder.build(); + } + + private JsonArray buildApplicantReportingRestrictions(final CourtApplication courtApplication, final List offencesForApplications) { + final JsonArrayBuilder arrayBuilder = createArrayBuilder(); + final Set seenLabels = new LinkedHashSet<>(); + if (isNotEmpty(courtApplication.getCourtApplicationCases())) { + courtApplication.getCourtApplicationCases().stream() + .filter(courtApplicationCase -> isNotEmpty(courtApplicationCase.getOffences())) + .flatMap(courtApplicationCase -> courtApplicationCase.getOffences().stream()) + .filter(offence -> offencesForApplications.contains(offence.getId())) + .forEach(offence -> addReportingRestrictionsFromOffence(offence, arrayBuilder, seenLabels)); + } else if (nonNull(courtApplication.getCourtOrder()) && isNotEmpty(courtApplication.getCourtOrder().getCourtOrderOffences())) { + courtApplication.getCourtOrder().getCourtOrderOffences().stream() + .map(CourtOrderOffence::getOffence) + .filter(offence -> offencesForApplications.contains(offence.getId())) + .forEach(offence -> addReportingRestrictionsFromOffence(offence, arrayBuilder, seenLabels)); + } + return arrayBuilder.build(); + } + + private void addReportingRestrictionsFromOffence(final Offence offence, final JsonArrayBuilder arrayBuilder, final Set seenLabels) { + if (isNotEmpty(offence.getReportingRestrictions())) { + offence.getReportingRestrictions().stream() + .filter(rr -> rr != null && rr.getLabel() != null && seenLabels.add(rr.getLabel())) + .forEach(rr -> arrayBuilder.add(createObjectBuilder() + .add("id", ofNullable(rr.getId()).map(UUID::toString).orElse("")) + .add("label", rr.getLabel()) + .build())); + } + } + + private JsonArray buildApplicationOffences(final CourtApplication courtApplication, final List offencesForApplications) { + final JsonArrayBuilder offencesArray = createArrayBuilder(); + if (isNotEmpty(courtApplication.getCourtApplicationCases())) { + courtApplication.getCourtApplicationCases().stream() + .filter(courtApplicationCase -> isNotEmpty(courtApplicationCase.getOffences())) + .flatMap(courtApplicationCase -> courtApplicationCase.getOffences().stream()) + .filter(offence -> offencesForApplications.contains(offence.getId())) + .forEach(offence -> { + final JsonObjectBuilder offenceBuilder = Json.createObjectBuilder(); + buildOffence(offenceBuilder, offence, null); + addApplicationInformation(offenceBuilder, courtApplication); + addOffenceInformation(offenceBuilder, offence); + offencesArray.add(offenceBuilder.build()); + }); + } else if (nonNull(courtApplication.getCourtOrder()) && isNotEmpty(courtApplication.getCourtOrder().getCourtOrderOffences())) { + courtApplication.getCourtOrder().getCourtOrderOffences().stream() + .map(CourtOrderOffence::getOffence) + .filter(offence -> offencesForApplications.contains(offence.getId())) + .forEach(offence -> { + final JsonObjectBuilder offenceBuilder = Json.createObjectBuilder(); + buildOffence(offenceBuilder, offence, null); + addApplicationInformation(offenceBuilder, courtApplication); + addOffenceInformation(offenceBuilder, offence); + offencesArray.add(offenceBuilder.build()); + }); + } + return offencesArray.build(); + } + private JsonObject buildDefendantFromCourtApplication(JsonObject hearingFromListing, final CourtApplication courtApplication, final Hearing hearing, final List offencesForApplications) { final JsonObjectBuilder defendantBuilder = Json.createObjectBuilder(); @@ -423,13 +584,13 @@ private JsonObject buildDefendantFromCourtApplication(JsonObject hearingFromList final Person person = masterDefendant.getPersonDefendant().getPersonDetails(); final JsonObjectBuilder defendantFromListingBuilder = Json.createObjectBuilder(); - if (isNotEmpty(hearingFromListing.getJsonArray(DEFENDANTS))){ + if (isNotEmpty(hearingFromListing.getJsonArray(DEFENDANTS))) { hearingFromListing.getJsonArray(DEFENDANTS) .stream() .map(defendant -> (JsonObject) defendant) .forEach(defFromListing -> { final UUID defendantId = fromString((defFromListing).getString(ID)); - if(defendantId.equals(masterDefendant.getMasterDefendantId()) || defendantId.equals(courtApplication.getSubject().getId())){ + if (defendantId.equals(masterDefendant.getMasterDefendantId()) || defendantId.equals(courtApplication.getSubject().getId())) { defFromListing.forEach((name, value) -> defendantFromListingBuilder.add(name, value)); } }); @@ -441,9 +602,9 @@ private JsonObject buildDefendantFromCourtApplication(JsonObject hearingFromList //Replace defendant name found from Listing final JsonObject defeFromListingJsonObject = defendantFromListingBuilder.build(); - if(!defeFromListingJsonObject.isEmpty() && nonNull(defeFromListingJsonObject.getString(ID))){ + if (!defeFromListingJsonObject.isEmpty() && nonNull(defeFromListingJsonObject.getString(ID))) { final UUID defendantId = fromString(defeFromListingJsonObject.getString(ID)); - if(defendantId.equals(masterDefendant.getMasterDefendantId()) || defendantId.equals(courtApplication.getSubject().getId())){ + if (defendantId.equals(masterDefendant.getMasterDefendantId()) || defendantId.equals(courtApplication.getSubject().getId())) { defeFromListingJsonObject.forEach((name, value) -> defendantBuilder.add(name, value)); } } diff --git a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java index c6577ffbff..2c0d0e6e70 100644 --- a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java +++ b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java @@ -1,15 +1,28 @@ package uk.gov.moj.cpp.progression.query; import static java.nio.charset.Charset.defaultCharset; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static java.util.UUID.fromString; import static java.util.UUID.randomUUID; import static java.util.stream.Collectors.toList; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static uk.gov.justice.services.test.utils.core.reflection.ReflectionUtil.setField; +import uk.gov.justice.core.courts.CourtApplication; +import uk.gov.justice.core.courts.CourtApplicationParty; import uk.gov.justice.core.courts.Hearing; +import uk.gov.justice.core.courts.LegalEntityDefendant; +import uk.gov.justice.core.courts.MasterDefendant; +import uk.gov.justice.core.courts.Organisation; +import uk.gov.justice.core.courts.Person; +import uk.gov.justice.core.courts.PersonDefendant; +import uk.gov.justice.core.courts.ProsecutingAuthority; import uk.gov.justice.core.courts.ProsecutionCase; import uk.gov.justice.services.common.converter.JsonObjectToObjectConverter; import uk.gov.justice.services.common.converter.ObjectToJsonObjectConverter; @@ -22,11 +35,14 @@ import java.io.ByteArrayInputStream; import java.io.IOException; +import java.lang.reflect.Method; +import java.time.LocalDate; import java.util.List; import java.util.Optional; import java.util.UUID; import javax.json.Json; +import javax.json.JsonArray; import javax.json.JsonObject; import com.google.common.io.Resources; @@ -287,6 +303,128 @@ public void shouldEnrichBenchlistDocumentPayloadForCourtApplications2() throws I assertThat(actual, is(expected)); } + @Test + public void shouldReturnEmptyPayloadWhenListingServiceReturnsEmpty() { + when(listingService.searchCourtlist(any(JsonEnvelope.class))).thenReturn(Optional.empty()); + + final JsonEnvelope query = JsonEnvelope.envelopeFrom( + JsonEnvelope.metadataBuilder() + .withId(randomUUID()) + .withName("progression.search.court.list").build(), + Json.createObjectBuilder().build()); + + final JsonObject actual = courtlistQueryView.searchCourtlist(query).payloadAsJsonObject(); + + assertThat(actual.isEmpty(), is(true)); + } + + @Test + public void searchPrisonCourtlistShouldDelegateToSearchCourtlist() throws IOException { + final Optional listingResponse = Optional.of(getJsonPayload("listing-hearing-with-prosecution-case.json")); + final List hearingList = getHearings("courtlists.hearings.repository.all.json"); + when(listingService.searchCourtlist(any(JsonEnvelope.class))).thenReturn(listingResponse); + when(hearingQueryView.getHearings(any(List.class))).thenReturn(hearingList); + final ProsecutionCase prosecutionCase = getHearings("courtlists.hearings.repository.all.json").get(0).getProsecutionCases().get(0); + final ProsecutionCaseEntity prosecutionCaseEntity = new ProsecutionCaseEntity(); + prosecutionCaseEntity.setPayload(objectToJsonObjectConverter.convert(prosecutionCase).toString()); + when(prosecutionCaseRepository.findByCaseId(any())).thenReturn(prosecutionCaseEntity); + + final JsonEnvelope query = JsonEnvelope.envelopeFrom( + JsonEnvelope.metadataBuilder() + .withId(randomUUID()) + .withName("progression.search.prison.court.list").build(), + Json.createObjectBuilder().build()); + + final JsonObject expected = getJsonPayload("courtlist-expected-with-prosecution-cases.json"); + final JsonObject actual = courtlistQueryView.searchPrisonCourtlist(query).payloadAsJsonObject(); + assertThat(actual, is(expected)); + } + + @Test + public void shouldReturnPayloadWithoutEnrichmentWhenHearingDatesIsEmpty() throws IOException { + final Optional listingResponse = Optional.of(getJsonPayload("listing-empty-hearing-dates.json")); + when(listingService.searchCourtlist(any(JsonEnvelope.class))).thenReturn(listingResponse); + + final JsonEnvelope query = JsonEnvelope.envelopeFrom( + JsonEnvelope.metadataBuilder() + .withId(randomUUID()) + .withName("progression.search.court.list").build(), + Json.createObjectBuilder().build()); + + final JsonObject actual = courtlistQueryView.searchCourtlist(query).payloadAsJsonObject(); + + assertThat(actual.getString("listType"), is("public")); + assertThat(actual.getString("courtCentreName"), is("Test Court")); + assertThat(actual.getJsonArray("hearingDates").size(), is(0)); + } + + @Test + public void shouldReturnPayloadWithoutEnrichmentWhenHearingsMapIsEmpty() throws IOException { + final Optional listingResponse = Optional.of(getJsonPayload("listing-hearing-with-prosecution-case.json")); + when(listingService.searchCourtlist(any(JsonEnvelope.class))).thenReturn(listingResponse); + when(hearingQueryView.getHearings(any(List.class))).thenReturn(emptyList()); + + final JsonEnvelope query = JsonEnvelope.envelopeFrom( + JsonEnvelope.metadataBuilder() + .withId(randomUUID()) + .withName("progression.search.court.list").build(), + Json.createObjectBuilder().build()); + + final JsonObject actual = courtlistQueryView.searchCourtlist(query).payloadAsJsonObject(); + + assertThat(actual, notNullValue()); + assertThat(actual.containsKey("hearingDates"), is(true)); + } + + @Test + public void shouldOmitHearingFromOutputWhenHearingIdNotInHearingsMap() throws IOException { + final Optional listingResponse = Optional.of(getJsonPayload("listing-hearing-with-prosecution-case.json")); + final Hearing hearingWithDifferentId = mock(Hearing.class); + when(hearingWithDifferentId.getId()).thenReturn(randomUUID()); + when(listingService.searchCourtlist(any(JsonEnvelope.class))).thenReturn(listingResponse); + when(hearingQueryView.getHearings(any(List.class))).thenReturn(singletonList(hearingWithDifferentId)); + + final JsonEnvelope query = JsonEnvelope.envelopeFrom( + JsonEnvelope.metadataBuilder() + .withId(randomUUID()) + .withName("progression.search.court.list").build(), + Json.createObjectBuilder().build()); + + final JsonObject actual = courtlistQueryView.searchCourtlist(query).payloadAsJsonObject(); + + final int hearingsInFirstSlot = actual.getJsonArray("hearingDates").getJsonObject(0) + .getJsonArray("courtRooms").getJsonObject(0) + .getJsonArray("timeslots").getJsonObject(0) + .getJsonArray("hearings").size(); + assertThat(hearingsInFirstSlot, is(0)); + } + + @Test + public void shouldNotAddLjaInformationWhenCourtCentreIsNull() throws IOException { + final Optional listingResponse = Optional.of(getJsonPayload("listing-hearing-with-prosecution-case.json")); + final Hearing hearingWithNullCourtCentre = mock(Hearing.class); + when(hearingWithNullCourtCentre.getId()).thenReturn(UUID.fromString("82b243f8-c4d3-4790-92ef-6192db00539c")); + when(hearingWithNullCourtCentre.getCourtCentre()).thenReturn(null); + when(hearingWithNullCourtCentre.getProsecutionCases()).thenReturn(emptyList()); + when(listingService.searchCourtlist(any(JsonEnvelope.class))).thenReturn(listingResponse); + when(hearingQueryView.getHearings(any(List.class))).thenReturn(singletonList(hearingWithNullCourtCentre)); + final ProsecutionCase prosecutionCase = getHearings("courtlists.hearings.repository.all.json").get(0).getProsecutionCases().get(0); + final ProsecutionCaseEntity prosecutionCaseEntity = new ProsecutionCaseEntity(); + prosecutionCaseEntity.setPayload(objectToJsonObjectConverter.convert(prosecutionCase).toString()); + when(prosecutionCaseRepository.findByCaseId(any())).thenReturn(prosecutionCaseEntity); + + final JsonEnvelope query = JsonEnvelope.envelopeFrom( + JsonEnvelope.metadataBuilder() + .withId(randomUUID()) + .withName("progression.search.court.list").build(), + Json.createObjectBuilder().build()); + + final JsonObject actual = courtlistQueryView.searchCourtlist(query).payloadAsJsonObject(); + + assertThat(actual.containsKey("ljaCode"), is(false)); + assertThat(actual.containsKey("ljaName"), is(false)); + } + @Test public void shouldEnrichCourtlistDocumentPayloadForProsecutionCases_WhenHearingISPresentInListingButMissingInProgression() throws IOException { final Optional listingResponse = Optional.of(getJsonPayload("listing-hearing-with-prosecution-case-oneHearing-missing-in-progression.json")); @@ -310,6 +448,313 @@ public void shouldEnrichCourtlistDocumentPayloadForProsecutionCases_WhenHearingI assertPleaValue(actual, true); } + @SuppressWarnings("unchecked") + private T invokePrivateMethod(final String methodName, final Class[] paramTypes, final Object... args) throws Exception { + final Method method = CourtlistQueryView.class.getDeclaredMethod(methodName, paramTypes); + method.setAccessible(true); + return (T) method.invoke(courtlistQueryView, args); + } + + @Test + public void getApplicationOffenceListingNumbers_shouldReturnEmptyListWhenNoApplicationOffences() throws Exception { + final JsonObject hearingJson = Json.createObjectBuilder().build(); + final List result = invokePrivateMethod("getApplicationOffenceListingNumbers", new Class[]{JsonObject.class}, hearingJson); + assertThat(result.isEmpty(), is(true)); + } + + @Test + public void getApplicationOffenceListingNumbers_shouldReturnOffenceIdsWhenApplicationOffencesPresent() throws Exception { + final String id1 = "072319bf-73c2-41b5-b309-c8c86c9b077b"; + final String id2 = "651fc68b-8b9f-4cf2-912a-0b55d536323c"; + final JsonObject hearingJson = Json.createObjectBuilder() + .add("applicationOffences", Json.createArrayBuilder() + .add(Json.createObjectBuilder().add("id", id1).build()) + .add(Json.createObjectBuilder().add("id", id2).build()) + .build()) + .build(); + final List result = invokePrivateMethod("getApplicationOffenceListingNumbers", new Class[]{JsonObject.class}, hearingJson); + assertThat(result.size(), is(2)); + assertThat(result.contains(fromString(id1)), is(true)); + assertThat(result.contains(fromString(id2)), is(true)); + } + + @Test + public void buildCourtApplicationParty_shouldAddNameFromProsecutingAuthority() throws Exception { + final ProsecutingAuthority pa = ProsecutingAuthority.prosecutingAuthority() + .withName("CPS London") + .build(); + final CourtApplicationParty party = CourtApplicationParty.courtApplicationParty() + .withProsecutingAuthority(pa) + .build(); + final JsonObject result = invokePrivateMethod("buildCourtApplicationParty", new Class[]{CourtApplicationParty.class}, party); + assertThat(result.getString("name"), is("CPS London")); + } + + @Test + public void buildCourtApplicationParty_shouldAddNameFromProsecutionAuthorityCodeWhenNameNull() throws Exception { + final ProsecutingAuthority pa = ProsecutingAuthority.prosecutingAuthority() + .withProsecutionAuthorityCode("CPS01") + .build(); + final CourtApplicationParty party = CourtApplicationParty.courtApplicationParty() + .withProsecutingAuthority(pa) + .build(); + final JsonObject result = invokePrivateMethod("buildCourtApplicationParty", new Class[]{CourtApplicationParty.class}, party); + assertThat(result.getString("name"), is("CPS01")); + } + + @Test + public void buildCourtApplicationParty_shouldAddNameFromMasterDefendantPerson() throws Exception { + final MasterDefendant masterDefendant = MasterDefendant.masterDefendant() + .withPersonDefendant(PersonDefendant.personDefendant() + .withPersonDetails(Person.person() + .withFirstName("John") + .withLastName("Doe") + .withDateOfBirth(LocalDate.of(1990, 1, 15)) + .build()) + .build()) + .withMasterDefendantId(randomUUID()) + .build(); + final CourtApplicationParty party = CourtApplicationParty.courtApplicationParty() + .withMasterDefendant(masterDefendant) + .build(); + final JsonObject result = invokePrivateMethod("buildCourtApplicationParty", new Class[]{CourtApplicationParty.class}, party); + assertThat(result.getString("name"), is("John Doe")); + assertThat(result.getString("dateOfBirth"), is("15 Jan 1990")); + } + + @Test + public void buildCourtApplicationParty_shouldAddNameFromMasterDefendantLegalEntity() throws Exception { + final MasterDefendant masterDefendant = MasterDefendant.masterDefendant() + .withLegalEntityDefendant(LegalEntityDefendant.legalEntityDefendant() + .withOrganisation(Organisation.organisation().withName("Acme Ltd").build()) + .build()) + .withMasterDefendantId(randomUUID()) + .build(); + final CourtApplicationParty party = CourtApplicationParty.courtApplicationParty() + .withMasterDefendant(masterDefendant) + .build(); + final JsonObject result = invokePrivateMethod("buildCourtApplicationParty", new Class[]{CourtApplicationParty.class}, party); + assertThat(result.getString("name"), is("Acme Ltd")); + } + + @Test + public void buildCourtApplicationParty_shouldAddNameFromOrganisation() throws Exception { + final CourtApplicationParty party = CourtApplicationParty.courtApplicationParty() + .withOrganisation(Organisation.organisation().withName("Transport for London").build()) + .build(); + final JsonObject result = invokePrivateMethod("buildCourtApplicationParty", new Class[]{CourtApplicationParty.class}, party); + assertThat(result.getString("name"), is("Transport for London")); + } + + @Test + public void buildCourtApplicationParty_shouldAddNameFromPersonDetails() throws Exception { + final CourtApplicationParty party = CourtApplicationParty.courtApplicationParty() + .withPersonDetails(Person.person() + .withFirstName("Jane") + .withLastName("Smith") + .withDateOfBirth(LocalDate.of(1985, 6, 20)) + .build()) + .build(); + final JsonObject result = invokePrivateMethod("buildCourtApplicationParty", new Class[]{CourtApplicationParty.class}, party); + assertThat(result.getString("name"), is("Jane Smith")); + assertThat(result.getString("dateOfBirth"), is("20 Jun 1985")); + } + + @Test + public void buildApplicantForCourtApplication_shouldBuildApplicantFromProsecutingAuthority() throws Exception { + final CourtApplication courtApplication = CourtApplication.courtApplication() + .withApplicant(CourtApplicationParty.courtApplicationParty() + .withProsecutingAuthority(ProsecutingAuthority.prosecutingAuthority() + .withName("CPS") + .withProsecutionAuthorityCode("CPS01") + .build()) + .build()) + .build(); + final JsonObject result = invokePrivateMethod("buildApplicantForCourtApplication", + new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); + assertThat(result.getString("name"), is("CPS")); + assertThat(result.getJsonArray("reportingRestrictions"), notNullValue()); + assertThat(result.getJsonArray("offences"), notNullValue()); + assertThat(result.getString("organisationName"), is("")); + } + + @Test + public void buildApplicantForCourtApplication_shouldBuildApplicantFromOrganisation() throws Exception { + final CourtApplication courtApplication = CourtApplication.courtApplication() + .withApplicant(CourtApplicationParty.courtApplicationParty() + .withOrganisation(Organisation.organisation().withName("Acme Organisation").build()) + .build()) + .build(); + final JsonObject result = invokePrivateMethod("buildApplicantForCourtApplication", + new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); + assertThat(result.getString("organisationName"), is("Acme Organisation")); + assertThat(result.getString("welshOrganisationName"), is("")); + } + + @Test + public void buildApplicantForCourtApplication_shouldBuildApplicantFromPersonDetails() throws Exception { + final CourtApplication courtApplication = CourtApplication.courtApplication() + .withApplicant(CourtApplicationParty.courtApplicationParty() + .withPersonDetails(Person.person() + .withFirstName("Alice") + .withLastName("Brown") + .withDateOfBirth(LocalDate.of(1992, 3, 10)) + .build()) + .build()) + .build(); + final JsonObject result = invokePrivateMethod("buildApplicantForCourtApplication", + new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); + assertThat(result.getString("firstName"), is("Alice")); + assertThat(result.getString("surname"), is("Brown")); + assertThat(result.getString("dateOfBirth"), is("10 Mar 1992")); + assertThat(result.getString("organisationName"), is("")); + assertThat(result.getJsonArray("offences"), notNullValue()); + } + + @Test + public void buildApplicantForCourtApplication_shouldBuildApplicantFromMasterDefendantPersonWithOrganisation() throws Exception { + final Person person = mock(Person.class); + when(person.getFirstName()).thenReturn("Bob"); + when(person.getLastName()).thenReturn("Wilson"); + when(person.getDateOfBirth()).thenReturn(LocalDate.of(1988, 7, 5)); + final PersonDefendant personDefendant = mock(PersonDefendant.class); + when(personDefendant.getPersonDetails()).thenReturn(person); + final MasterDefendant masterDefendant = mock(MasterDefendant.class); + when(masterDefendant.getPersonDefendant()).thenReturn(personDefendant); + final CourtApplicationParty applicant = mock(CourtApplicationParty.class); + when(applicant.getMasterDefendant()).thenReturn(masterDefendant); + final CourtApplication courtApplication = mock(CourtApplication.class); + when(courtApplication.getApplicant()).thenReturn(applicant); + final JsonObject result = invokePrivateMethod("buildApplicantForCourtApplication", + new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); + assertThat(result.getString("firstName"), is("Bob")); + assertThat(result.getString("surname"), is("Wilson")); + assertThat(result.getString("dateOfBirth"), is("5 Jul 1988")); + } + + @Test + public void buildApplicantForCourtApplication_shouldBuildApplicantFromMasterDefendantLegalEntity() throws Exception { + final Organisation org = mock(Organisation.class); + when(org.getName()).thenReturn("Corporate Defendant Ltd"); + final LegalEntityDefendant legalEntityDefendant = mock(LegalEntityDefendant.class); + when(legalEntityDefendant.getOrganisation()).thenReturn(org); + final MasterDefendant masterDefendant = mock(MasterDefendant.class); + when(masterDefendant.getPersonDefendant()).thenReturn(null); + when(masterDefendant.getLegalEntityDefendant()).thenReturn(legalEntityDefendant); + final CourtApplicationParty applicant = mock(CourtApplicationParty.class); + when(applicant.getMasterDefendant()).thenReturn(masterDefendant); + final CourtApplication courtApplication = CourtApplication.courtApplication() + .withApplicant(applicant) + .build(); + final JsonObject result = invokePrivateMethod("buildApplicantForCourtApplication", + new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); + assertThat(result.getString("organisationName"), is("Corporate Defendant Ltd")); + } + + @Test + public void buildApplicantReportingRestrictions_shouldReturnEmptyArrayWhenNoOffencesMatch() throws Exception { + final CourtApplication courtApplication = CourtApplication.courtApplication() + .withCourtApplicationCases(emptyList()) + .build(); + final JsonArray result = invokePrivateMethod("buildApplicantReportingRestrictions", + new Class[]{CourtApplication.class, List.class}, courtApplication, singletonList(randomUUID())); + assertThat(result.size(), is(0)); + } + + @Test + public void buildApplicationOffences_shouldReturnEmptyArrayWhenNoOffencesMatch() throws Exception { + final CourtApplication courtApplication = CourtApplication.courtApplication() + .withCourtApplicationCases(emptyList()) + .build(); + final JsonArray result = invokePrivateMethod("buildApplicationOffences", + new Class[]{CourtApplication.class, List.class}, courtApplication, singletonList(randomUUID())); + assertThat(result.size(), is(0)); + } + + private Hearing getHearingWithCourtApplications() throws IOException { + final List list = getHearings("courtlists.hearings.repository.all.json"); + return list.stream() + .filter(h -> h != null && h.getCourtApplications() != null && !h.getCourtApplications().isEmpty()) + .findFirst() + .orElseThrow(() -> new IllegalStateException("Test data has no hearing with court applications")); + } + + @Test + public void buildDefendantFromCourtApplication_shouldBuildDefendantWithOffencesAndAsn() throws Exception { + final JsonObject hearingFromListing = getJsonPayload("listing-hearing-with-court-application.json") + .getJsonArray("hearingDates").getJsonObject(0) + .getJsonArray("courtRooms").getJsonObject(0) + .getJsonArray("timeslots").getJsonObject(0) + .getJsonArray("hearings").getJsonObject(0); + final Hearing hearing = getHearingWithCourtApplications(); + final CourtApplication courtApplication = hearing.getCourtApplications().stream() + .filter(ca -> ca.getId().equals(fromString("528fe634-20f3-474b-a110-4c6141c58c99"))) + .findFirst().orElseThrow(); + final List offencesForApplications = List.of( + fromString("072319bf-73c2-41b5-b309-c8c86c9b077b"), + fromString("651fc68b-8b9f-4cf2-912a-0b55d536323c")); + final JsonObject result = invokePrivateMethod("buildDefendantFromCourtApplication", + new Class[]{JsonObject.class, CourtApplication.class, Hearing.class, List.class}, + hearingFromListing, courtApplication, hearing, offencesForApplications); + assertThat(result.containsKey("id"), is(true)); + assertThat(result.getString("asn"), is("Arrest456")); + assertThat(result.containsKey("offences"), is(true)); + assertThat(result.getJsonArray("offences").size(), is(2)); + assertThat(result.containsKey("defenceOrganization"), is(true)); + } + + @Test + public void enrichHearingFromCourtApplication_shouldEnrichHearingWithCourtApplicationBlock() throws Exception { + final JsonObject hearingFromListing = getJsonPayload("listing-hearing-with-court-application.json") + .getJsonArray("hearingDates").getJsonObject(0) + .getJsonArray("courtRooms").getJsonObject(0) + .getJsonArray("timeslots").getJsonObject(0) + .getJsonArray("hearings").getJsonObject(0); + final Hearing hearing = getHearingWithCourtApplications(); + final UUID courtApplicationId = fromString("528fe634-20f3-474b-a110-4c6141c58c99"); + final JsonObject result = invokePrivateMethod("enrichHearingFromCourtApplication", + new Class[]{JsonObject.class, Hearing.class, UUID.class}, + hearingFromListing, hearing, courtApplicationId); + assertThat(result.containsKey("courtApplication"), is(true)); + final JsonObject courtApplication = result.getJsonObject("courtApplication"); + assertThat(courtApplication.containsKey("applicationType"), is(true)); + assertThat(courtApplication.containsKey("applicant"), is(true)); + assertThat(courtApplication.getJsonObject("applicant").containsKey("name"), is(true)); + assertThat(courtApplication.containsKey("respondents"), is(true)); + assertThat(result.containsKey("defendants"), is(true)); + assertThat(result.getJsonArray("defendants").size(), is(1)); + } + + @Test + public void shouldEnrichCourtlistWithCourtApplicationApplicantAndDefendants() throws IOException { + final Optional listingResponse = Optional.of(getJsonPayload("listing-hearing-with-court-application.json")); + final List hearingList = getHearings("courtlists.hearings.repository.all.json"); + when(listingService.searchCourtlist(any(JsonEnvelope.class))).thenReturn(listingResponse); + when(hearingQueryView.getHearings(any(List.class))).thenReturn(hearingList); + + final JsonEnvelope query = JsonEnvelope.envelopeFrom( + JsonEnvelope.metadataBuilder() + .withId(randomUUID()) + .withName("progression.search.court.list").build(), + Json.createObjectBuilder().build()); + + final JsonObject actual = courtlistQueryView.searchCourtlist(query).payloadAsJsonObject(); + + final JsonObject firstHearing = actual.getJsonArray("hearingDates").getJsonObject(0) + .getJsonArray("courtRooms").getJsonObject(0) + .getJsonArray("timeslots").getJsonObject(0) + .getJsonArray("hearings").getJsonObject(0); + assertThat(firstHearing.containsKey("courtApplication"), is(true)); + final JsonObject courtApplication = firstHearing.getJsonObject("courtApplication"); + assertThat(courtApplication.getString("applicationType"), is("Application for first hearing summons for criminal case")); + assertThat(courtApplication.getJsonObject("applicant").getString("name"), is("Transport for London")); + assertThat(courtApplication.getJsonArray("respondents").size(), is(2)); + assertThat(firstHearing.getJsonArray("defendants").size(), is(1)); + final JsonObject defendant = firstHearing.getJsonArray("defendants").getJsonObject(0); + assertThat(defendant.containsKey("offences"), is(true)); + assertThat(defendant.getJsonArray("offences").size(), is(2)); + } + private JsonObject getJsonPayload(final String fileName) throws IOException { final String jsonString = Resources.toString(Resources.getResource(fileName), defaultCharset()); return Json.createReader( diff --git a/progression-query/progression-query-view/src/test/resources/listing-empty-hearing-dates.json b/progression-query/progression-query-view/src/test/resources/listing-empty-hearing-dates.json new file mode 100644 index 0000000000..66e31b0627 --- /dev/null +++ b/progression-query/progression-query-view/src/test/resources/listing-empty-hearing-dates.json @@ -0,0 +1,5 @@ +{ + "listType": "public", + "courtCentreName": "Test Court", + "hearingDates": [] +} From 3af09e2dd4843cfe532223d27b04ac6fbff8e957 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Thu, 5 Mar 2026 18:09:53 +0000 Subject: [PATCH 08/39] more tests --- .../progression/query/CourtlistQueryView.java | 227 ++++++++++-------- 1 file changed, 123 insertions(+), 104 deletions(-) diff --git a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java index 59ee0900be..c1688d0dc1 100644 --- a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java +++ b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java @@ -103,6 +103,37 @@ public class CourtlistQueryView { private final String PROSECUTOR_TYPE = "prosecutorType"; private final String DEFENCE_COUNSELS = "defenceCounsels"; private final String PROSECUTION_COUNSELS = "prosecutionCounsels"; + private static final String APPLICATION_OFFENCES = "applicationOffences"; + private static final String ORGANISATION_NAME = "organisationName"; + private static final String WELSH_ORGANISATION_NAME = "welshOrganisationName"; + private static final String FIRST_NAME = "firstName"; + private static final String SURNAME = "surname"; + private static final String WELSH_SURNAME = "welshSurname"; + private static final String AGE = "age"; + private static final String NATIONALITY = "nationality"; + private static final String ADDRESS = "address"; + private static final String LABEL = "label"; + private static final String LJA_CODE = "ljaCode"; + private static final String LJA_NAME = "ljaName"; + private static final String WELSH_LJA_NAME = "welshLjaName"; + private static final String GENDER = "gender"; + private static final String DEFENCE_ORGANIZATION = "defenceOrganization"; + private static final String ASN = "asn"; + private static final String OFFENCE_CODE = "offenceCode"; + private static final String OFFENCE_TITLE = "offenceTitle"; + private static final String OFFENCE_WORDING = "offenceWording"; + private static final String WELSH_OFFENCE_TITLE = "welshOffenceTitle"; + private static final String OFFENCE_LEGISLATION = "offenceLegislation"; + private static final String MAX_PENALTY = "maxPenalty"; + private static final String PLEA = "plea"; + private static final String PLEA_DATE = "pleaDate"; + private static final String CONVICTED_ON = "convictedOn"; + private static final String ADJOURNED_DATE = "adjournedDate"; + private static final String ADJOURNED_HEARING_TYPE = "adjournedHearingType"; + private static final String ALCOHOL_READING_AMOUNT = "alcoholReadingAmount"; + private static final String ALCOHOL_READING_METHOD_DESCRIPTION = "alcoholReadingMethodDescription"; + private static final String MIDDLE_NAME = "middleName"; + private static final String LAST_NAME = "lastName"; @Inject private ListingService listingService; @Inject @@ -172,8 +203,8 @@ private List getHearingIds(final JsonObject listingResponse) { } private List getApplicationOffenceListingNumbers(final JsonObject hearingJson) { - if (hearingJson.containsKey("applicationOffences")) { - return hearingJson.getJsonArray("applicationOffences").stream() + if (hearingJson.containsKey(APPLICATION_OFFENCES)) { + return hearingJson.getJsonArray(APPLICATION_OFFENCES).stream() .map(jsonValue -> ((JsonObject) jsonValue)) .map(jsonObject -> fromString(jsonObject.getString(ID))) .collect(toList()); @@ -399,81 +430,29 @@ private JsonObject buildApplicantForCourtApplication(final CourtApplication cour if (nonNull(applicant.getMasterDefendant())) { final MasterDefendant masterDefendant = applicant.getMasterDefendant(); if (nonNull(masterDefendant.getPersonDefendant()) && nonNull(masterDefendant.getPersonDefendant().getPersonDetails())) { - final Person person = masterDefendant.getPersonDefendant().getPersonDetails(); - final String fullName = String.format("%s %s", ofNullable(person.getFirstName()).orElse(""), ofNullable(person.getLastName()).orElse("")).trim(); - applicantBuilder.add(NAME, fullName.isEmpty() ? "" : fullName); - applicantBuilder.add("organisationName", ""); - applicantBuilder.add("welshOrganisationName", ""); - ofNullable(person.getFirstName()).ifPresent(fn -> applicantBuilder.add("firstName", fn)); - applicantBuilder.add("surname", ofNullable(person.getLastName()).orElse("")); - applicantBuilder.add("welshSurname", ofNullable(person.getLastName()).orElse("")); - ofNullable(person.getDateOfBirth()).ifPresent(dob -> applicantBuilder.add(DATE_OF_BIRTH, dob.format(DOB_FORMATTER))); - ofNullable(getAge(person.getDateOfBirth())).ifPresent(age -> applicantBuilder.add("age", String.valueOf(age))); - applicantBuilder.add("nationality", ofNullable(person.getNationalityDescription()).orElse("")); - ofNullable(person.getAddress()).ifPresent(addr -> applicantBuilder.add("address", objectToJsonObjectConverter.convert(addr))); + addApplicantPersonFields(applicantBuilder, masterDefendant.getPersonDefendant().getPersonDetails(), "", ""); } else if (nonNull(masterDefendant.getLegalEntityDefendant()) && nonNull(masterDefendant.getLegalEntityDefendant().getOrganisation())) { final Organisation org = masterDefendant.getLegalEntityDefendant().getOrganisation(); - applicantBuilder.add(NAME, ofNullable(org.getName()).orElse("")); - applicantBuilder.add("organisationName", ofNullable(org.getName()).orElse("")); - applicantBuilder.add("welshOrganisationName", ofNullable(org.getName()).orElse("")); - applicantBuilder.add("firstName", ""); - applicantBuilder.add("surname", ""); - applicantBuilder.add("welshSurname", ""); - applicantBuilder.add(DATE_OF_BIRTH, ""); - applicantBuilder.add("age", ""); - applicantBuilder.add("nationality", ""); - applicantBuilder.add("address", createObjectBuilder().build()); + addApplicantOrganisationFields(applicantBuilder, org.getName(), ofNullable(org.getName()).orElse(""), true); } } else if (nonNull(applicant.getPersonDetails())) { - final Person person = applicant.getPersonDetails(); - final String fullName = String.format("%s %s", ofNullable(person.getFirstName()).orElse(""), ofNullable(person.getLastName()).orElse("")).trim(); - applicantBuilder.add(NAME, fullName.isEmpty() ? "" : fullName); - applicantBuilder.add("organisationName", ofNullable(applicant.getOrganisation()).map(org -> ofNullable(org.getName()).orElse("")).orElse("")); - applicantBuilder.add("welshOrganisationName", ""); - ofNullable(person.getFirstName()).ifPresent(fn -> applicantBuilder.add("firstName", fn)); - applicantBuilder.add("surname", ofNullable(person.getLastName()).orElse("")); - applicantBuilder.add("welshSurname", ""); - ofNullable(person.getDateOfBirth()).ifPresent(dob -> applicantBuilder.add(DATE_OF_BIRTH, dob.format(DOB_FORMATTER))); - ofNullable(getAge(person.getDateOfBirth())).ifPresent(age -> applicantBuilder.add("age", String.valueOf(age))); - applicantBuilder.add("nationality", ofNullable(person.getNationalityDescription()).orElse("")); - ofNullable(person.getAddress()).ifPresent(addr -> applicantBuilder.add("address", objectToJsonObjectConverter.convert(addr))); + final String orgName = ofNullable(applicant.getOrganisation()).map(org -> ofNullable(org.getName()).orElse("")).orElse(""); + addApplicantPersonFields(applicantBuilder, applicant.getPersonDetails(), orgName, ""); } else if (nonNull(applicant.getOrganisation())) { final Organisation org = applicant.getOrganisation(); - applicantBuilder.add(NAME, ofNullable(org.getName()).orElse("")); - applicantBuilder.add("organisationName", ofNullable(org.getName()).orElse("")); - applicantBuilder.add("welshOrganisationName", ""); - applicantBuilder.add("firstName", ""); - applicantBuilder.add("surname", ""); - applicantBuilder.add("welshSurname", ""); - applicantBuilder.add(DATE_OF_BIRTH, ""); - applicantBuilder.add("age", ""); - applicantBuilder.add("nationality", ""); - ofNullable(org.getAddress()).ifPresent(addr -> applicantBuilder.add("address", objectToJsonObjectConverter.convert(addr))); + addApplicantOrganisationFields(applicantBuilder, ofNullable(org.getName()).orElse(""), "", false); + ofNullable(org.getAddress()).ifPresent(addr -> applicantBuilder.add(ADDRESS, objectToJsonObjectConverter.convert(addr))); } else if (nonNull(applicant.getProsecutingAuthority())) { final ProsecutingAuthority pa = applicant.getProsecutingAuthority(); final String paName = ofNullable(pa.getName()).orElse(pa.getProsecutionAuthorityCode()); applicantBuilder.add(NAME, ofNullable(paName).orElse("")); - applicantBuilder.add("organisationName", ""); - applicantBuilder.add("welshOrganisationName", ""); - applicantBuilder.add("firstName", ""); - applicantBuilder.add("surname", ""); - applicantBuilder.add("welshSurname", ""); - applicantBuilder.add(DATE_OF_BIRTH, ""); - applicantBuilder.add("age", ""); - applicantBuilder.add("nationality", ""); - applicantBuilder.add("address", createObjectBuilder().build()); + addApplicantEmptyFields(applicantBuilder); + applicantBuilder.add(ADDRESS, createObjectBuilder().build()); } else if (nonNull(applicant.getRepresentationOrganisation())) { final String repName = applicant.getRepresentationOrganisation().getName(); applicantBuilder.add(NAME, ofNullable(repName).orElse("")); - applicantBuilder.add("organisationName", ""); - applicantBuilder.add("welshOrganisationName", ""); - applicantBuilder.add("firstName", ""); - applicantBuilder.add("surname", ""); - applicantBuilder.add("welshSurname", ""); - applicantBuilder.add(DATE_OF_BIRTH, ""); - applicantBuilder.add("age", ""); - applicantBuilder.add("nationality", ""); - applicantBuilder.add("address", createObjectBuilder().build()); + addApplicantEmptyFields(applicantBuilder); + applicantBuilder.add(ADDRESS, createObjectBuilder().build()); } applicantBuilder.add(REPORTING_RESTRICTIONS, buildApplicantReportingRestrictions(courtApplication, offencesForApplications)); @@ -481,6 +460,46 @@ private JsonObject buildApplicantForCourtApplication(final CourtApplication cour return applicantBuilder.build(); } + private void addApplicantPersonFields(final JsonObjectBuilder applicantBuilder, final Person person, final String organisationName, final String welshOrganisationName) { + final String fullName = String.format("%s %s", ofNullable(person.getFirstName()).orElse(""), ofNullable(person.getLastName()).orElse("")).trim(); + applicantBuilder.add(NAME, fullName.isEmpty() ? "" : fullName); + applicantBuilder.add(ORGANISATION_NAME, organisationName); + applicantBuilder.add(WELSH_ORGANISATION_NAME, welshOrganisationName); + ofNullable(person.getFirstName()).ifPresent(fn -> applicantBuilder.add(FIRST_NAME, fn)); + applicantBuilder.add(SURNAME, ofNullable(person.getLastName()).orElse("")); + applicantBuilder.add(WELSH_SURNAME, ofNullable(person.getLastName()).orElse("")); + ofNullable(person.getDateOfBirth()).ifPresent(dob -> applicantBuilder.add(DATE_OF_BIRTH, dob.format(DOB_FORMATTER))); + ofNullable(getAge(person.getDateOfBirth())).ifPresent(age -> applicantBuilder.add(AGE, String.valueOf(age))); + applicantBuilder.add(NATIONALITY, ofNullable(person.getNationalityDescription()).orElse("")); + ofNullable(person.getAddress()).ifPresent(addr -> applicantBuilder.add(ADDRESS, objectToJsonObjectConverter.convert(addr))); + } + + private void addApplicantOrganisationFields(final JsonObjectBuilder applicantBuilder, final String organisationName, final String welshOrganisationName, final boolean withEmptyAddress) { + applicantBuilder.add(NAME, organisationName); + applicantBuilder.add(ORGANISATION_NAME, organisationName); + applicantBuilder.add(WELSH_ORGANISATION_NAME, welshOrganisationName); + applicantBuilder.add(FIRST_NAME, ""); + applicantBuilder.add(SURNAME, ""); + applicantBuilder.add(WELSH_SURNAME, ""); + applicantBuilder.add(DATE_OF_BIRTH, ""); + applicantBuilder.add(AGE, ""); + applicantBuilder.add(NATIONALITY, ""); + if (withEmptyAddress) { + applicantBuilder.add(ADDRESS, createObjectBuilder().build()); + } + } + + private void addApplicantEmptyFields(final JsonObjectBuilder applicantBuilder) { + applicantBuilder.add(ORGANISATION_NAME, ""); + applicantBuilder.add(WELSH_ORGANISATION_NAME, ""); + applicantBuilder.add(FIRST_NAME, ""); + applicantBuilder.add(SURNAME, ""); + applicantBuilder.add(WELSH_SURNAME, ""); + applicantBuilder.add(DATE_OF_BIRTH, ""); + applicantBuilder.add(AGE, ""); + applicantBuilder.add(NATIONALITY, ""); + } + private JsonArray buildApplicantReportingRestrictions(final CourtApplication courtApplication, final List offencesForApplications) { final JsonArrayBuilder arrayBuilder = createArrayBuilder(); final Set seenLabels = new LinkedHashSet<>(); @@ -504,8 +523,8 @@ private void addReportingRestrictionsFromOffence(final Offence offence, final Js offence.getReportingRestrictions().stream() .filter(rr -> rr != null && rr.getLabel() != null && seenLabels.add(rr.getLabel())) .forEach(rr -> arrayBuilder.add(createObjectBuilder() - .add("id", ofNullable(rr.getId()).map(UUID::toString).orElse("")) - .add("label", rr.getLabel()) + .add(ID, ofNullable(rr.getId()).map(UUID::toString).orElse("")) + .add(LABEL, rr.getLabel()) .build())); } } @@ -596,9 +615,9 @@ private JsonObject buildDefendantFromCourtApplication(JsonObject hearingFromList }); } defendantBuilder.add(ID, masterDefendant.getMasterDefendantId().toString()); - ofNullable(person.getFirstName()).ifPresent(firstName -> defendantBuilder.add("firstName", firstName)); - defendantBuilder.add("surname", person.getLastName()); - defendantBuilder.add("gender", person.getGender().toString()); + ofNullable(person.getFirstName()).ifPresent(firstName -> defendantBuilder.add(FIRST_NAME, firstName)); + defendantBuilder.add(SURNAME, person.getLastName()); + defendantBuilder.add(GENDER, person.getGender().toString()); //Replace defendant name found from Listing final JsonObject defeFromListingJsonObject = defendantFromListingBuilder.build(); @@ -611,18 +630,18 @@ private JsonObject buildDefendantFromCourtApplication(JsonObject hearingFromList final Integer defendantAge = getAge(person.getDateOfBirth()); if (nonNull(defendantAge)) { - defendantBuilder.add("age", defendantAge); + defendantBuilder.add(AGE, defendantAge); } - ofNullable(person.getAddress()).ifPresent(address -> defendantBuilder.add("address", objectToJsonObjectConverter.convert(address))); + ofNullable(person.getAddress()).ifPresent(address -> defendantBuilder.add(ADDRESS, objectToJsonObjectConverter.convert(address))); ofNullable(person.getDateOfBirth()).ifPresent(dateOfBirth -> defendantBuilder.add(DATE_OF_BIRTH, dateOfBirth.format(DOB_FORMATTER))); - ofNullable(person.getNationalityDescription()).ifPresent(nationalityDescription -> defendantBuilder.add("nationality", nationalityDescription)); + ofNullable(person.getNationalityDescription()).ifPresent(nationalityDescription -> defendantBuilder.add(NATIONALITY, nationalityDescription)); if (isNotEmpty(hearing.getDefenceCounsels())) { defendantBuilder.add(DEFENCE_COUNSELS, buildDefenceCounsels(hearing.getDefenceCounsels(), masterDefendant.getMasterDefendantId())); } } - ofNullable(courtApplication.getDefendantASN()).ifPresent(asn -> defendantBuilder.add("asn", asn)); + ofNullable(courtApplication.getDefendantASN()).ifPresent(asn -> defendantBuilder.add(ASN, asn)); //TODO not sure about defenceOrganization - defendantBuilder.add("defenceOrganization", "-"); + defendantBuilder.add(DEFENCE_ORGANIZATION, "-"); if (isNotEmpty(hearing.getProsecutionCounsels())) { defendantBuilder.add(PROSECUTION_COUNSELS, buildProsecutionCounsels(hearing.getProsecutionCounsels(), caseIdList)); } @@ -639,18 +658,18 @@ private JsonObject enrichDefendant(final JsonObject defendantFromListing, final final PersonDefendant personDefendant = defendant.getPersonDefendant(); if (nonNull(personDefendant)) { - defendantJsonBuilder.add("gender", personDefendant.getPersonDetails().getGender().toString()); - ofNullable(personDefendant.getArrestSummonsNumber()).ifPresent(arrestSummonsNumber -> defendantJsonBuilder.add("asn", arrestSummonsNumber)); + defendantJsonBuilder.add(GENDER, personDefendant.getPersonDetails().getGender().toString()); + ofNullable(personDefendant.getArrestSummonsNumber()).ifPresent(arrestSummonsNumber -> defendantJsonBuilder.add(ASN, arrestSummonsNumber)); } else { if (nonNull(defendant.getLegalEntityDefendant())) { - ofNullable(defendant.getLegalEntityDefendant().getOrganisation().getName()).ifPresent(name -> defendantJsonBuilder.add("name", name)); - ofNullable(defendant.getLegalEntityDefendant().getOrganisation().getAddress()).ifPresent(address -> defendantJsonBuilder.add("address", objectToJsonObjectConverter.convert(address))); + ofNullable(defendant.getLegalEntityDefendant().getOrganisation().getName()).ifPresent(name -> defendantJsonBuilder.add(NAME, name)); + ofNullable(defendant.getLegalEntityDefendant().getOrganisation().getAddress()).ifPresent(address -> defendantJsonBuilder.add(ADDRESS, objectToJsonObjectConverter.convert(address))); } } final Optional defenceOrganisation = findDefenceOrg(defendant); - defenceOrganisation.ifPresent(org -> defendantJsonBuilder.add("defenceOrganization", org)); + defenceOrganisation.ifPresent(org -> defendantJsonBuilder.add(DEFENCE_ORGANIZATION, org)); final List offencesFromHearing = getOffencesFromHearing(defendant, hearing, prosecutionCase); @@ -719,24 +738,24 @@ private Optional getDefenceOrganisation(final Defendant defendant) { } private void addOffenceInformation(final JsonObjectBuilder offenceBuilder, final Offence offence) { - offenceBuilder.add("offenceCode", offence.getOffenceCode()); - offenceBuilder.add("offenceTitle", offence.getOffenceTitle()); - offenceBuilder.add("offenceWording", offence.getWording()); + offenceBuilder.add(OFFENCE_CODE, offence.getOffenceCode()); + offenceBuilder.add(OFFENCE_TITLE, offence.getOffenceTitle()); + offenceBuilder.add(OFFENCE_WORDING, offence.getWording()); ofNullable(offence.getListingNumber()).ifPresent(listingNumber -> offenceBuilder.add(LISTING_NUMBER, listingNumber)); - ofNullable(offence.getOffenceTitleWelsh()).ifPresent(welshOffenceTitle -> offenceBuilder.add("welshOffenceTitle", welshOffenceTitle)); - ofNullable(offence.getOffenceLegislation()).ifPresent(offenceLegislation -> offenceBuilder.add("offenceLegislation", offenceLegislation)); - ofNullable(offence.getMaxPenalty()).ifPresent(maxPenalty -> offenceBuilder.add("maxPenalty", maxPenalty)); + ofNullable(offence.getOffenceTitleWelsh()).ifPresent(welshOffenceTitle -> offenceBuilder.add(WELSH_OFFENCE_TITLE, welshOffenceTitle)); + ofNullable(offence.getOffenceLegislation()).ifPresent(offenceLegislation -> offenceBuilder.add(OFFENCE_LEGISLATION, offenceLegislation)); + ofNullable(offence.getMaxPenalty()).ifPresent(maxPenalty -> offenceBuilder.add(MAX_PENALTY, maxPenalty)); } private void addApplicationInformation(final JsonObjectBuilder offenceBuilder, final CourtApplication courtApplication) { final CourtApplicationType type = courtApplication.getType(); - offenceBuilder.add("offenceTitle", type.getType()); + offenceBuilder.add(OFFENCE_TITLE, type.getType()); - ofNullable(type.getCode()).ifPresent(offenceCode -> offenceBuilder.add("offenceCode", offenceCode)); - ofNullable(type.getTypeWelsh()).ifPresent(welshOffenceTitle -> offenceBuilder.add("welshOffenceTitle", welshOffenceTitle)); - ofNullable(type.getLegislation()).ifPresent(offenceLegislation -> offenceBuilder.add("offenceLegislation", offenceLegislation)); - ofNullable(courtApplication.getApplicationParticulars()).ifPresent(offenceWording -> offenceBuilder.add("offenceWording", offenceWording)); + ofNullable(type.getCode()).ifPresent(offenceCode -> offenceBuilder.add(OFFENCE_CODE, offenceCode)); + ofNullable(type.getTypeWelsh()).ifPresent(welshOffenceTitle -> offenceBuilder.add(WELSH_OFFENCE_TITLE, welshOffenceTitle)); + ofNullable(type.getLegislation()).ifPresent(offenceLegislation -> offenceBuilder.add(OFFENCE_LEGISLATION, offenceLegislation)); + ofNullable(courtApplication.getApplicationParticulars()).ifPresent(offenceWording -> offenceBuilder.add(OFFENCE_WORDING, offenceWording)); } private void buildOffence(final JsonObjectBuilder offenceBuilder, final Offence offence, final Offence offenceFromHearing) { @@ -745,10 +764,10 @@ private void buildOffence(final JsonObjectBuilder offenceBuilder, final Offence if (nonNull(offence.getOffenceFacts())) { final OffenceFacts offenceFacts = offence.getOffenceFacts(); ofNullable(offenceFacts.getAlcoholReadingAmount()) - .ifPresent(alcoholReadingAmount -> offenceBuilder.add("alcoholReadingAmount", alcoholReadingAmount)); + .ifPresent(alcoholReadingAmount -> offenceBuilder.add(ALCOHOL_READING_AMOUNT, alcoholReadingAmount)); ofNullable(offenceFacts.getAlcoholReadingMethodDescription()) - .ifPresent(alcoholReadingMethodDescription -> offenceBuilder.add("alcoholReadingMethodDescription", alcoholReadingMethodDescription)); + .ifPresent(alcoholReadingMethodDescription -> offenceBuilder.add(ALCOHOL_READING_METHOD_DESCRIPTION, alcoholReadingMethodDescription)); } @@ -768,16 +787,16 @@ private void buildOffence(final JsonObjectBuilder offenceBuilder, final Offence setPleaAndPleaDateIfNotIndicatedNotGuilty(offenceBuilder, pLea.getIndicatedPleaValue().name(), pLea.getIndicatedPleaDate()); } - ofNullable(offence.getMaxPenalty()).ifPresent(maxPenalty -> offenceBuilder.add("maxPenalty", maxPenalty)); - ofNullable(offence.getConvictionDate()).ifPresent(convictedOn -> offenceBuilder.add("convictedOn", convictedOn.format(DATE_FORMATTER))); - ofNullable(offence.getLastAdjournDate()).ifPresent(adjournedDate -> offenceBuilder.add("adjournedDate", adjournedDate.format(DATE_FORMATTER))); - ofNullable(offence.getLastAdjournedHearingType()).ifPresent(adjournedHearingType -> offenceBuilder.add("adjournedHearingType", adjournedHearingType.replaceAll("\n", ","))); + ofNullable(offence.getMaxPenalty()).ifPresent(maxPenalty -> offenceBuilder.add(MAX_PENALTY, maxPenalty)); + ofNullable(offence.getConvictionDate()).ifPresent(convictedOn -> offenceBuilder.add(CONVICTED_ON, convictedOn.format(DATE_FORMATTER))); + ofNullable(offence.getLastAdjournDate()).ifPresent(adjournedDate -> offenceBuilder.add(ADJOURNED_DATE, adjournedDate.format(DATE_FORMATTER))); + ofNullable(offence.getLastAdjournedHearingType()).ifPresent(adjournedHearingType -> offenceBuilder.add(ADJOURNED_HEARING_TYPE, adjournedHearingType.replaceAll("\n", ","))); } private void setPleaAndPleaDateIfNotIndicatedNotGuilty(final JsonObjectBuilder offenceBuilder, final String plea, LocalDate pleaDate) { if (!plea.equals(IndicatedPleaValue.INDICATED_NOT_GUILTY.name())) { - offenceBuilder.add("plea", plea); - offenceBuilder.add("pleaDate", pleaDate.format(DATE_FORMATTER)); + offenceBuilder.add(PLEA, plea); + offenceBuilder.add(PLEA_DATE, pleaDate.format(DATE_FORMATTER)); } } @@ -800,9 +819,9 @@ private JsonArray buildDefenceCounsels(final List defenceCounsel private JsonObject buildCounsel(final String firstName, final String middleName, final String lastName) { final JsonObjectBuilder counsel = Json.createObjectBuilder(); - ofNullable(firstName).ifPresent(fn -> counsel.add("firstName", fn)); - ofNullable(middleName).ifPresent(mn -> counsel.add("middleName", mn)); - ofNullable(lastName).ifPresent(ln -> counsel.add("lastName", ln)); + ofNullable(firstName).ifPresent(fn -> counsel.add(FIRST_NAME, fn)); + ofNullable(middleName).ifPresent(mn -> counsel.add(MIDDLE_NAME, mn)); + ofNullable(lastName).ifPresent(ln -> counsel.add(LAST_NAME, ln)); return counsel.build(); } @@ -815,10 +834,10 @@ private JsonObject addLjaInformation(JsonObject documentPayload, final CourtCent if (nonNull(courtCentre)) { final LjaDetails ljaDetails = courtCentre.getLja(); if (nonNull(ljaDetails)) { - documentPayload = addProperty(documentPayload, "ljaCode", ljaDetails.getLjaCode()); - documentPayload = addProperty(documentPayload, "ljaName", ljaDetails.getLjaName()); + documentPayload = addProperty(documentPayload, LJA_CODE, ljaDetails.getLjaCode()); + documentPayload = addProperty(documentPayload, LJA_NAME, ljaDetails.getLjaName()); if (nonNull(ljaDetails.getWelshLjaName())) { - documentPayload = addProperty(documentPayload, "welshLjaName", ljaDetails.getWelshLjaName()); + documentPayload = addProperty(documentPayload, WELSH_LJA_NAME, ljaDetails.getWelshLjaName()); } } } From 16ae6c942c91f4d59e65891f67895cbd885bd2bc Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Thu, 5 Mar 2026 18:44:10 +0000 Subject: [PATCH 09/39] more tests --- .../progression/query/CourtlistQueryViewTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java index 2c0d0e6e70..5b12ee9e4c 100644 --- a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java +++ b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java @@ -651,6 +651,21 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromMasterDefe assertThat(result.getString("organisationName"), is("Corporate Defendant Ltd")); } + @Test + public void buildApplicantForCourtApplication_shouldBuildApplicantFromRepresentationOrganisation() throws Exception { + final CourtApplication courtApplication = CourtApplication.courtApplication() + .withApplicant(CourtApplicationParty.courtApplicationParty() + .withRepresentationOrganisation(Organisation.organisation().withName("Solicitors Ltd").build()) + .build()) + .build(); + final JsonObject result = invokePrivateMethod("buildApplicantForCourtApplication", + new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); + assertThat(result.getString("name"), is("Solicitors Ltd")); + assertThat(result.getString("organisationName"), is("")); + assertThat(result.getJsonArray("reportingRestrictions"), notNullValue()); + assertThat(result.getJsonArray("offences"), notNullValue()); + } + @Test public void buildApplicantReportingRestrictions_shouldReturnEmptyArrayWhenNoOffencesMatch() throws Exception { final CourtApplication courtApplication = CourtApplication.courtApplication() From dbfadf77c9e650db5969f5442e1ed1783a5e33df Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Thu, 5 Mar 2026 19:36:11 +0000 Subject: [PATCH 10/39] more tests --- .../moj/cpp/progression/query/CourtlistQueryView.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java index c1688d0dc1..de9017fa81 100644 --- a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java +++ b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java @@ -89,6 +89,7 @@ public class CourtlistQueryView { private static final DateTimeFormatter DATE_FORMATTER = ofPattern(STANDARD.getValue()); private static final DateTimeFormatter DOB_FORMATTER = DateTimeFormatter.ofPattern("d MMM yyyy"); private static final Logger LOGGER = LoggerFactory.getLogger(CourtlistQueryView.class); + public static final String STRING_STRING = "%s %s"; private final String ID = "id"; private final String CASE_ID = "caseId"; private final String DEFENDANTS = "defendants"; @@ -394,7 +395,7 @@ private JsonObject buildCourtApplicationParty(final CourtApplicationParty applic partyBuilder.add(NAME, applicant.getOrganisation().getName()); } else if (applicant.getPersonDetails() != null) { final Person person = applicant.getPersonDetails(); - partyBuilder.add(NAME, String.format("%s %s", person.getFirstName(), person.getLastName())); + partyBuilder.add(NAME, String.format(STRING_STRING, person.getFirstName(), person.getLastName())); ofNullable(person.getDateOfBirth()).ifPresent(dateOfBirth -> partyBuilder.add(DATE_OF_BIRTH, dateOfBirth.format(DOB_FORMATTER))); } else if (applicant.getRepresentationOrganisation() != null && applicant.getRepresentationOrganisation().getName() != null) { partyBuilder.add(NAME, applicant.getRepresentationOrganisation().getName()); @@ -414,7 +415,7 @@ private void addMasterDefendantToPartyBuilder(final MasterDefendant masterDefend if (masterDefendant.getPersonDefendant() != null && masterDefendant.getPersonDefendant().getPersonDetails() != null) { final Person person = masterDefendant.getPersonDefendant().getPersonDetails(); - partyBuilder.add(NAME, String.format("%s %s", person.getFirstName(), person.getLastName())); + partyBuilder.add(NAME, String.format(STRING_STRING, person.getFirstName(), person.getLastName())); ofNullable(person.getDateOfBirth()).ifPresent(dateOfBirth -> partyBuilder.add(DATE_OF_BIRTH, dateOfBirth.format(DOB_FORMATTER))); } else if (masterDefendant.getLegalEntityDefendant() != null && masterDefendant.getLegalEntityDefendant().getOrganisation() != null @@ -461,7 +462,7 @@ private JsonObject buildApplicantForCourtApplication(final CourtApplication cour } private void addApplicantPersonFields(final JsonObjectBuilder applicantBuilder, final Person person, final String organisationName, final String welshOrganisationName) { - final String fullName = String.format("%s %s", ofNullable(person.getFirstName()).orElse(""), ofNullable(person.getLastName()).orElse("")).trim(); + final String fullName = String.format(STRING_STRING, ofNullable(person.getFirstName()).orElse(""), ofNullable(person.getLastName()).orElse("")).trim(); applicantBuilder.add(NAME, fullName.isEmpty() ? "" : fullName); applicantBuilder.add(ORGANISATION_NAME, organisationName); applicantBuilder.add(WELSH_ORGANISATION_NAME, welshOrganisationName); @@ -790,7 +791,7 @@ private void buildOffence(final JsonObjectBuilder offenceBuilder, final Offence ofNullable(offence.getMaxPenalty()).ifPresent(maxPenalty -> offenceBuilder.add(MAX_PENALTY, maxPenalty)); ofNullable(offence.getConvictionDate()).ifPresent(convictedOn -> offenceBuilder.add(CONVICTED_ON, convictedOn.format(DATE_FORMATTER))); ofNullable(offence.getLastAdjournDate()).ifPresent(adjournedDate -> offenceBuilder.add(ADJOURNED_DATE, adjournedDate.format(DATE_FORMATTER))); - ofNullable(offence.getLastAdjournedHearingType()).ifPresent(adjournedHearingType -> offenceBuilder.add(ADJOURNED_HEARING_TYPE, adjournedHearingType.replaceAll("\n", ","))); + ofNullable(offence.getLastAdjournedHearingType()).ifPresent(adjournedHearingType -> offenceBuilder.add(ADJOURNED_HEARING_TYPE, adjournedHearingType.replace("\n", ","))); } private void setPleaAndPleaDateIfNotIndicatedNotGuilty(final JsonObjectBuilder offenceBuilder, final String plea, LocalDate pleaDate) { From 403031d80b146768a8b7b5b81a876b1cbde674cc Mon Sep 17 00:00:00 2001 From: Ertugrul Duran Date: Thu, 5 Mar 2026 19:52:34 +0000 Subject: [PATCH 11/39] LPT-2124:adding asn and gender --- .../progression.search.court.list.data.json | 2 ++ .../progression/query/CourtlistQueryView.java | 15 ++++++++++++--- .../query/CourtlistQueryViewTest.java | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json b/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json index d9f590aa15..6c1d08e485 100644 --- a/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json +++ b/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json @@ -64,6 +64,8 @@ "dateOfBirth": { "type": "string" }, "age": { "type": "string" }, "nationality": { "type": "string" }, + "asn": { "type": "string" }, + "gender": { "type": "string" }, "address": { "type": "object" }, "reportingRestrictions": { "type": "array" }, "offences": { "type": "array" } diff --git a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java index de9017fa81..bcad8f340e 100644 --- a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java +++ b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java @@ -431,14 +431,16 @@ private JsonObject buildApplicantForCourtApplication(final CourtApplication cour if (nonNull(applicant.getMasterDefendant())) { final MasterDefendant masterDefendant = applicant.getMasterDefendant(); if (nonNull(masterDefendant.getPersonDefendant()) && nonNull(masterDefendant.getPersonDefendant().getPersonDetails())) { - addApplicantPersonFields(applicantBuilder, masterDefendant.getPersonDefendant().getPersonDetails(), "", ""); + final PersonDefendant pd = masterDefendant.getPersonDefendant(); + final String asn = ofNullable(pd.getArrestSummonsNumber()).orElse(""); + addApplicantPersonFields(applicantBuilder, pd.getPersonDetails(), "", "", asn); } else if (nonNull(masterDefendant.getLegalEntityDefendant()) && nonNull(masterDefendant.getLegalEntityDefendant().getOrganisation())) { final Organisation org = masterDefendant.getLegalEntityDefendant().getOrganisation(); addApplicantOrganisationFields(applicantBuilder, org.getName(), ofNullable(org.getName()).orElse(""), true); } } else if (nonNull(applicant.getPersonDetails())) { final String orgName = ofNullable(applicant.getOrganisation()).map(org -> ofNullable(org.getName()).orElse("")).orElse(""); - addApplicantPersonFields(applicantBuilder, applicant.getPersonDetails(), orgName, ""); + addApplicantPersonFields(applicantBuilder, applicant.getPersonDetails(), orgName, "", ""); } else if (nonNull(applicant.getOrganisation())) { final Organisation org = applicant.getOrganisation(); addApplicantOrganisationFields(applicantBuilder, ofNullable(org.getName()).orElse(""), "", false); @@ -461,7 +463,8 @@ private JsonObject buildApplicantForCourtApplication(final CourtApplication cour return applicantBuilder.build(); } - private void addApplicantPersonFields(final JsonObjectBuilder applicantBuilder, final Person person, final String organisationName, final String welshOrganisationName) { + private void addApplicantPersonFields(final JsonObjectBuilder applicantBuilder, final Person person, final String organisationName, + final String welshOrganisationName, final String asn) { final String fullName = String.format(STRING_STRING, ofNullable(person.getFirstName()).orElse(""), ofNullable(person.getLastName()).orElse("")).trim(); applicantBuilder.add(NAME, fullName.isEmpty() ? "" : fullName); applicantBuilder.add(ORGANISATION_NAME, organisationName); @@ -472,6 +475,8 @@ private void addApplicantPersonFields(final JsonObjectBuilder applicantBuilder, ofNullable(person.getDateOfBirth()).ifPresent(dob -> applicantBuilder.add(DATE_OF_BIRTH, dob.format(DOB_FORMATTER))); ofNullable(getAge(person.getDateOfBirth())).ifPresent(age -> applicantBuilder.add(AGE, String.valueOf(age))); applicantBuilder.add(NATIONALITY, ofNullable(person.getNationalityDescription()).orElse("")); + applicantBuilder.add(ASN, ofNullable(asn).orElse("")); + applicantBuilder.add(GENDER, ofNullable(person.getGender()).map(Object::toString).orElse("")); ofNullable(person.getAddress()).ifPresent(addr -> applicantBuilder.add(ADDRESS, objectToJsonObjectConverter.convert(addr))); } @@ -485,6 +490,8 @@ private void addApplicantOrganisationFields(final JsonObjectBuilder applicantBui applicantBuilder.add(DATE_OF_BIRTH, ""); applicantBuilder.add(AGE, ""); applicantBuilder.add(NATIONALITY, ""); + applicantBuilder.add(ASN, ""); + applicantBuilder.add(GENDER, ""); if (withEmptyAddress) { applicantBuilder.add(ADDRESS, createObjectBuilder().build()); } @@ -499,6 +506,8 @@ private void addApplicantEmptyFields(final JsonObjectBuilder applicantBuilder) { applicantBuilder.add(DATE_OF_BIRTH, ""); applicantBuilder.add(AGE, ""); applicantBuilder.add(NATIONALITY, ""); + applicantBuilder.add(ASN, ""); + applicantBuilder.add(GENDER, ""); } private JsonArray buildApplicantReportingRestrictions(final CourtApplication courtApplication, final List offencesForApplications) { diff --git a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java index 5b12ee9e4c..163031821f 100644 --- a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java +++ b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java @@ -16,6 +16,7 @@ import uk.gov.justice.core.courts.CourtApplication; import uk.gov.justice.core.courts.CourtApplicationParty; +import uk.gov.justice.core.courts.Gender; import uk.gov.justice.core.courts.Hearing; import uk.gov.justice.core.courts.LegalEntityDefendant; import uk.gov.justice.core.courts.MasterDefendant; @@ -576,6 +577,8 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromProsecutin assertThat(result.getJsonArray("reportingRestrictions"), notNullValue()); assertThat(result.getJsonArray("offences"), notNullValue()); assertThat(result.getString("organisationName"), is("")); + assertThat(result.getString("asn"), is("")); + assertThat(result.getString("gender"), is("")); } @Test @@ -589,6 +592,8 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromOrganisati new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); assertThat(result.getString("organisationName"), is("Acme Organisation")); assertThat(result.getString("welshOrganisationName"), is("")); + assertThat(result.getString("asn"), is("")); + assertThat(result.getString("gender"), is("")); } @Test @@ -599,6 +604,7 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromPersonDeta .withFirstName("Alice") .withLastName("Brown") .withDateOfBirth(LocalDate.of(1992, 3, 10)) + .withGender(Gender.FEMALE) .build()) .build()) .build(); @@ -608,6 +614,8 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromPersonDeta assertThat(result.getString("surname"), is("Brown")); assertThat(result.getString("dateOfBirth"), is("10 Mar 1992")); assertThat(result.getString("organisationName"), is("")); + assertThat(result.getString("asn"), is("")); + assertThat(result.getString("gender"), is("FEMALE")); assertThat(result.getJsonArray("offences"), notNullValue()); } @@ -617,8 +625,10 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromMasterDefe when(person.getFirstName()).thenReturn("Bob"); when(person.getLastName()).thenReturn("Wilson"); when(person.getDateOfBirth()).thenReturn(LocalDate.of(1988, 7, 5)); + when(person.getGender()).thenReturn(Gender.MALE); final PersonDefendant personDefendant = mock(PersonDefendant.class); when(personDefendant.getPersonDetails()).thenReturn(person); + when(personDefendant.getArrestSummonsNumber()).thenReturn("APPLICANT-ASN-001"); final MasterDefendant masterDefendant = mock(MasterDefendant.class); when(masterDefendant.getPersonDefendant()).thenReturn(personDefendant); final CourtApplicationParty applicant = mock(CourtApplicationParty.class); @@ -630,6 +640,8 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromMasterDefe assertThat(result.getString("firstName"), is("Bob")); assertThat(result.getString("surname"), is("Wilson")); assertThat(result.getString("dateOfBirth"), is("5 Jul 1988")); + assertThat(result.getString("asn"), is("APPLICANT-ASN-001")); + assertThat(result.getString("gender"), is("MALE")); } @Test @@ -649,6 +661,8 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromMasterDefe final JsonObject result = invokePrivateMethod("buildApplicantForCourtApplication", new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); assertThat(result.getString("organisationName"), is("Corporate Defendant Ltd")); + assertThat(result.getString("asn"), is("")); + assertThat(result.getString("gender"), is("")); } @Test @@ -662,6 +676,8 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromRepresenta new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); assertThat(result.getString("name"), is("Solicitors Ltd")); assertThat(result.getString("organisationName"), is("")); + assertThat(result.getString("asn"), is("")); + assertThat(result.getString("gender"), is("")); assertThat(result.getJsonArray("reportingRestrictions"), notNullValue()); assertThat(result.getJsonArray("offences"), notNullValue()); } From 88205c83929f2ee355f42d536d557b6fb3f11f67 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Thu, 5 Mar 2026 21:01:11 +0000 Subject: [PATCH 12/39] more tests --- .../DefaultQueryApiCourtlistResourceTest.java | 30 +++ ...aultQueryApiCourtlistdataResourceTest.java | 20 ++ .../query/api/CourtlistQueryApiTest.java | 12 ++ .../service/CourtlistQueryServiceTest.java | 172 ++++++++++++++++++ .../query/CourtlistQueryViewTest.java | 27 +++ 5 files changed, 261 insertions(+) create mode 100644 progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResourceTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResourceTest.java index b324b21772..32af487fc4 100644 --- a/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResourceTest.java +++ b/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistResourceTest.java @@ -21,7 +21,9 @@ import static uk.gov.justice.api.resource.DefaultQueryApiCourtlistResource.COURT_LIST_QUERY_NAME; import static uk.gov.justice.api.resource.DefaultQueryApiCourtlistResource.PDF_DISPOSITION; import static uk.gov.justice.api.resource.DefaultQueryApiCourtlistResource.PRISON_COURT_LIST; +import static uk.gov.justice.api.resource.DefaultQueryApiCourtlistResource.PRISON_COURT_LIST_QUERY_NAME; import static uk.gov.justice.api.resource.DefaultQueryApiCourtlistResource.WORD_DISPOSITION; +import static org.mockito.Mockito.never; import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom; import static uk.gov.justice.services.test.utils.core.matchers.JsonEnvelopeMatcher.jsonEnvelope; import static uk.gov.justice.services.test.utils.core.matchers.JsonEnvelopePayloadMatcher.payload; @@ -202,6 +204,34 @@ public void shouldErrorWhenCourtListCalledForPrisonList() { assertThat(courtlistResponse.getStatus(), is(FORBIDDEN.getStatusCode())); } + @Test + public void shouldReturnDocumentWhenGetPrisonCourtlist() throws IOException { + final String pdfContent = "Prison List PDF"; + final JsonEnvelope interceptorResponse = envelopeFrom(metadataWithRandomUUID(PRISON_COURT_LIST_QUERY_NAME), + FileUtil.jsonFromPath("stub-data/progression.search.court.list.json")); + final byte[] documentGeneratorClientResponse = pdfContent.getBytes(); + + when(serviceContextSystemUserProvider.getContextSystemUserId()).thenReturn(Optional.of(systemUserId)); + when(courtlistQueryService.buildCourtlistQueryEnvelope(any(), any(), any(), any(), any(), anyBoolean(), any(), any())) + .thenReturn(envelopeFrom(metadataWithRandomUUID(PRISON_COURT_LIST_QUERY_NAME), FileUtil.jsonFromPath("stub-data/progression.search.court.list.json"))); + when(interceptorChainProcessor.process(any())).thenReturn(of(interceptorResponse)); + when(courtlistQueryService.buildEnrichedPayload(interceptorResponse)) + .thenReturn(FileUtil.jsonFromPath("stub-data/stagingpubhub.command.publish-standard-list.json")); + when(documentGeneratorClientProducer.documentGeneratorClient()).thenReturn(documentGeneratorClient); + when(documentGeneratorClient.generatePdfDocument(any(), anyString(), eq(systemUserId))) + .thenReturn(documentGeneratorClientResponse); + + final Response actual = defaultQueryApiCourtlistResource.getPrisonCourtlist( + courtCentreId.toString(), courtRoomId.toString(), startDate, endDate, userId); + + assertThat(actual.getStatus(), is(SC_OK)); + assertThat(IOUtils.toByteArray((InputStream) actual.getEntity()), is(pdfContent.getBytes())); + verify(courtlistQueryService).buildCourtlistQueryEnvelope( + eq(courtCentreId.toString()), eq(courtRoomId.toString()), eq(PRISON_COURT_LIST), eq(startDate), eq(endDate), + eq(false), eq(userId), eq(PRISON_COURT_LIST_QUERY_NAME)); + verify(stagingPubHubService, never()).publishStandardList(any(), any()); + } + private void verifyCourtlistQueryServiceExecution() { verify(courtlistQueryService).buildCourtlistQueryEnvelope( eq(courtCentreId.toString()), eq(courtRoomId.toString()), eq(listId.toString()), diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java index 19129a4383..c9a7d066b4 100644 --- a/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java +++ b/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java @@ -119,4 +119,24 @@ public void shouldReturnPrisonCourtListDataAsJsonWhenGetPrisonCourtlistdata() { verify(interceptorChainProcessor).process(org.mockito.ArgumentMatchers.any()); verify(courtlistQueryService).buildEnrichedPayload(interceptorResponse); } + + @Test + public void shouldPassRestrictedFlagWhenGetCourtlistdata() { + final JsonEnvelope interceptorResponse = envelopeFrom( + metadataWithRandomUUID(COURT_LIST_DATA_QUERY_NAME), + FileUtil.jsonFromPath("stub-data/progression.search.court.list.json")); + final JsonObject enrichedPayload = FileUtil.jsonFromPath("stub-data/stagingpubhub.command.publish-standard-list.json"); + + when(courtlistQueryService.buildCourtlistQueryEnvelope(any(), any(), any(), any(), any(), anyBoolean(), any(), any())) + .thenReturn(envelopeFrom(metadataWithRandomUUID(COURT_LIST_DATA_QUERY_NAME), FileUtil.jsonFromPath("stub-data/progression.search.court.list.json"))); + when(interceptorChainProcessor.process(any())).thenReturn(of(interceptorResponse)); + when(courtlistQueryService.buildEnrichedPayload(interceptorResponse)).thenReturn(enrichedPayload); + + defaultQueryApiCourtlistdataResource.getCourtlistdata( + courtCentreId, courtRoomId, listId, startDate, endDate, true, userId); + + verify(courtlistQueryService).buildCourtlistQueryEnvelope( + eq(courtCentreId), eq(courtRoomId), eq(listId), eq(startDate), eq(endDate), + eq(true), eq(userId), eq(COURT_LIST_DATA_QUERY_NAME)); + } } diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java index 02362ce270..96ae4f595e 100644 --- a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java +++ b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java @@ -40,4 +40,16 @@ public void shouldHandlePrisonCourtListQuery() { when(courtlistQueryView.searchPrisonCourtlist(query)).thenReturn(response); assertThat(courtListQueryApi.searchPrisonCourtlist(query), equalTo(response)); } + + @Test + public void shouldHandleSearchCourtlistDataQuery() { + when(courtlistQueryView.searchCourtlist(query)).thenReturn(response); + assertThat(courtListQueryApi.searchCourtlistData(query), equalTo(response)); + } + + @Test + public void shouldHandleSearchPrisonCourtlistDataQuery() { + when(courtlistQueryView.searchPrisonCourtlist(query)).thenReturn(response); + assertThat(courtListQueryApi.searchPrisonCourtlistData(query), equalTo(response)); + } } diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java new file mode 100644 index 0000000000..5f901ff14f --- /dev/null +++ b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java @@ -0,0 +1,172 @@ +package uk.gov.moj.cpp.progression.query.api.service; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom; + +import uk.gov.justice.api.resource.service.ReferenceDataService; +import uk.gov.justice.services.messaging.JsonEnvelope; +import uk.gov.justice.services.test.utils.core.messaging.MetadataBuilderFactory; + +import java.util.Optional; +import java.util.UUID; + +import javax.json.Json; +import javax.json.JsonObject; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class CourtlistQueryServiceTest { + + private static final String COURT_CENTRE_ID = "court-centre-123"; + private static final String COURT_ROOM_ID = "court-room-456"; + private static final String LIST_ID = "PUBLIC"; + private static final String START_DATE = "2025-01-01"; + private static final String END_DATE = "2025-01-31"; + private static final String COURT_LIST_ACTION = "progression.search.court.list.data"; + + @Mock + private ReferenceDataService referenceDataService; + + @InjectMocks + private CourtlistQueryService courtlistQueryService; + + @Test + void buildCourtlistQueryEnvelope_shouldIncludeAllPayloadFieldsAndUserIdWhenProvided() { + final UUID userId = UUID.randomUUID(); + + final JsonEnvelope result = courtlistQueryService.buildCourtlistQueryEnvelope( + COURT_CENTRE_ID, COURT_ROOM_ID, LIST_ID, START_DATE, END_DATE, false, userId, COURT_LIST_ACTION); + + assertThat(result, notNullValue()); + final JsonObject payload = result.payloadAsJsonObject(); + assertThat(payload.getString("courtCentreId"), is(COURT_CENTRE_ID)); + assertThat(payload.getString("courtRoomId"), is(COURT_ROOM_ID)); + assertThat(payload.getString("listId"), is(LIST_ID)); + assertThat(payload.getString("startDate"), is(START_DATE)); + assertThat(payload.getString("endDate"), is(END_DATE)); + assertThat(payload.getBoolean("restricted"), is(false)); + assertThat(result.metadata().userId(), is(Optional.of(userId.toString()))); + assertThat(result.metadata().name(), is(COURT_LIST_ACTION)); + } + + @Test + void buildCourtlistQueryEnvelope_shouldOmitCourtRoomIdWhenNull() { + final JsonEnvelope result = courtlistQueryService.buildCourtlistQueryEnvelope( + COURT_CENTRE_ID, null, LIST_ID, START_DATE, END_DATE, true, null, COURT_LIST_ACTION); + + assertThat(result, notNullValue()); + final JsonObject payload = result.payloadAsJsonObject(); + assertThat(payload.containsKey("courtRoomId"), is(false)); + assertThat(result.metadata().userId(), is(Optional.empty())); + } + + @Test + void buildCourtlistQueryEnvelope_shouldOmitUserIdWhenNull() { + final JsonEnvelope result = courtlistQueryService.buildCourtlistQueryEnvelope( + COURT_CENTRE_ID, COURT_ROOM_ID, LIST_ID, START_DATE, END_DATE, false, null, COURT_LIST_ACTION); + + assertThat(result, notNullValue()); + assertThat(result.metadata().userId(), is(Optional.empty())); + } + + @Test + void buildEnrichedPayload_shouldCopyPayloadWhenCourtCentreNameIsNull() { + final JsonObject originalPayload = Json.createObjectBuilder() + .add("listType", "public") + .build(); + final JsonEnvelope document = envelopeFrom( + MetadataBuilderFactory.metadataWithRandomUUID("test"), + originalPayload); + + final JsonObject result = courtlistQueryService.buildEnrichedPayload(document); + + assertThat(result, notNullValue()); + assertThat(result.getString("listType"), is("public")); + assertThat(result.containsKey("ouCode"), is(false)); + assertThat(result.containsKey("courtId"), is(false)); + assertThat(result.containsKey("courtIdNumeric"), is(false)); + } + + @Test + void buildEnrichedPayload_shouldEnrichWithCourtCentreDataWhenCourtCentreNamePresentAndReferenceDataReturnsData() { + final String courtCentreName = "Test Court"; + final JsonObject originalPayload = Json.createObjectBuilder() + .add("courtCentreName", courtCentreName) + .add("listType", "public") + .build(); + final JsonEnvelope document = envelopeFrom( + MetadataBuilderFactory.metadataWithRandomUUID("test"), + originalPayload); + + final JsonObject courtCentreData = Json.createObjectBuilder() + .add("oucode", "OU123") + .add("id", "court-id-1") + .add("courtId", "456") + .build(); + when(referenceDataService.getCourtCenterDataByCourtName(document, courtCentreName)) + .thenReturn(Optional.of(courtCentreData)); + + final JsonObject result = courtlistQueryService.buildEnrichedPayload(document); + + assertThat(result, notNullValue()); + assertThat(result.getString("courtCentreName"), is(courtCentreName)); + assertThat(result.getJsonString("ouCode").getString(), is("OU123")); + assertThat(result.getJsonString("courtId").getString(), is("court-id-1")); + assertThat(result.getString("courtIdNumeric"), is("456")); + verify(referenceDataService).getCourtCenterDataByCourtName(document, courtCentreName); + } + + @Test + void buildEnrichedPayload_shouldUseDefaultCourtIdNumericWhenNotInReferenceData() { + final String courtCentreName = "Other Court"; + final JsonObject originalPayload = Json.createObjectBuilder() + .add("courtCentreName", courtCentreName) + .build(); + final JsonEnvelope document = envelopeFrom( + MetadataBuilderFactory.metadataWithRandomUUID("test"), + originalPayload); + + final JsonObject courtCentreData = Json.createObjectBuilder() + .add("oucode", "OU456") + .add("id", "court-id-2") + .build(); + when(referenceDataService.getCourtCenterDataByCourtName(any(), eq(courtCentreName))) + .thenReturn(Optional.of(courtCentreData)); + + final JsonObject result = courtlistQueryService.buildEnrichedPayload(document); + + assertThat(result.getString("courtIdNumeric"), is("0")); + } + + @Test + void buildEnrichedPayload_shouldNotAddEnrichmentWhenReferenceDataReturnsEmpty() { + final String courtCentreName = "Unknown Court"; + final JsonObject originalPayload = Json.createObjectBuilder() + .add("courtCentreName", courtCentreName) + .build(); + final JsonEnvelope document = envelopeFrom( + MetadataBuilderFactory.metadataWithRandomUUID("test"), + originalPayload); + + when(referenceDataService.getCourtCenterDataByCourtName(any(), eq(courtCentreName))) + .thenReturn(Optional.empty()); + + final JsonObject result = courtlistQueryService.buildEnrichedPayload(document); + + assertThat(result.getString("courtCentreName"), is(courtCentreName)); + assertThat(result.containsKey("ouCode"), is(false)); + assertThat(result.containsKey("courtId"), is(false)); + assertThat(result.containsKey("courtIdNumeric"), is(false)); + } +} diff --git a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java index 163031821f..9547555169 100644 --- a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java +++ b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java @@ -426,6 +426,33 @@ public void shouldNotAddLjaInformationWhenCourtCentreIsNull() throws IOException assertThat(actual.containsKey("ljaName"), is(false)); } + @Test + public void shouldAddLjaInformationIncludingWelshLjaNameWhenCourtCentreHasLjaDetails() throws IOException { + final Optional listingResponse = Optional.of(getJsonPayload("listing-hearing-with-prosecution-case.json")); + final List hearingList = getHearings("courtlists.hearings.repository.all.json"); + when(listingService.searchCourtlist(any(JsonEnvelope.class))).thenReturn(listingResponse); + when(hearingQueryView.getHearings(any(List.class))).thenReturn(hearingList); + final ProsecutionCase prosecutionCase = getHearings("courtlists.hearings.repository.all.json").get(0).getProsecutionCases().get(0); + final ProsecutionCaseEntity prosecutionCaseEntity = new ProsecutionCaseEntity(); + prosecutionCaseEntity.setPayload(objectToJsonObjectConverter.convert(prosecutionCase).toString()); + when(prosecutionCaseRepository.findByCaseId(any())).thenReturn(prosecutionCaseEntity); + + final JsonEnvelope query = JsonEnvelope.envelopeFrom( + JsonEnvelope.metadataBuilder() + .withId(randomUUID()) + .withName("progression.search.court.list").build(), + Json.createObjectBuilder().build()); + + final JsonObject actual = courtlistQueryView.searchCourtlist(query).payloadAsJsonObject(); + + assertThat(actual.containsKey("ljaCode"), is(true)); + assertThat(actual.getString("ljaCode"), is("2577")); + assertThat(actual.containsKey("ljaName"), is(true)); + assertThat(actual.getString("ljaName"), is("South West London Magistrates' Court")); + assertThat(actual.containsKey("welshLjaName"), is(true)); + assertThat(actual.getString("welshLjaName"), is("East Hampshire Magistrates' Court")); + } + @Test public void shouldEnrichCourtlistDocumentPayloadForProsecutionCases_WhenHearingISPresentInListingButMissingInProgression() throws IOException { final Optional listingResponse = Optional.of(getJsonPayload("listing-hearing-with-prosecution-case-oneHearing-missing-in-progression.json")); From d06e3cac44548283cdafef2b87c7a5daf75d7f25 Mon Sep 17 00:00:00 2001 From: devops-team Date: Fri, 6 Mar 2026 10:33:41 +0000 Subject: [PATCH 13/39] New 17.0.231-cct-1981-SNAPSHOT --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index 8538bc91b5..8edf76e97d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index a9c57868ad..7cb7ca6da1 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index 92cfebe706..19d96613a7 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index 71888bf4d7..2a0d7c7bc0 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index eac0cd78da..ea2833be7d 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index 85f3322875..de1ce41fc7 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 4e0742e2eb..01624cee15 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index 0748878bde..cf259c7fd9 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index cfc8d77fc9..60b54a4058 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index c32b4f3558..e0ef83a7d3 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index 7c94e20f23..035ea73e44 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index 43895d8950..5f39c2a42f 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index 8ce0e60299..cf6635756e 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index ce0043e691..922f1933c3 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index b403721b09..8012de7968 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index 3c130ed3e7..00ed303262 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index cdde8400bf..0461266d98 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index 3cd3a9b412..498ce8e55f 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index f811b1fb1e..7df5cb8ce0 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index 71d2affab6..84c0b80fd8 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 498a56a504..71414fc28c 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 05e4e195ea..10c02ac08a 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index ce4c5fbad3..f668b7886e 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index bb622dc0b0..909c5a7b2c 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index 104ddf2b05..528ae69002 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index f583b582d4..a1afc8c481 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index 16e958d2cb..30afb444b7 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index 8d8ba83f2a..5b70b18798 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index e9dcf43d91..8332dd2a2c 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.230-cct-1981-SNAPSHOT + 17.0.231-cct-1981-SNAPSHOT progression-viewstore-persistence From 4e430e68542bf659e5afbb11d9364af81d3d5946 Mon Sep 17 00:00:00 2001 From: Ertugrul Duran Date: Fri, 6 Mar 2026 14:15:31 +0000 Subject: [PATCH 14/39] LPT-2127:Welsh language PDF not generated in STE52 for Online Public court list - Cardiff Magistrates' Court --- .../progression/query/api/service/CourtlistQueryService.java | 3 ++- .../src/raml/json/progression.search.court.list.data.json | 3 ++- .../raml/json/schema/progression.search.court.list.data.json | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java index 034cdafc90..ff10c61a4f 100644 --- a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java +++ b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java @@ -55,7 +55,7 @@ public JsonEnvelope buildCourtlistQueryEnvelope(final String courtCentreId, fina } /** - * Builds a JSON payload from the document, enriched with court centre data (ouCode, courtId, courtIdNumeric) + * Builds a JSON payload from the document, enriched with court centre data (ouCode, courtId, courtIdNumeric, isWelsh) * when available from reference data. courtIdNumeric is taken from reference data field "courtId", default "0". */ public JsonObject buildEnrichedPayload(final JsonEnvelope document) { @@ -70,6 +70,7 @@ public JsonObject buildEnrichedPayload(final JsonEnvelope document) { builder.add("ouCode", courtCentreData.getJsonString("oucode")); builder.add("courtId", courtCentreData.getJsonString("id")); builder.add("courtIdNumeric", courtCentreData.getString("courtId", "0")); + builder.add("isWelsh", courtCentreData.getBoolean("isWelsh", false)); }); } diff --git a/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json b/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json index 879e0d77ad..3d7efd9496 100644 --- a/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json +++ b/progression-query/progression-query-api/src/raml/json/progression.search.court.list.data.json @@ -144,5 +144,6 @@ ], "templateName": "PublicCourtList", "ouCode": "B01LY00", - "courtId": "f8254db1-1683-483e-afb3-b87fde5a0a26" + "courtId": "f8254db1-1683-483e-afb3-b87fde5a0a26", + "isWelsh": false } diff --git a/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json b/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json index 6c1d08e485..272f54146e 100644 --- a/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json +++ b/progression-query/progression-query-api/src/raml/json/schema/progression.search.court.list.data.json @@ -101,6 +101,10 @@ "type": "string", "description": "Court centre UUID from reference data (when available)", "format": "uuid" + }, + "isWelsh": { + "type": "boolean", + "description": "Whether the court centre is a Welsh court (from reference data when available)" } } } From 7c3673886736420c4a053b6fa9705b4f093f0802 Mon Sep 17 00:00:00 2001 From: Ertugrul Duran Date: Fri, 6 Mar 2026 14:40:06 +0000 Subject: [PATCH 15/39] Updating reference data version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8edf76e97d..dd66561892 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 17.0.72 1.0.6 6.4.1 - 17.103.126 + 17.103.127 17.0.125 17.0.144 17.0.37 From ac6dcf2861d8f90580c7db59e9478dfef3fabfe0 Mon Sep 17 00:00:00 2001 From: devops-team Date: Fri, 6 Mar 2026 16:19:09 +0000 Subject: [PATCH 16/39] New 17.0.232-cct-1981-SNAPSHOT --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index dd66561892..de412a85f7 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index 7cb7ca6da1..c0b61686d7 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index 19d96613a7..029df9fe5c 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index 2a0d7c7bc0..c74e63a2c2 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index ea2833be7d..acff9156e8 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index de1ce41fc7..6b8ffd6375 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 01624cee15..4aaf666e60 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index cf259c7fd9..ec93e3ac28 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index 60b54a4058..f944b87ac2 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index e0ef83a7d3..ce195bd1ed 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index 035ea73e44..c8e5b6913a 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index 5f39c2a42f..dc7aa3168d 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index cf6635756e..d30347f034 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 922f1933c3..6b1fc896bb 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index 8012de7968..99b24b4f01 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index 00ed303262..a3acfb044e 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index 0461266d98..0d79b0cfba 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index 498ce8e55f..6447455eb9 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index 7df5cb8ce0..e0232acdcc 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index 84c0b80fd8..69f6dcd174 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 71414fc28c..4ea0e40128 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 10c02ac08a..55722bb100 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index f668b7886e..ad4955b08c 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index 909c5a7b2c..e2efc2b857 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index 528ae69002..e62dd87ed1 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index a1afc8c481..ad50f098e0 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index 30afb444b7..d7c72c19ad 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index 5b70b18798..5dbd31e03e 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index 8332dd2a2c..eb9b03df49 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.231-cct-1981-SNAPSHOT + 17.0.232-cct-1981-SNAPSHOT progression-viewstore-persistence From 17645dac219771f0aa873d15548b059a0151c31f Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Sat, 7 Mar 2026 00:07:05 +0000 Subject: [PATCH 17/39] adding includeApplications to also include applications even though cases are already in the same hearing --- .../query/api/service/CourtlistQueryService.java | 3 ++- .../query/api/service/CourtlistQueryServiceTest.java | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java index ff10c61a4f..4e0208aed9 100644 --- a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java +++ b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java @@ -39,7 +39,8 @@ public JsonEnvelope buildCourtlistQueryEnvelope(final String courtCentreId, fina .add("listId", listId) .add("startDate", startDate) .add("endDate", endDate) - .add("restricted", restricted); + .add("restricted", restricted) + .add("includeApplications", true); if (nonNull(courtRoomId)) { payloadBuilder.add("courtRoomId", courtRoomId); diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java index 5f901ff14f..2811adab70 100644 --- a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java +++ b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java @@ -56,10 +56,19 @@ void buildCourtlistQueryEnvelope_shouldIncludeAllPayloadFieldsAndUserIdWhenProvi assertThat(payload.getString("startDate"), is(START_DATE)); assertThat(payload.getString("endDate"), is(END_DATE)); assertThat(payload.getBoolean("restricted"), is(false)); + assertThat(payload.getBoolean("includeApplications"), is(true)); assertThat(result.metadata().userId(), is(Optional.of(userId.toString()))); assertThat(result.metadata().name(), is(COURT_LIST_ACTION)); } + @Test + void buildCourtlistQueryEnvelope_shouldIncludeIncludeApplicationsTrueForListing() { + final JsonEnvelope result = courtlistQueryService.buildCourtlistQueryEnvelope( + COURT_CENTRE_ID, null, LIST_ID, START_DATE, END_DATE, false, null, COURT_LIST_ACTION); + + assertThat(result.payloadAsJsonObject().getBoolean("includeApplications"), is(true)); + } + @Test void buildCourtlistQueryEnvelope_shouldOmitCourtRoomIdWhenNull() { final JsonEnvelope result = courtlistQueryService.buildCourtlistQueryEnvelope( From 38609c981b5d66638ea538f0963c5a44e3b44d07 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Sat, 7 Mar 2026 01:41:05 +0000 Subject: [PATCH 18/39] adding includeApplications to also include applications even though cases are already in the same hearing --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de412a85f7..23dc4eed69 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 1.0.6 6.4.1 17.103.127 - 17.0.125 + 17.103.145 17.0.144 17.0.37 17.0.85 From a744278c1c07231155b5a7794dba6613165fdb08 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Sat, 7 Mar 2026 15:07:45 +0000 Subject: [PATCH 19/39] includeApplications --- .../api/service/CourtlistQueryService.java | 3 +- .../service/CourtlistQueryServiceTest.java | 9 ------ .../query/view/service/ListingService.java | 16 +++++++++- .../view/service/ListingServiceTest.java | 31 +++++++++++++++++-- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java index 4e0208aed9..ff10c61a4f 100644 --- a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java +++ b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryService.java @@ -39,8 +39,7 @@ public JsonEnvelope buildCourtlistQueryEnvelope(final String courtCentreId, fina .add("listId", listId) .add("startDate", startDate) .add("endDate", endDate) - .add("restricted", restricted) - .add("includeApplications", true); + .add("restricted", restricted); if (nonNull(courtRoomId)) { payloadBuilder.add("courtRoomId", courtRoomId); diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java index 2811adab70..5f901ff14f 100644 --- a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java +++ b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/service/CourtlistQueryServiceTest.java @@ -56,19 +56,10 @@ void buildCourtlistQueryEnvelope_shouldIncludeAllPayloadFieldsAndUserIdWhenProvi assertThat(payload.getString("startDate"), is(START_DATE)); assertThat(payload.getString("endDate"), is(END_DATE)); assertThat(payload.getBoolean("restricted"), is(false)); - assertThat(payload.getBoolean("includeApplications"), is(true)); assertThat(result.metadata().userId(), is(Optional.of(userId.toString()))); assertThat(result.metadata().name(), is(COURT_LIST_ACTION)); } - @Test - void buildCourtlistQueryEnvelope_shouldIncludeIncludeApplicationsTrueForListing() { - final JsonEnvelope result = courtlistQueryService.buildCourtlistQueryEnvelope( - COURT_CENTRE_ID, null, LIST_ID, START_DATE, END_DATE, false, null, COURT_LIST_ACTION); - - assertThat(result.payloadAsJsonObject().getBoolean("includeApplications"), is(true)); - } - @Test void buildCourtlistQueryEnvelope_shouldOmitCourtRoomIdWhenNull() { final JsonEnvelope result = courtlistQueryService.buildCourtlistQueryEnvelope( diff --git a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/view/service/ListingService.java b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/view/service/ListingService.java index 80cf05142b..c2ac8c2d4a 100644 --- a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/view/service/ListingService.java +++ b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/view/service/ListingService.java @@ -15,7 +15,9 @@ import java.util.Optional; import javax.inject.Inject; +import javax.json.Json; import javax.json.JsonObject; +import javax.json.JsonObjectBuilder; @SuppressWarnings("squid:CallToDeprecatedMethod") public class ListingService { @@ -33,9 +35,21 @@ public Optional searchCourtlist(final JsonEnvelope envelope) { final MetadataBuilder metadataBuilder = metadataFrom(envelope.metadata()) .withName("listing.search.court.list.payload"); - final JsonEnvelope requestEnvelope = envelopeFrom(metadataBuilder, envelope.payloadAsJsonObject()); + final JsonObject payloadWithIncludeApplications = ensureIncludeApplications(envelope.payloadAsJsonObject()); + final JsonEnvelope requestEnvelope = envelopeFrom(metadataBuilder, payloadWithIncludeApplications); final JsonEnvelope jsonResultEnvelope = requester.requestAsAdmin(requestEnvelope); return nonNull(jsonResultEnvelope) ? ofNullable(jsonResultEnvelope.payloadAsJsonObject()) : Optional.empty(); } + + /** + * Ensures includeApplications=true is in the payload so listing returns court list with applications. + * Set here so the param is always sent to listing regardless of how the upstream envelope was built. + */ + private static JsonObject ensureIncludeApplications(final JsonObject payload) { + final JsonObjectBuilder builder = Json.createObjectBuilder(); + payload.keySet().forEach(key -> builder.add(key, payload.get(key))); + builder.add("includeApplications", true); + return builder.build(); + } } diff --git a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java index 8ace9f50c7..8ab17a13d3 100644 --- a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java +++ b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java @@ -4,6 +4,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static uk.gov.justice.services.messaging.Envelope.metadataBuilder; import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom; @@ -22,9 +23,10 @@ import javax.json.JsonObject; import org.junit.jupiter.api.Test; - import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks;import org.mockito.Mock; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; @@ -69,4 +71,29 @@ public void shouldSearchCourtlistDetails() { //then assertThat(result.get().getString("key"), is("value")); } + + @Test + public void shouldSendIncludeApplicationsTrueToListing() { + final JsonObject queryPayload = Json.createObjectBuilder() + .add("courtCentreId", "centre-1") + .add("listId", "PUBLIC") + .add("startDate", "2025-01-01") + .add("endDate", "2025-01-31") + .build(); + final JsonEnvelope query = envelopeFrom( + metadataBuilder().withName("progression.search.court.list").withId(randomUUID()).build(), + queryPayload); + + final ArgumentCaptor envelopeCaptor = ArgumentCaptor.forClass(JsonEnvelope.class); + when(requester.requestAsAdmin(any())).thenReturn(envelopeFrom( + metadataBuilder().withName("listing.search.court.list.payload").withId(randomUUID()).build(), + Json.createObjectBuilder().build())); + + listingService.searchCourtlist(query); + + verify(requester).requestAsAdmin(envelopeCaptor.capture()); + final JsonObject sentPayload = envelopeCaptor.getValue().payloadAsJsonObject(); + assertThat(sentPayload.containsKey("includeApplications"), is(true)); + assertThat(sentPayload.getBoolean("includeApplications"), is(true)); + } } From ce8088bad3bebff3a1982f57f25e446cb80ae3b8 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Sat, 7 Mar 2026 15:27:59 +0000 Subject: [PATCH 20/39] merge from main --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index 9de98b7183..b533ddb789 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index c0b61686d7..c889244b52 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index 029df9fe5c..6132758c1d 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index c74e63a2c2..b2a7157a6f 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index acff9156e8..761ed486bc 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index 6b8ffd6375..9ac813239e 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 4aaf666e60..62acb59082 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index ec93e3ac28..b10f5abab8 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index f944b87ac2..383b73391a 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index ce195bd1ed..5176d372e3 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index c8e5b6913a..e3b587fd8c 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index dc7aa3168d..8d161c0dfc 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index d30347f034..50ae92d08f 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 6b1fc896bb..69d1f8afdd 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index 99b24b4f01..efbcb6e599 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index a3acfb044e..4198e8292f 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index 0d79b0cfba..e681fab9c7 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index 6447455eb9..c132012016 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index e0232acdcc..83d5193e1f 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index 69f6dcd174..06db0c31dd 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 4ea0e40128..564adef41e 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 55722bb100..234d7effac 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index ad4955b08c..067802ed64 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index e2efc2b857..3a25eae75f 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index e62dd87ed1..6092167a22 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index ad50f098e0..2b3259a524 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index d7c72c19ad..a912299c41 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index 5dbd31e03e..b43b2b5012 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index eb9b03df49..b0ef7965b9 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.232-cct-1981-SNAPSHOT + 17.0.235-cct-1981-SNAPSHOT progression-viewstore-persistence From b391e504246a27bd29591391313ab63a99b7f76d Mon Sep 17 00:00:00 2001 From: devops-team Date: Sat, 7 Mar 2026 17:08:28 +0000 Subject: [PATCH 21/39] New 17.0.236-cct-1981-SNAPSHOT --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index b533ddb789..7d904dd937 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index c889244b52..de3fabb6c3 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index 6132758c1d..dce32f7847 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index b2a7157a6f..94d5f2761c 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index 761ed486bc..20102a926c 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index 9ac813239e..31c747b14b 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 62acb59082..f7675ed295 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index b10f5abab8..3a8e2891b8 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index 383b73391a..e20a86c6de 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index 5176d372e3..2386d5f2fa 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index e3b587fd8c..26e2e9d22a 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index 8d161c0dfc..77bb3fc900 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index 50ae92d08f..2a0935f4ff 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 69d1f8afdd..f1b849307e 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index efbcb6e599..9f75f3ea59 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index 4198e8292f..deab10eabe 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index e681fab9c7..ea5a13234f 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index c132012016..628977ce78 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index 83d5193e1f..e0a48845e0 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index 06db0c31dd..4cbf6a2a5c 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 564adef41e..2e80f95248 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 234d7effac..1bd33290b1 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index 067802ed64..9789b579e3 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index 3a25eae75f..e7f9b1f0bc 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index 6092167a22..d74e10aad0 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index 2b3259a524..b4fc970cd1 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index a912299c41..cd8346a927 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index b43b2b5012..555503a1ce 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index b0ef7965b9..f4a8c26664 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.235-cct-1981-SNAPSHOT + 17.0.236-cct-1981-SNAPSHOT progression-viewstore-persistence From 2739612e4af70ccd520c10192e09ecd3e290fadc Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Mon, 9 Mar 2026 02:41:16 +0000 Subject: [PATCH 22/39] includeApplications params --- pom.xml | 2 +- .../DefaultQueryApiCourtlistdataResource.java | 67 --------- .../QueryApiCourtlistdataResource.java | 33 ---- .../query/api/CourtlistQueryApi.java | 34 ++++- ...aultQueryApiCourtlistdataResourceTest.java | 142 ------------------ .../query/api/CourtlistQueryApiTest.java | 57 +++++-- .../query/api/StubCourtlistQueryView.java | 32 ++++ .../query/view/service/ListingService.java | 16 +- .../view/service/ListingServiceTest.java | 31 +--- 9 files changed, 113 insertions(+), 301 deletions(-) delete mode 100644 progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResource.java delete mode 100644 progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/QueryApiCourtlistdataResource.java delete mode 100644 progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java create mode 100644 progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/StubCourtlistQueryView.java diff --git a/pom.xml b/pom.xml index 7d904dd937..73f568109d 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 1.0.6 6.4.1 17.103.127 - 17.103.145 + 17.103.147-cct-1981-SNAPSHOT 17.0.144 17.0.37 17.0.85 diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResource.java b/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResource.java deleted file mode 100644 index f07e826d89..0000000000 --- a/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResource.java +++ /dev/null @@ -1,67 +0,0 @@ -package uk.gov.justice.api.resource; - -import static javax.ws.rs.core.Response.Status.FORBIDDEN; -import static javax.ws.rs.core.Response.ok; -import static javax.ws.rs.core.Response.status; -import static uk.gov.justice.services.core.interceptor.InterceptorContext.interceptorContextWithInput; - -import uk.gov.moj.cpp.progression.query.api.service.CourtlistQueryService; -import uk.gov.justice.services.core.annotation.Adapter; -import uk.gov.justice.services.core.annotation.Component; -import uk.gov.justice.services.core.interceptor.InterceptorChainProcessor; -import uk.gov.justice.services.messaging.JsonEnvelope; - -import java.util.UUID; - -import javax.ejb.Stateless; -import javax.inject.Inject; -import javax.json.JsonObject; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Returns court list data as JSON. Same parameters and access control as /courtlist, - * but no PDF/Word generation and no pubhub. Shares logic with DefaultQueryApiCourtlistResource - * via CourtlistQueryService. - */ -@Stateless -@Adapter(Component.QUERY_API) -public class DefaultQueryApiCourtlistdataResource implements QueryApiCourtlistdataResource { - - private static final String PRISON_COURT_LIST = "PRISON"; - private static final String COURT_LIST_DATA_QUERY_NAME = "progression.search.court.list.data"; - private static final String PRISON_COURT_LIST_DATA_QUERY_NAME = "progression.search.prison.court.list.data"; - - @Inject - private CourtlistQueryService courtlistQueryService; - - @Inject - private InterceptorChainProcessor interceptorChainProcessor; - - @Override - public Response getCourtlistdata(final String courtCentreId, final String courtRoomId, final String listId, - final String startDate, final String endDate, final boolean restricted, final UUID userId) { - if (PRISON_COURT_LIST.equals(listId)) { - return status(FORBIDDEN).build(); - } - return getCourtlistdataInternal(courtCentreId, courtRoomId, listId, startDate, endDate, restricted, userId, COURT_LIST_DATA_QUERY_NAME); - } - - @Override - public Response getPrisonCourtlistdata(final String courtCentreId, final String courtRoomId, - final String startDate, final String endDate, final UUID userId) { - return getCourtlistdataInternal(courtCentreId, courtRoomId, PRISON_COURT_LIST, startDate, endDate, false, userId, PRISON_COURT_LIST_DATA_QUERY_NAME); - } - - private Response getCourtlistdataInternal(final String courtCentreId, final String courtRoomId, final String listId, - final String startDate, final String endDate, final boolean restricted, - final UUID userId, final String courtListAction) { - final JsonEnvelope queryEnvelope = courtlistQueryService.buildCourtlistQueryEnvelope( - courtCentreId, courtRoomId, listId, startDate, endDate, restricted, userId, courtListAction); - final JsonEnvelope document = interceptorChainProcessor.process(interceptorContextWithInput(queryEnvelope)).get(); - - final JsonObject enrichedPayload = courtlistQueryService.buildEnrichedPayload(document); - - return ok(enrichedPayload).type(MediaType.APPLICATION_JSON_TYPE).build(); - } -} diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/QueryApiCourtlistdataResource.java b/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/QueryApiCourtlistdataResource.java deleted file mode 100644 index 72e12dd426..0000000000 --- a/progression-query/progression-query-api/src/main/java/uk/gov/justice/api/resource/QueryApiCourtlistdataResource.java +++ /dev/null @@ -1,33 +0,0 @@ -package uk.gov.justice.api.resource; - -import uk.gov.justice.services.common.http.HeaderConstants; - -import java.util.UUID; - -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Response; - -@Path("courtlistdata") -public interface QueryApiCourtlistdataResource { - @GET - @Produces("application/vnd.progression.search.court.list.data+json") - Response getCourtlistdata(@QueryParam("courtCentreId") String courtCentreId, - @QueryParam("courtRoomId") String courtRoomId, - @QueryParam("listId") String listId, - @QueryParam("startDate") String startDate, - @QueryParam("endDate") String endDate, - @QueryParam("restricted") boolean restricted, - @HeaderParam(HeaderConstants.USER_ID) UUID userId); - - @GET - @Produces("application/vnd.progression.search.prison.court.list.data+json") - Response getPrisonCourtlistdata(@QueryParam("courtCentreId") String courtCentreId, - @QueryParam("courtRoomId") String courtRoomId, - @QueryParam("startDate") String startDate, - @QueryParam("endDate") String endDate, - @HeaderParam(HeaderConstants.USER_ID) UUID userId); -} diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java index b89a43b3c4..c68065e46d 100644 --- a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java +++ b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java @@ -1,12 +1,18 @@ package uk.gov.moj.cpp.progression.query.api; +import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom; + import uk.gov.justice.services.core.annotation.Component; import uk.gov.justice.services.core.annotation.Handles; import uk.gov.justice.services.core.annotation.ServiceComponent; import uk.gov.justice.services.messaging.JsonEnvelope; import uk.gov.moj.cpp.progression.query.CourtlistQueryView; +import uk.gov.moj.cpp.progression.query.api.service.CourtlistQueryService; import javax.inject.Inject; +import javax.json.Json; +import javax.json.JsonObject; +import javax.json.JsonObjectBuilder; @ServiceComponent(Component.QUERY_API) public class CourtlistQueryApi { @@ -14,6 +20,9 @@ public class CourtlistQueryApi { @Inject private CourtlistQueryView courtlistQueryView; + @Inject + private CourtlistQueryService courtlistQueryService; + @Handles("progression.search.court.list") public JsonEnvelope searchCourtlist(final JsonEnvelope query) { return courtlistQueryView.searchCourtlist(query); @@ -26,11 +35,32 @@ public JsonEnvelope searchPrisonCourtlist(final JsonEnvelope query) { @Handles("progression.search.court.list.data") public JsonEnvelope searchCourtlistData(final JsonEnvelope query) { - return courtlistQueryView.searchCourtlist(query); + final JsonEnvelope queryWithApplications = ensureIncludeApplications(query); + final JsonEnvelope respEnv = courtlistQueryView.searchCourtlist(queryWithApplications); + return enrichCourtListJsonData(queryWithApplications, respEnv); } @Handles("progression.search.prison.court.list.data") public JsonEnvelope searchPrisonCourtlistData(final JsonEnvelope query) { - return courtlistQueryView.searchPrisonCourtlist(query); + final JsonEnvelope queryWithApplications = ensureIncludeApplications(query); + final JsonEnvelope respEnv = courtlistQueryView.searchPrisonCourtlist(queryWithApplications); + return enrichCourtListJsonData(queryWithApplications, respEnv); + } + + private JsonEnvelope enrichCourtListJsonData(final JsonEnvelope query, final JsonEnvelope respEnv) { + final JsonObject enrichedPayload = courtlistQueryService.buildEnrichedPayload(respEnv); + return envelopeFrom(query.metadata(), enrichedPayload); + } + + /** + * Ensures includeApplications=true is in the payload so listing returns court list with applications. + * Set here so the param is always sent to listing regardless of how the upstream envelope was built. + */ + private static JsonEnvelope ensureIncludeApplications(final JsonEnvelope query) { + final JsonObjectBuilder builder = Json.createObjectBuilder(); + final JsonObject payload = query.payloadAsJsonObject(); + payload.keySet().forEach(key -> builder.add(key, payload.get(key))); + builder.add("includeApplications", true); + return envelopeFrom(query.metadata(), builder.build()); } } diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java deleted file mode 100644 index c9a7d066b4..0000000000 --- a/progression-query/progression-query-api/src/test/java/uk/gov/justice/api/resource/DefaultQueryApiCourtlistdataResourceTest.java +++ /dev/null @@ -1,142 +0,0 @@ -package uk.gov.justice.api.resource; - -import static javax.ws.rs.core.Response.Status.FORBIDDEN; -import static org.apache.http.HttpStatus.SC_OK; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyBoolean; -import static java.util.Optional.of; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom; -import static uk.gov.justice.services.test.utils.core.messaging.MetadataBuilderFactory.metadataWithRandomUUID; -import static uk.gov.justice.services.test.utils.core.random.RandomGenerator.STRING; - -import uk.gov.justice.api.resource.utils.FileUtil; -import uk.gov.justice.services.core.interceptor.InterceptorChainProcessor; -import uk.gov.justice.services.messaging.JsonEnvelope; -import uk.gov.moj.cpp.progression.query.api.service.CourtlistQueryService; - -import java.util.UUID; - -import javax.json.JsonObject; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -/** - * Integration tests for GET /courtlistdata (standard and prison list data as JSON). - */ -@ExtendWith(MockitoExtension.class) -public class DefaultQueryApiCourtlistdataResourceTest { - - private static final String COURT_LIST_DATA_QUERY_NAME = "progression.search.court.list.data"; - private static final String PRISON_COURT_LIST = "PRISON"; - private static final String PRISON_COURT_LIST_DATA_QUERY_NAME = "progression.search.prison.court.list.data"; - - private final UUID userId = UUID.randomUUID(); - private final String courtCentreId = UUID.randomUUID().toString(); - private final String courtRoomId = UUID.randomUUID().toString(); - private final String listId = "PUBLIC"; - private final String startDate = STRING.next(); - private final String endDate = STRING.next(); - - @Mock - private CourtlistQueryService courtlistQueryService; - - @Mock - private InterceptorChainProcessor interceptorChainProcessor; - - @InjectMocks - private DefaultQueryApiCourtlistdataResource defaultQueryApiCourtlistdataResource; - - @Test - public void shouldReturnCourtListDataAsJsonWhenGetCourtlistdata() { - final JsonEnvelope interceptorResponse = envelopeFrom( - metadataWithRandomUUID(COURT_LIST_DATA_QUERY_NAME), - FileUtil.jsonFromPath("stub-data/progression.search.court.list.json")); - final JsonObject enrichedPayload = FileUtil.jsonFromPath("stub-data/stagingpubhub.command.publish-standard-list.json"); - - when(courtlistQueryService.buildCourtlistQueryEnvelope(any(), any(), any(), any(), any(), anyBoolean(), any(), any())) - .thenReturn(envelopeFrom(metadataWithRandomUUID(COURT_LIST_DATA_QUERY_NAME), FileUtil.jsonFromPath("stub-data/progression.search.court.list.json"))); - when(interceptorChainProcessor.process(any())).thenReturn(of(interceptorResponse)); - when(courtlistQueryService.buildEnrichedPayload(interceptorResponse)) - .thenReturn(enrichedPayload); - - final Response response = defaultQueryApiCourtlistdataResource.getCourtlistdata( - courtCentreId, courtRoomId, listId, startDate, endDate, false, userId); - - assertThat(response.getStatus(), is(SC_OK)); - assertThat(response.getMediaType(), is(MediaType.APPLICATION_JSON_TYPE)); - assertEquals(enrichedPayload, response.getEntity()); - - verify(courtlistQueryService).buildCourtlistQueryEnvelope( - eq(courtCentreId), eq(courtRoomId), eq(listId), eq(startDate), eq(endDate), - eq(false), eq(userId), eq(COURT_LIST_DATA_QUERY_NAME)); - verify(interceptorChainProcessor).process(org.mockito.ArgumentMatchers.any()); - verify(courtlistQueryService).buildEnrichedPayload(interceptorResponse); - } - - @Test - public void shouldReturnForbiddenWhenGetCourtlistdataWithPrisonListId() { - final Response response = defaultQueryApiCourtlistdataResource.getCourtlistdata( - courtCentreId, courtRoomId, "PRISON", startDate, endDate, false, userId); - - assertThat(response.getStatus(), is(FORBIDDEN.getStatusCode())); - } - - @Test - public void shouldReturnPrisonCourtListDataAsJsonWhenGetPrisonCourtlistdata() { - final JsonEnvelope interceptorResponse = envelopeFrom( - metadataWithRandomUUID(PRISON_COURT_LIST_DATA_QUERY_NAME), - FileUtil.jsonFromPath("stub-data/progression.search.usher.list.json")); - final JsonObject enrichedPayload = FileUtil.jsonFromPath("stub-data/stagingpubhub.command.ushers-standard-list.json"); - - when(courtlistQueryService.buildCourtlistQueryEnvelope(any(), any(), any(), any(), any(), anyBoolean(), any(), any())) - .thenReturn(envelopeFrom(metadataWithRandomUUID(PRISON_COURT_LIST_DATA_QUERY_NAME), FileUtil.jsonFromPath("stub-data/progression.search.usher.list.json"))); - when(interceptorChainProcessor.process(any())).thenReturn(of(interceptorResponse)); - when(courtlistQueryService.buildEnrichedPayload(interceptorResponse)) - .thenReturn(enrichedPayload); - - final Response response = defaultQueryApiCourtlistdataResource.getPrisonCourtlistdata( - courtCentreId, courtRoomId, startDate, endDate, userId); - - assertThat(response.getStatus(), is(SC_OK)); - assertThat(response.getMediaType(), is(MediaType.APPLICATION_JSON_TYPE)); - assertEquals(enrichedPayload, response.getEntity()); - - verify(courtlistQueryService).buildCourtlistQueryEnvelope( - eq(courtCentreId), eq(courtRoomId), eq(PRISON_COURT_LIST), eq(startDate), eq(endDate), - eq(false), eq(userId), eq(PRISON_COURT_LIST_DATA_QUERY_NAME)); - verify(interceptorChainProcessor).process(org.mockito.ArgumentMatchers.any()); - verify(courtlistQueryService).buildEnrichedPayload(interceptorResponse); - } - - @Test - public void shouldPassRestrictedFlagWhenGetCourtlistdata() { - final JsonEnvelope interceptorResponse = envelopeFrom( - metadataWithRandomUUID(COURT_LIST_DATA_QUERY_NAME), - FileUtil.jsonFromPath("stub-data/progression.search.court.list.json")); - final JsonObject enrichedPayload = FileUtil.jsonFromPath("stub-data/stagingpubhub.command.publish-standard-list.json"); - - when(courtlistQueryService.buildCourtlistQueryEnvelope(any(), any(), any(), any(), any(), anyBoolean(), any(), any())) - .thenReturn(envelopeFrom(metadataWithRandomUUID(COURT_LIST_DATA_QUERY_NAME), FileUtil.jsonFromPath("stub-data/progression.search.court.list.json"))); - when(interceptorChainProcessor.process(any())).thenReturn(of(interceptorResponse)); - when(courtlistQueryService.buildEnrichedPayload(interceptorResponse)).thenReturn(enrichedPayload); - - defaultQueryApiCourtlistdataResource.getCourtlistdata( - courtCentreId, courtRoomId, listId, startDate, endDate, true, userId); - - verify(courtlistQueryService).buildCourtlistQueryEnvelope( - eq(courtCentreId), eq(courtRoomId), eq(listId), eq(startDate), eq(endDate), - eq(true), eq(userId), eq(COURT_LIST_DATA_QUERY_NAME)); - } -} diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java index 96ae4f595e..c395f07c99 100644 --- a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java +++ b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java @@ -3,19 +3,25 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; +import static uk.gov.justice.services.messaging.JsonEnvelope.metadataBuilder; import uk.gov.justice.services.messaging.JsonEnvelope; -import uk.gov.moj.cpp.progression.query.CourtlistQueryView; +import uk.gov.moj.cpp.progression.query.api.service.CourtlistQueryService; -import org.junit.jupiter.api.Test; +import java.lang.reflect.Field; +import java.util.UUID; + +import javax.json.Json; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks;import org.mockito.Mock; +import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; + @ExtendWith(MockitoExtension.class) public class CourtlistQueryApiTest { - @Mock private JsonEnvelope query; @@ -23,33 +29,60 @@ public class CourtlistQueryApiTest { private JsonEnvelope response; @Mock - private CourtlistQueryView courtlistQueryView; + private CourtlistQueryService courtlistQueryService; - @InjectMocks + private StubCourtlistQueryView stubCourtlistQueryView; private CourtlistQueryApi courtListQueryApi; + @BeforeEach + public void setUp() throws Exception { + stubCourtlistQueryView = new StubCourtlistQueryView(); + courtListQueryApi = new CourtlistQueryApi(); + setField(courtListQueryApi, "courtlistQueryView", stubCourtlistQueryView); + setField(courtListQueryApi, "courtlistQueryService", courtlistQueryService); + } @Test public void shouldHandleApplicationQuery() { - when(courtlistQueryView.searchCourtlist(query)).thenReturn(response); + stubCourtlistQueryView.setSearchCourtlistResponse(response); assertThat(courtListQueryApi.searchCourtlist(query), equalTo(response)); } @Test public void shouldHandlePrisonCourtListQuery() { - when(courtlistQueryView.searchPrisonCourtlist(query)).thenReturn(response); + stubCourtlistQueryView.setSearchPrisonCourtlistResponse(response); assertThat(courtListQueryApi.searchPrisonCourtlist(query), equalTo(response)); } @Test public void shouldHandleSearchCourtlistDataQuery() { - when(courtlistQueryView.searchCourtlist(query)).thenReturn(response); - assertThat(courtListQueryApi.searchCourtlistData(query), equalTo(response)); + stubCourtlistQueryView.setSearchCourtlistResponse(response); + var enrichedPayload = Json.createObjectBuilder().build(); + when(courtlistQueryService.buildEnrichedPayload(response)).thenReturn(enrichedPayload); + var metadata = metadataBuilder().withId(UUID.randomUUID()).withName("test").build(); + when(query.metadata()).thenReturn(metadata); + when(query.payloadAsJsonObject()).thenReturn(Json.createObjectBuilder().build()); + var result = courtListQueryApi.searchCourtlistData(query); + assertThat(result.metadata().name(), equalTo(metadata.name())); + assertThat(result.payloadAsJsonObject(), equalTo(enrichedPayload)); } @Test public void shouldHandleSearchPrisonCourtlistDataQuery() { - when(courtlistQueryView.searchPrisonCourtlist(query)).thenReturn(response); - assertThat(courtListQueryApi.searchPrisonCourtlistData(query), equalTo(response)); + stubCourtlistQueryView.setSearchPrisonCourtlistResponse(response); + var enrichedPayload = Json.createObjectBuilder().build(); + when(courtlistQueryService.buildEnrichedPayload(response)).thenReturn(enrichedPayload); + var metadata = metadataBuilder().withId(UUID.randomUUID()).withName("test").build(); + when(query.metadata()).thenReturn(metadata); + when(query.payloadAsJsonObject()).thenReturn(Json.createObjectBuilder().build()); + var result = courtListQueryApi.searchPrisonCourtlistData(query); + assertThat(result.metadata().name(), equalTo(metadata.name())); + assertThat(result.payloadAsJsonObject(), equalTo(enrichedPayload)); + } + + private static void setField(Object target, String fieldName, Object value) throws Exception { + Field field = target.getClass().getDeclaredField(fieldName); + field.setAccessible(true); + field.set(target, value); } } diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/StubCourtlistQueryView.java b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/StubCourtlistQueryView.java new file mode 100644 index 0000000000..1057329cfa --- /dev/null +++ b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/StubCourtlistQueryView.java @@ -0,0 +1,32 @@ +package uk.gov.moj.cpp.progression.query.api; + +import uk.gov.justice.services.messaging.JsonEnvelope; +import uk.gov.moj.cpp.progression.query.CourtlistQueryView; + +/** + * Test stub for CourtlistQueryView. Used instead of mocking the concrete class + * so tests run reliably on Java 17 without needing to mock complex bytecode. + */ +class StubCourtlistQueryView extends CourtlistQueryView { + + private JsonEnvelope searchCourtlistResponse; + private JsonEnvelope searchPrisonCourtlistResponse; + + void setSearchCourtlistResponse(JsonEnvelope response) { + this.searchCourtlistResponse = response; + } + + void setSearchPrisonCourtlistResponse(JsonEnvelope response) { + this.searchPrisonCourtlistResponse = response; + } + + @Override + public JsonEnvelope searchCourtlist(JsonEnvelope query) { + return searchCourtlistResponse; + } + + @Override + public JsonEnvelope searchPrisonCourtlist(JsonEnvelope query) { + return searchPrisonCourtlistResponse; + } +} diff --git a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/view/service/ListingService.java b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/view/service/ListingService.java index c2ac8c2d4a..80cf05142b 100644 --- a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/view/service/ListingService.java +++ b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/view/service/ListingService.java @@ -15,9 +15,7 @@ import java.util.Optional; import javax.inject.Inject; -import javax.json.Json; import javax.json.JsonObject; -import javax.json.JsonObjectBuilder; @SuppressWarnings("squid:CallToDeprecatedMethod") public class ListingService { @@ -35,21 +33,9 @@ public Optional searchCourtlist(final JsonEnvelope envelope) { final MetadataBuilder metadataBuilder = metadataFrom(envelope.metadata()) .withName("listing.search.court.list.payload"); - final JsonObject payloadWithIncludeApplications = ensureIncludeApplications(envelope.payloadAsJsonObject()); - final JsonEnvelope requestEnvelope = envelopeFrom(metadataBuilder, payloadWithIncludeApplications); + final JsonEnvelope requestEnvelope = envelopeFrom(metadataBuilder, envelope.payloadAsJsonObject()); final JsonEnvelope jsonResultEnvelope = requester.requestAsAdmin(requestEnvelope); return nonNull(jsonResultEnvelope) ? ofNullable(jsonResultEnvelope.payloadAsJsonObject()) : Optional.empty(); } - - /** - * Ensures includeApplications=true is in the payload so listing returns court list with applications. - * Set here so the param is always sent to listing regardless of how the upstream envelope was built. - */ - private static JsonObject ensureIncludeApplications(final JsonObject payload) { - final JsonObjectBuilder builder = Json.createObjectBuilder(); - payload.keySet().forEach(key -> builder.add(key, payload.get(key))); - builder.add("includeApplications", true); - return builder.build(); - } } diff --git a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java index 8ab17a13d3..8ace9f50c7 100644 --- a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java +++ b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java @@ -4,7 +4,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static uk.gov.justice.services.messaging.Envelope.metadataBuilder; import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom; @@ -23,10 +22,9 @@ import javax.json.JsonObject; import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentCaptor; -import org.mockito.InjectMocks; -import org.mockito.Mock; +import org.mockito.InjectMocks;import org.mockito.Mock; import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; @@ -71,29 +69,4 @@ public void shouldSearchCourtlistDetails() { //then assertThat(result.get().getString("key"), is("value")); } - - @Test - public void shouldSendIncludeApplicationsTrueToListing() { - final JsonObject queryPayload = Json.createObjectBuilder() - .add("courtCentreId", "centre-1") - .add("listId", "PUBLIC") - .add("startDate", "2025-01-01") - .add("endDate", "2025-01-31") - .build(); - final JsonEnvelope query = envelopeFrom( - metadataBuilder().withName("progression.search.court.list").withId(randomUUID()).build(), - queryPayload); - - final ArgumentCaptor envelopeCaptor = ArgumentCaptor.forClass(JsonEnvelope.class); - when(requester.requestAsAdmin(any())).thenReturn(envelopeFrom( - metadataBuilder().withName("listing.search.court.list.payload").withId(randomUUID()).build(), - Json.createObjectBuilder().build())); - - listingService.searchCourtlist(query); - - verify(requester).requestAsAdmin(envelopeCaptor.capture()); - final JsonObject sentPayload = envelopeCaptor.getValue().payloadAsJsonObject(); - assertThat(sentPayload.containsKey("includeApplications"), is(true)); - assertThat(sentPayload.getBoolean("includeApplications"), is(true)); - } } From 60dd7b9f1d66d97c6f8c5d77164ef2b12aafec5c Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Mon, 9 Mar 2026 02:44:04 +0000 Subject: [PATCH 23/39] includeApplications params --- .../cpp/progression/query/view/service/ListingServiceTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java index 8ace9f50c7..a30e7d3ddc 100644 --- a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java +++ b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/view/service/ListingServiceTest.java @@ -24,7 +24,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks;import org.mockito.Mock; +import org.mockito.InjectMocks; +import org.mockito.Mock; import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; From 81b0ece76f459a2d405c31d7990a7b7804e14134 Mon Sep 17 00:00:00 2001 From: Ertugrul Duran Date: Mon, 9 Mar 2026 13:10:15 +0000 Subject: [PATCH 24/39] LPT-2131: [BE] Stop sending empty string to CaTH --- pom.xml | 2 +- .../progression/query/CourtlistQueryView.java | 32 ++--------------- .../query/CourtlistQueryViewTest.java | 35 +++++++++++++------ 3 files changed, 28 insertions(+), 41 deletions(-) diff --git a/pom.xml b/pom.xml index 73f568109d..645ba6519d 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 17.103.127 17.103.147-cct-1981-SNAPSHOT 17.0.144 - 17.0.37 + 17.104.46 17.0.85 17.0.38 17.103.11 diff --git a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java index bcad8f340e..f6814c814e 100644 --- a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java +++ b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java @@ -433,14 +433,13 @@ private JsonObject buildApplicantForCourtApplication(final CourtApplication cour if (nonNull(masterDefendant.getPersonDefendant()) && nonNull(masterDefendant.getPersonDefendant().getPersonDetails())) { final PersonDefendant pd = masterDefendant.getPersonDefendant(); final String asn = ofNullable(pd.getArrestSummonsNumber()).orElse(""); - addApplicantPersonFields(applicantBuilder, pd.getPersonDetails(), "", "", asn); + addApplicantPersonFields(applicantBuilder, pd.getPersonDetails(), asn); } else if (nonNull(masterDefendant.getLegalEntityDefendant()) && nonNull(masterDefendant.getLegalEntityDefendant().getOrganisation())) { final Organisation org = masterDefendant.getLegalEntityDefendant().getOrganisation(); addApplicantOrganisationFields(applicantBuilder, org.getName(), ofNullable(org.getName()).orElse(""), true); } } else if (nonNull(applicant.getPersonDetails())) { - final String orgName = ofNullable(applicant.getOrganisation()).map(org -> ofNullable(org.getName()).orElse("")).orElse(""); - addApplicantPersonFields(applicantBuilder, applicant.getPersonDetails(), orgName, "", ""); + addApplicantPersonFields(applicantBuilder, applicant.getPersonDetails(), ""); } else if (nonNull(applicant.getOrganisation())) { final Organisation org = applicant.getOrganisation(); addApplicantOrganisationFields(applicantBuilder, ofNullable(org.getName()).orElse(""), "", false); @@ -449,12 +448,10 @@ private JsonObject buildApplicantForCourtApplication(final CourtApplication cour final ProsecutingAuthority pa = applicant.getProsecutingAuthority(); final String paName = ofNullable(pa.getName()).orElse(pa.getProsecutionAuthorityCode()); applicantBuilder.add(NAME, ofNullable(paName).orElse("")); - addApplicantEmptyFields(applicantBuilder); applicantBuilder.add(ADDRESS, createObjectBuilder().build()); } else if (nonNull(applicant.getRepresentationOrganisation())) { final String repName = applicant.getRepresentationOrganisation().getName(); applicantBuilder.add(NAME, ofNullable(repName).orElse("")); - addApplicantEmptyFields(applicantBuilder); applicantBuilder.add(ADDRESS, createObjectBuilder().build()); } @@ -463,12 +460,9 @@ private JsonObject buildApplicantForCourtApplication(final CourtApplication cour return applicantBuilder.build(); } - private void addApplicantPersonFields(final JsonObjectBuilder applicantBuilder, final Person person, final String organisationName, - final String welshOrganisationName, final String asn) { + private void addApplicantPersonFields(final JsonObjectBuilder applicantBuilder, final Person person, final String asn) { final String fullName = String.format(STRING_STRING, ofNullable(person.getFirstName()).orElse(""), ofNullable(person.getLastName()).orElse("")).trim(); applicantBuilder.add(NAME, fullName.isEmpty() ? "" : fullName); - applicantBuilder.add(ORGANISATION_NAME, organisationName); - applicantBuilder.add(WELSH_ORGANISATION_NAME, welshOrganisationName); ofNullable(person.getFirstName()).ifPresent(fn -> applicantBuilder.add(FIRST_NAME, fn)); applicantBuilder.add(SURNAME, ofNullable(person.getLastName()).orElse("")); applicantBuilder.add(WELSH_SURNAME, ofNullable(person.getLastName()).orElse("")); @@ -484,31 +478,11 @@ private void addApplicantOrganisationFields(final JsonObjectBuilder applicantBui applicantBuilder.add(NAME, organisationName); applicantBuilder.add(ORGANISATION_NAME, organisationName); applicantBuilder.add(WELSH_ORGANISATION_NAME, welshOrganisationName); - applicantBuilder.add(FIRST_NAME, ""); - applicantBuilder.add(SURNAME, ""); - applicantBuilder.add(WELSH_SURNAME, ""); - applicantBuilder.add(DATE_OF_BIRTH, ""); - applicantBuilder.add(AGE, ""); - applicantBuilder.add(NATIONALITY, ""); - applicantBuilder.add(ASN, ""); - applicantBuilder.add(GENDER, ""); if (withEmptyAddress) { applicantBuilder.add(ADDRESS, createObjectBuilder().build()); } } - private void addApplicantEmptyFields(final JsonObjectBuilder applicantBuilder) { - applicantBuilder.add(ORGANISATION_NAME, ""); - applicantBuilder.add(WELSH_ORGANISATION_NAME, ""); - applicantBuilder.add(FIRST_NAME, ""); - applicantBuilder.add(SURNAME, ""); - applicantBuilder.add(WELSH_SURNAME, ""); - applicantBuilder.add(DATE_OF_BIRTH, ""); - applicantBuilder.add(AGE, ""); - applicantBuilder.add(NATIONALITY, ""); - applicantBuilder.add(ASN, ""); - applicantBuilder.add(GENDER, ""); - } private JsonArray buildApplicantReportingRestrictions(final CourtApplication courtApplication, final List offencesForApplications) { final JsonArrayBuilder arrayBuilder = createArrayBuilder(); diff --git a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java index 9547555169..8c5a3649bb 100644 --- a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java +++ b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java @@ -603,9 +603,9 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromProsecutin assertThat(result.getString("name"), is("CPS")); assertThat(result.getJsonArray("reportingRestrictions"), notNullValue()); assertThat(result.getJsonArray("offences"), notNullValue()); - assertThat(result.getString("organisationName"), is("")); - assertThat(result.getString("asn"), is("")); - assertThat(result.getString("gender"), is("")); + assertThat(result.containsKey("organisationName"), is(false)); + assertThat(result.containsKey("asn"), is(false)); + assertThat(result.containsKey("gender"), is(false)); } @Test @@ -619,8 +619,14 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromOrganisati new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); assertThat(result.getString("organisationName"), is("Acme Organisation")); assertThat(result.getString("welshOrganisationName"), is("")); - assertThat(result.getString("asn"), is("")); - assertThat(result.getString("gender"), is("")); + assertThat(result.containsKey("firstName"), is(false)); + assertThat(result.containsKey("surname"), is(false)); + assertThat(result.containsKey("welshSurname"), is(false)); + assertThat(result.containsKey("dateOfBirth"), is(false)); + assertThat(result.containsKey("age"), is(false)); + assertThat(result.containsKey("nationality"), is(false)); + assertThat(result.containsKey("asn"), is(false)); + assertThat(result.containsKey("gender"), is(false)); } @Test @@ -640,7 +646,8 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromPersonDeta assertThat(result.getString("firstName"), is("Alice")); assertThat(result.getString("surname"), is("Brown")); assertThat(result.getString("dateOfBirth"), is("10 Mar 1992")); - assertThat(result.getString("organisationName"), is("")); + assertThat(result.containsKey("organisationName"), is(false)); + assertThat(result.containsKey("welshOrganisationName"), is(false)); assertThat(result.getString("asn"), is("")); assertThat(result.getString("gender"), is("FEMALE")); assertThat(result.getJsonArray("offences"), notNullValue()); @@ -688,8 +695,14 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromMasterDefe final JsonObject result = invokePrivateMethod("buildApplicantForCourtApplication", new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); assertThat(result.getString("organisationName"), is("Corporate Defendant Ltd")); - assertThat(result.getString("asn"), is("")); - assertThat(result.getString("gender"), is("")); + assertThat(result.containsKey("firstName"), is(false)); + assertThat(result.containsKey("surname"), is(false)); + assertThat(result.containsKey("welshSurname"), is(false)); + assertThat(result.containsKey("dateOfBirth"), is(false)); + assertThat(result.containsKey("age"), is(false)); + assertThat(result.containsKey("nationality"), is(false)); + assertThat(result.containsKey("asn"), is(false)); + assertThat(result.containsKey("gender"), is(false)); } @Test @@ -702,9 +715,9 @@ public void buildApplicantForCourtApplication_shouldBuildApplicantFromRepresenta final JsonObject result = invokePrivateMethod("buildApplicantForCourtApplication", new Class[]{CourtApplication.class, List.class}, courtApplication, emptyList()); assertThat(result.getString("name"), is("Solicitors Ltd")); - assertThat(result.getString("organisationName"), is("")); - assertThat(result.getString("asn"), is("")); - assertThat(result.getString("gender"), is("")); + assertThat(result.containsKey("organisationName"), is(false)); + assertThat(result.containsKey("asn"), is(false)); + assertThat(result.containsKey("gender"), is(false)); assertThat(result.getJsonArray("reportingRestrictions"), notNullValue()); assertThat(result.getJsonArray("offences"), notNullValue()); } From 642593adaacb0054d0bbcd8b8565975415c7a0bc Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Mon, 9 Mar 2026 13:52:23 +0000 Subject: [PATCH 25/39] merge welshOffenceTitle from listing --- .../progression/query/CourtlistQueryView.java | 13 ++++++ .../query/CourtlistQueryViewTest.java | 43 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java index f6814c814e..76be3f78aa 100644 --- a/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java +++ b/progression-query/progression-query-view/src/main/java/uk/gov/moj/cpp/progression/query/CourtlistQueryView.java @@ -678,6 +678,7 @@ private JsonObject enrichDefendant(final JsonObject defendantFromListing, final buildOffence(offenceBuilder, offence, null); } addOffenceInformation(offenceBuilder, offence); + addWelshOffenceTitleFromListingIfMissing(offenceBuilder, offence, offenceFromListing); offencesArray.add(offenceBuilder.build()); } }); @@ -731,6 +732,18 @@ private void addOffenceInformation(final JsonObjectBuilder offenceBuilder, final ofNullable(offence.getMaxPenalty()).ifPresent(maxPenalty -> offenceBuilder.add(MAX_PENALTY, maxPenalty)); } + private void addWelshOffenceTitleFromListingIfMissing(final JsonObjectBuilder offenceBuilder, final Offence offence, final JsonObject offenceFromListing) { + final boolean progressionHasNoWelshTitle = offence.getOffenceTitleWelsh() == null || offence.getOffenceTitleWelsh().isEmpty(); + final boolean listingHasWelshTitle = offenceFromListing.containsKey(WELSH_OFFENCE_TITLE) + && !offenceFromListing.isNull(WELSH_OFFENCE_TITLE); + if (progressionHasNoWelshTitle && listingHasWelshTitle) { + final String welshFromListing = offenceFromListing.getString(WELSH_OFFENCE_TITLE); + if (welshFromListing != null && !welshFromListing.isEmpty()) { + offenceBuilder.add(WELSH_OFFENCE_TITLE, welshFromListing); + } + } + } + private void addApplicationInformation(final JsonObjectBuilder offenceBuilder, final CourtApplication courtApplication) { final CourtApplicationType type = courtApplication.getType(); diff --git a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java index 8c5a3649bb..397e3ab9d2 100644 --- a/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java +++ b/progression-query/progression-query-view/src/test/java/uk/gov/moj/cpp/progression/query/CourtlistQueryViewTest.java @@ -18,6 +18,7 @@ import uk.gov.justice.core.courts.CourtApplicationParty; import uk.gov.justice.core.courts.Gender; import uk.gov.justice.core.courts.Hearing; +import uk.gov.justice.core.courts.Offence; import uk.gov.justice.core.courts.LegalEntityDefendant; import uk.gov.justice.core.courts.MasterDefendant; import uk.gov.justice.core.courts.Organisation; @@ -45,6 +46,7 @@ import javax.json.Json; import javax.json.JsonArray; import javax.json.JsonObject; +import javax.json.JsonObjectBuilder; import com.google.common.io.Resources; import org.junit.jupiter.api.BeforeEach; @@ -506,6 +508,47 @@ public void getApplicationOffenceListingNumbers_shouldReturnOffenceIdsWhenApplic assertThat(result.contains(fromString(id2)), is(true)); } + @Test + public void addWelshOffenceTitleFromListingIfMissing_shouldUseListingWelshTitleWhenProgressionHasNone() throws Exception { + final JsonObjectBuilder offenceBuilder = Json.createObjectBuilder(); + final Offence offenceWithoutWelsh = Offence.offence() + .withId(randomUUID()) + .withOffenceCode("TTH105HY") + .withOffenceTitle("ROBBERY") + .build(); + final JsonObject offenceFromListing = Json.createObjectBuilder() + .add("welshOffenceTitle", "Listing Welsh Title") + .build(); + + invokePrivateMethod("addWelshOffenceTitleFromListingIfMissing", + new Class[]{JsonObjectBuilder.class, Offence.class, JsonObject.class}, + offenceBuilder, offenceWithoutWelsh, offenceFromListing); + + final JsonObject result = offenceBuilder.build(); + assertThat(result.getString("welshOffenceTitle"), is("Listing Welsh Title")); + } + + @Test + public void addWelshOffenceTitleFromListingIfMissing_shouldNotAddWhenProgressionAlreadyHasWelshTitle() throws Exception { + final JsonObjectBuilder offenceBuilder = Json.createObjectBuilder(); + final Offence offenceWithWelsh = Offence.offence() + .withId(randomUUID()) + .withOffenceCode("TTH105HY") + .withOffenceTitle("ROBBERY") + .withOffenceTitleWelsh("Progression Welsh Title") + .build(); + final JsonObject offenceFromListing = Json.createObjectBuilder() + .add("welshOffenceTitle", "Listing Welsh Title") + .build(); + + invokePrivateMethod("addWelshOffenceTitleFromListingIfMissing", + new Class[]{JsonObjectBuilder.class, Offence.class, JsonObject.class}, + offenceBuilder, offenceWithWelsh, offenceFromListing); + + final JsonObject result = offenceBuilder.build(); + assertThat(result.containsKey("welshOffenceTitle"), is(false)); + } + @Test public void buildCourtApplicationParty_shouldAddNameFromProsecutingAuthority() throws Exception { final ProsecutingAuthority pa = ProsecutingAuthority.prosecutingAuthority() From c289dbc113ec1f7d1ba3a7b9ef52d68b9b20c577 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Mon, 9 Mar 2026 15:15:00 +0000 Subject: [PATCH 26/39] merge welshOffenceTitle from listing --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index 645ba6519d..9cf77afff6 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index de3fabb6c3..6cbeb9f2ec 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index dce32f7847..c5e627f674 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index 94d5f2761c..9cc22a92b2 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index 20102a926c..9d689ff337 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index 31c747b14b..fe11a6029c 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index f7675ed295..71670012a1 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index 3a8e2891b8..060aaf0178 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index e20a86c6de..0273ffe07f 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index 2386d5f2fa..fc6d393bb4 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index 26e2e9d22a..0b3d0da9fc 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index 77bb3fc900..5361afa1f6 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index 2a0935f4ff..47c0a089c2 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index f1b849307e..00e6dafa0d 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index 9f75f3ea59..f9d7ea0a4f 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index deab10eabe..753d1e389b 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index ea5a13234f..cb4985f3b5 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index 628977ce78..ab39ee4e87 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index e0a48845e0..3ec8bae8fd 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index 4cbf6a2a5c..b9acbc6e11 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 2e80f95248..0e02efc87e 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 1bd33290b1..86fe0a37bf 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index 9789b579e3..7cb9eba2fd 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index e7f9b1f0bc..9682af1ac6 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index d74e10aad0..b15b3fd713 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index b4fc970cd1..c22ec77d51 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index cd8346a927..a8b2f1bc3a 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index 555503a1ce..2934c12556 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index f4a8c26664..004ab073e2 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.236-cct-1981-SNAPSHOT + 17.0.240-cct-1981-SNAPSHOT progression-viewstore-persistence From 9dbcc2f6e034e922ef7ddeff09123e8e3fee12bf Mon Sep 17 00:00:00 2001 From: Ertugrul Duran Date: Mon, 9 Mar 2026 18:19:36 +0000 Subject: [PATCH 27/39] LPT-2131:Fixing IT test --- .../java/uk/gov/moj/cpp/progression/SearchCourtListDataIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progression-integration-test/src/test/java/uk/gov/moj/cpp/progression/SearchCourtListDataIT.java b/progression-integration-test/src/test/java/uk/gov/moj/cpp/progression/SearchCourtListDataIT.java index dd1825e0b7..93d84a91da 100644 --- a/progression-integration-test/src/test/java/uk/gov/moj/cpp/progression/SearchCourtListDataIT.java +++ b/progression-integration-test/src/test/java/uk/gov/moj/cpp/progression/SearchCourtListDataIT.java @@ -38,7 +38,7 @@ public void shouldReturnCourtListDataAsJson() { @Test public void shouldReturnPrisonCourtListDataAsJson() { final String responseBody = pollForResponse( - "/courtlistdata?courtCentreId=f8254db1-1683-483e-afb3-b87fde5a0a26&startDate=2022-07-12&endDate=2022-07-12&_=bc9153c0-8278-494e-8f72-d63973bab35f", + "/courtlistdata?listId=PRISON&courtCentreId=f8254db1-1683-483e-afb3-b87fde5a0a26&startDate=2022-07-12&endDate=2022-07-12&_=bc9153c0-8278-494e-8f72-d63973bab35f", "application/vnd.progression.search.prison.court.list.data+json"); final JsonObject json = getJsonObject(responseBody); From 04fa53d4fa50bfdb18613a979bce85660b669537 Mon Sep 17 00:00:00 2001 From: devops-team Date: Mon, 9 Mar 2026 21:53:10 +0000 Subject: [PATCH 28/39] New 17.0.241-cct-1981-SNAPSHOT --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index 9cf77afff6..49a7e5324e 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index 6cbeb9f2ec..c34d292b71 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index c5e627f674..cbf534a073 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index 9cc22a92b2..5767a03ea1 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index 9d689ff337..f961c79995 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index fe11a6029c..d65fdf09ae 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 71670012a1..2e7c067444 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index 060aaf0178..fd010c4b7e 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index 0273ffe07f..2b13294a49 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index fc6d393bb4..2cff5fce14 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index 0b3d0da9fc..84360d3d88 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index 5361afa1f6..ae4aa34029 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index 47c0a089c2..69b0a0fe43 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 00e6dafa0d..7d7edc6b97 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index f9d7ea0a4f..1722d8e8b6 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index 753d1e389b..7a200bce78 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index cb4985f3b5..4e5d42146e 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index ab39ee4e87..c30ef16d6c 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index 3ec8bae8fd..c37d69c013 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index b9acbc6e11..c4dc85e09c 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 0e02efc87e..0485fdbccf 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 86fe0a37bf..62dca1a17c 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index 7cb9eba2fd..1dca45103c 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index 9682af1ac6..3ceaff5b01 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index b15b3fd713..80b9593711 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index c22ec77d51..cc5bbf7022 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index a8b2f1bc3a..384fa6e56f 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index 2934c12556..672e618e8b 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index 004ab073e2..39cba0a26f 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.240-cct-1981-SNAPSHOT + 17.0.241-cct-1981-SNAPSHOT progression-viewstore-persistence From 7229445d238d17a68558552f3e0b62712e512cbc Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Tue, 10 Mar 2026 15:56:17 +0000 Subject: [PATCH 29/39] tmp/includeApplications-as-query-param --- pom.xml | 2 +- .../moj/cpp/progression/query/api/CourtlistQueryApi.java | 8 +++++--- .../src/raml/progression-query-api.raml | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 49a7e5324e..e2b434de72 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 17.0.144 17.104.46 17.0.85 - 17.0.38 + 17.103.126 17.103.11 8.0.30 6.13 diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java index c68065e46d..8abadd9d99 100644 --- a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java +++ b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java @@ -53,14 +53,16 @@ private JsonEnvelope enrichCourtListJsonData(final JsonEnvelope query, final Jso } /** - * Ensures includeApplications=true is in the payload so listing returns court list with applications. - * Set here so the param is always sent to listing regardless of how the upstream envelope was built. + * Ensures includeApplications is in the payload for listing. Uses optional query param when present, otherwise defaults to true. */ private static JsonEnvelope ensureIncludeApplications(final JsonEnvelope query) { final JsonObjectBuilder builder = Json.createObjectBuilder(); final JsonObject payload = query.payloadAsJsonObject(); payload.keySet().forEach(key -> builder.add(key, payload.get(key))); - builder.add("includeApplications", true); + final boolean includeApplications = payload.containsKey("includeApplications") + ? payload.getBoolean("includeApplications") + : false; + builder.add("includeApplications", includeApplications); return envelopeFrom(query.metadata(), builder.build()); } } diff --git a/progression-query/progression-query-api/src/raml/progression-query-api.raml b/progression-query/progression-query-api/src/raml/progression-query-api.raml index 625e018db9..0ee82a9da9 100644 --- a/progression-query/progression-query-api/src/raml/progression-query-api.raml +++ b/progression-query/progression-query-api/src/raml/progression-query-api.raml @@ -1507,6 +1507,11 @@ protocols: [ HTTP, HTTPS ] type: boolean required: false default: false + includeApplications: + description: when true, listing returns court list with court applications; when false, applications are excluded + type: boolean + required: false + default: true responses: 200: body: From 9271aa57b1f6d4c3d538b5ccede1c5b10df6821b Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Tue, 10 Mar 2026 17:15:12 +0000 Subject: [PATCH 30/39] tmp/includeApplications-as-query-param --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e2b434de72..c36bfd38ab 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 17.0.144 17.104.46 17.0.85 - 17.103.126 + 17.103.128 17.103.11 8.0.30 6.13 From b7da24f43920dcad965b188fd925cc7afe504559 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Tue, 10 Mar 2026 17:37:51 +0000 Subject: [PATCH 31/39] tmp/includeApplications-as-query-param --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c36bfd38ab..d49599a82b 100644 --- a/pom.xml +++ b/pom.xml @@ -66,12 +66,12 @@ 17.0.72 1.0.6 6.4.1 - 17.103.127 + 17.103.128 17.103.147-cct-1981-SNAPSHOT 17.0.144 17.104.46 17.0.85 - 17.103.128 + 17.0.38 17.103.11 8.0.30 6.13 From 5147f16b7aa4e18b27d57a725ded975d536d96ce Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Tue, 10 Mar 2026 19:50:19 +0000 Subject: [PATCH 32/39] tmp/includeApplications-as-query-param --- .../query/api/CourtlistQueryApiTest.java | 39 +++++++++++++++++++ .../query/api/StubCourtlistQueryView.java | 12 ++++++ 2 files changed, 51 insertions(+) diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java index c395f07c99..03e89d9660 100644 --- a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java +++ b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApiTest.java @@ -80,6 +80,45 @@ public void shouldHandleSearchPrisonCourtlistDataQuery() { assertThat(result.payloadAsJsonObject(), equalTo(enrichedPayload)); } + @Test + public void searchCourtlistData_shouldPassIncludeApplicationsTrueWhenPresentInPayload() { + stubCourtlistQueryView.setSearchCourtlistResponse(response); + when(courtlistQueryService.buildEnrichedPayload(response)).thenReturn(Json.createObjectBuilder().build()); + when(query.metadata()).thenReturn(metadataBuilder().withId(UUID.randomUUID()).withName("progression.search.court.list.data").build()); + when(query.payloadAsJsonObject()).thenReturn(Json.createObjectBuilder().add("includeApplications", true).build()); + + courtListQueryApi.searchCourtlistData(query); + + var envelopePassedToView = stubCourtlistQueryView.getLastSearchCourtlistQuery(); + assertThat(envelopePassedToView.payloadAsJsonObject().getBoolean("includeApplications"), equalTo(true)); + } + + @Test + public void searchCourtlistData_shouldPassIncludeApplicationsFalseWhenPresentInPayload() { + stubCourtlistQueryView.setSearchCourtlistResponse(response); + when(courtlistQueryService.buildEnrichedPayload(response)).thenReturn(Json.createObjectBuilder().build()); + when(query.metadata()).thenReturn(metadataBuilder().withId(UUID.randomUUID()).withName("progression.search.court.list.data").build()); + when(query.payloadAsJsonObject()).thenReturn(Json.createObjectBuilder().add("includeApplications", false).build()); + + courtListQueryApi.searchCourtlistData(query); + + var envelopePassedToView = stubCourtlistQueryView.getLastSearchCourtlistQuery(); + assertThat(envelopePassedToView.payloadAsJsonObject().getBoolean("includeApplications"), equalTo(false)); + } + + @Test + public void searchCourtlistData_shouldDefaultIncludeApplicationsToFalseWhenMissingFromPayload() { + stubCourtlistQueryView.setSearchCourtlistResponse(response); + when(courtlistQueryService.buildEnrichedPayload(response)).thenReturn(Json.createObjectBuilder().build()); + when(query.metadata()).thenReturn(metadataBuilder().withId(UUID.randomUUID()).withName("progression.search.court.list.data").build()); + when(query.payloadAsJsonObject()).thenReturn(Json.createObjectBuilder().build()); + + courtListQueryApi.searchCourtlistData(query); + + var envelopePassedToView = stubCourtlistQueryView.getLastSearchCourtlistQuery(); + assertThat(envelopePassedToView.payloadAsJsonObject().getBoolean("includeApplications"), equalTo(false)); + } + private static void setField(Object target, String fieldName, Object value) throws Exception { Field field = target.getClass().getDeclaredField(fieldName); field.setAccessible(true); diff --git a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/StubCourtlistQueryView.java b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/StubCourtlistQueryView.java index 1057329cfa..f4b7719bfb 100644 --- a/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/StubCourtlistQueryView.java +++ b/progression-query/progression-query-api/src/test/java/uk/gov/moj/cpp/progression/query/api/StubCourtlistQueryView.java @@ -11,6 +11,8 @@ class StubCourtlistQueryView extends CourtlistQueryView { private JsonEnvelope searchCourtlistResponse; private JsonEnvelope searchPrisonCourtlistResponse; + private JsonEnvelope lastSearchCourtlistQuery; + private JsonEnvelope lastSearchPrisonCourtlistQuery; void setSearchCourtlistResponse(JsonEnvelope response) { this.searchCourtlistResponse = response; @@ -20,13 +22,23 @@ void setSearchPrisonCourtlistResponse(JsonEnvelope response) { this.searchPrisonCourtlistResponse = response; } + JsonEnvelope getLastSearchCourtlistQuery() { + return lastSearchCourtlistQuery; + } + + JsonEnvelope getLastSearchPrisonCourtlistQuery() { + return lastSearchPrisonCourtlistQuery; + } + @Override public JsonEnvelope searchCourtlist(JsonEnvelope query) { + this.lastSearchCourtlistQuery = query; return searchCourtlistResponse; } @Override public JsonEnvelope searchPrisonCourtlist(JsonEnvelope query) { + this.lastSearchPrisonCourtlistQuery = query; return searchPrisonCourtlistResponse; } } From af512d9585fe8675fa7173f07f5b7505ccfddcb2 Mon Sep 17 00:00:00 2001 From: devops-team Date: Tue, 10 Mar 2026 20:08:36 +0000 Subject: [PATCH 33/39] New 17.0.242-cct-1981-SNAPSHOT --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index d49599a82b..9fe5fcb854 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index c34d292b71..7145fdf8ef 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index cbf534a073..57747c6b3c 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index 5767a03ea1..b052cd56d3 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index f961c79995..ab59c51eb8 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index d65fdf09ae..6690513f85 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 2e7c067444..7cc58cda00 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index fd010c4b7e..3cb5df1195 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index 2b13294a49..27a20bdbd3 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index 2cff5fce14..b876c9bbcd 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index 84360d3d88..c885dc3b3c 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index ae4aa34029..c1cb05bc1f 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index 69b0a0fe43..c9f0da3805 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 7d7edc6b97..4d12ea61b1 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index 1722d8e8b6..c7fd506cf0 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index 7a200bce78..fea44f726c 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index 4e5d42146e..546d1288de 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index c30ef16d6c..fd412efbb5 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index c37d69c013..df282fb95f 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index c4dc85e09c..35d377c997 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 0485fdbccf..b6a6828e09 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 62dca1a17c..3a76407d65 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index 1dca45103c..969d215dde 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index 3ceaff5b01..3f1c7c08ea 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index 80b9593711..64f68610f8 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index cc5bbf7022..88ccca871b 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index 384fa6e56f..70685233e9 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index 672e618e8b..3fe5371640 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index 39cba0a26f..e9ef64c8dc 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.241-cct-1981-SNAPSHOT + 17.0.242-cct-1981-SNAPSHOT progression-viewstore-persistence From df1b710820817a3a89025c1fca1758375df6dd0a Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Wed, 11 Mar 2026 07:22:16 +0000 Subject: [PATCH 34/39] test coverage for code that are not ours --- .../CourtApplicationProcessorTest.java | 94 +++++++++++++++++++ ...odial-establishment-no-inactive-cases.json | 6 ++ 2 files changed, 100 insertions(+) create mode 100644 progression-event/progression-event-processor/src/test/resources/progression.event.remove-defendant-custodial-establishment-no-inactive-cases.json diff --git a/progression-event/progression-event-processor/src/test/java/uk/gov/moj/cpp/progression/processor/CourtApplicationProcessorTest.java b/progression-event/progression-event-processor/src/test/java/uk/gov/moj/cpp/progression/processor/CourtApplicationProcessorTest.java index dba74a0e59..1ab88d1595 100644 --- a/progression-event/progression-event-processor/src/test/java/uk/gov/moj/cpp/progression/processor/CourtApplicationProcessorTest.java +++ b/progression-event/progression-event-processor/src/test/java/uk/gov/moj/cpp/progression/processor/CourtApplicationProcessorTest.java @@ -24,6 +24,7 @@ import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; +import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -37,6 +38,7 @@ import static uk.gov.justice.core.courts.CourtApplicationParty.courtApplicationParty; import static uk.gov.justice.core.courts.CourtApplicationProceedingsEdited.courtApplicationProceedingsEdited; import static uk.gov.justice.core.courts.CourtApplicationProceedingsInitiated.courtApplicationProceedingsInitiated; +import static uk.gov.justice.core.courts.CourtApplicationSummonsApproved.courtApplicationSummonsApproved; import static uk.gov.justice.core.courts.CourtApplicationSummonsRejected.courtApplicationSummonsRejected; import static uk.gov.justice.core.courts.CourtApplicationType.courtApplicationType; import static uk.gov.justice.core.courts.CourtHearingRequest.courtHearingRequest; @@ -71,6 +73,7 @@ import uk.gov.justice.core.courts.CourtApplicationPartyListingNeeds; import uk.gov.justice.core.courts.CourtApplicationProceedingsEdited; import uk.gov.justice.core.courts.CourtApplicationProceedingsInitiated; +import uk.gov.justice.core.courts.CourtApplicationSummonsApproved; import uk.gov.justice.core.courts.CourtApplicationSummonsRejected; import uk.gov.justice.core.courts.CourtApplicationType; import uk.gov.justice.core.courts.CourtCentre; @@ -737,6 +740,97 @@ public void processCourtApplicationSummonsRejected() { verify(summonsRejectedService).sendSummonsRejectionNotification(event, courtApplication, summonsRejectedOutcome); } + @Test + public void courtApplicationSummonsApproved_withFirstHearingLinkType_shouldSendPublicEvent() { + final UUID applicationId = randomUUID(); + final UUID prosecutionCaseId = randomUUID(); + final CourtApplicationSummonsApproved courtApplicationSummonsApproved = courtApplicationSummonsApproved() + .withApplicationId(applicationId) + .withLinkType(LinkType.FIRST_HEARING) + .withCaseIds(singletonList(prosecutionCaseId)) + .withSummonsApprovedOutcome(summonsApprovedOutcome() + .withSummonsSuppressed(false) + .withPersonalService(false) + .withProsecutorCost("£100.00") + .withProsecutorEmailAddress("test@test.com") + .build()) + .build(); + final JsonObject payload = objectToJsonObjectConverter.convert(courtApplicationSummonsApproved); + final MetadataBuilder metadataBuilder = getMetadata("progression.event.court-application-summons-approved"); + final JsonEnvelope event = envelopeFrom(metadataBuilder, payload); + + courtApplicationProcessor.courtApplicationSummonsApproved(event); + + final ArgumentCaptor captor = forClass(Envelope.class); + verify(sender).send(captor.capture()); + assertThat(captor.getValue().metadata().name(), is("public.progression.court-application-summons-approved")); + } + + @Test + public void courtApplicationSummonsApproved_withLinkedLinkType_shouldNotSendPublicEvent() { + final UUID applicationId = randomUUID(); + final UUID prosecutionCaseId = randomUUID(); + final CourtApplicationSummonsApproved courtApplicationSummonsApproved = courtApplicationSummonsApproved() + .withApplicationId(applicationId) + .withLinkType(LinkType.LINKED) + .withCaseIds(singletonList(prosecutionCaseId)) + .withSummonsApprovedOutcome(summonsApprovedOutcome() + .withSummonsSuppressed(false) + .withPersonalService(false) + .withProsecutorCost("£100.00") + .withProsecutorEmailAddress("test@test.com") + .build()) + .build(); + final JsonObject payload = objectToJsonObjectConverter.convert(courtApplicationSummonsApproved); + final MetadataBuilder metadataBuilder = getMetadata("progression.event.court-application-summons-approved"); + final JsonEnvelope event = envelopeFrom(metadataBuilder, payload); + + courtApplicationProcessor.courtApplicationSummonsApproved(event); + + verify(sender, never()).send(argThat((Envelope e) -> "public.progression.court-application-summons-approved".equals(e.metadata().name()))); + } + + @Test + public void courtApplicationSummonsRejected_withLinkedLinkType_shouldNotSendPublicEventButShouldNotify() { + final UUID applicationId = randomUUID(); + final UUID prosecutionCaseId = randomUUID(); + final CourtApplication courtApplication = courtApplication() + .withId(applicationId) + .withCourtApplicationCases(singletonList(courtApplicationCase().withProsecutionCaseId(prosecutionCaseId).build())) + .withType(courtApplicationType().withLinkType(LinkType.LINKED).build()) + .build(); + final SummonsRejectedOutcome summonsRejectedOutcome = summonsRejectedOutcome() + .withReasons(Lists.newArrayList("reason1")) + .withProsecutorEmailAddress("test@test.com") + .build(); + final CourtApplicationSummonsRejected courtApplicationSummonsRejected = courtApplicationSummonsRejected() + .withCourtApplication(courtApplication) + .withCaseIds(singletonList(prosecutionCaseId)) + .withSummonsRejectedOutcome(summonsRejectedOutcome) + .build(); + final JsonObject payload = objectToJsonObjectConverter.convert(courtApplicationSummonsRejected); + final MetadataBuilder metadataBuilder = getMetadata("progression.event.court-application-summons-rejected"); + final JsonEnvelope event = envelopeFrom(metadataBuilder, payload); + + when(jsonObjectToObjectConverter.convert(event.payloadAsJsonObject(), CourtApplicationSummonsRejected.class)).thenReturn(courtApplicationSummonsRejected); + + courtApplicationProcessor.courtApplicationSummonsRejected(event); + + verify(sender, never()).send(argThat((Envelope e) -> "public.progression.court-application-summons-rejected".equals(e.metadata().name()))); + verify(summonsRejectedService).sendSummonsRejectionNotification(event, courtApplication, summonsRejectedOutcome); + } + + @Test + public void processRemoveDefendantCustodialEstablishmentRequested_withNoInactiveCases_shouldNotSendRemoveCommand() { + final MetadataBuilder metadataBuilder = getMetadata("progression.event.remove-defendant-custodial-establishment-requested"); + final JsonObject payload = FileUtil.givenPayload("/progression.event.remove-defendant-custodial-establishment-no-inactive-cases.json"); + final JsonEnvelope event = envelopeFrom(metadataBuilder, payload); + + courtApplicationProcessor.processRemoveDefendantCustodialEstablishmentRequested(event); + + verify(sender, never()).send(argThat((Envelope e) -> "progression.command.remove-defendant-custodial-establishment-from-case".equals(e.metadata().name()))); + } + @Test public void shouldHandleProcessCourtApplicationChangedEventMessage() { //Given diff --git a/progression-event/progression-event-processor/src/test/resources/progression.event.remove-defendant-custodial-establishment-no-inactive-cases.json b/progression-event/progression-event-processor/src/test/resources/progression.event.remove-defendant-custodial-establishment-no-inactive-cases.json new file mode 100644 index 0000000000..5cf1e88130 --- /dev/null +++ b/progression-event/progression-event-processor/src/test/resources/progression.event.remove-defendant-custodial-establishment-no-inactive-cases.json @@ -0,0 +1,6 @@ +{ + "courtApplication": { + "id": "0941680a-6fcd-4fe0-a092-cb92d5ff871a", + "courtApplicationCases": [] + } +} From 1d7526250316cd648bd600613e9d702d7535405d Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Wed, 11 Mar 2026 08:22:53 +0000 Subject: [PATCH 35/39] test coverage for code that are not ours --- .../processor/HearingConfirmedEventProcessor.java | 3 +-- .../moj/cpp/progression/query/api/CourtlistQueryApi.java | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/progression-event/progression-event-processor/src/main/java/uk/gov/moj/cpp/progression/processor/HearingConfirmedEventProcessor.java b/progression-event/progression-event-processor/src/main/java/uk/gov/moj/cpp/progression/processor/HearingConfirmedEventProcessor.java index 2b5f3146f4..08337d23d6 100644 --- a/progression-event/progression-event-processor/src/main/java/uk/gov/moj/cpp/progression/processor/HearingConfirmedEventProcessor.java +++ b/progression-event/progression-event-processor/src/main/java/uk/gov/moj/cpp/progression/processor/HearingConfirmedEventProcessor.java @@ -98,7 +98,7 @@ import org.slf4j.Logger; -@SuppressWarnings({"squid:S3655", "squid:S2629", "squid:CallToDeprecatedMethod", "pmd:BeanMembersShouldSerialize"}) +@SuppressWarnings({"squid:S3655", "squid:S2629", "squid:CallToDeprecatedMethod", "pmd:BeanMembersShouldSerialize", "squid:S3776"}) @ServiceComponent(Component.EVENT_PROCESSOR) public class HearingConfirmedEventProcessor { @@ -194,7 +194,6 @@ public void processHearingConfirmedReplayed(final JsonEnvelope jsonEnvelope){ confirmHearing(jsonEnvelope, sendNotificationToParties,confirmedHearing,hearingInProgression ); } - @SuppressWarnings("squid:S3776") @Handles("public.listing.hearing-confirmed") public void processEvent(final JsonEnvelope jsonEnvelope) { diff --git a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java index 8abadd9d99..ca4023d843 100644 --- a/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java +++ b/progression-query/progression-query-api/src/main/java/uk/gov/moj/cpp/progression/query/api/CourtlistQueryApi.java @@ -17,6 +17,7 @@ @ServiceComponent(Component.QUERY_API) public class CourtlistQueryApi { + public static final String INCLUDE_APPLICATIONS = "includeApplications"; @Inject private CourtlistQueryView courtlistQueryView; @@ -59,10 +60,10 @@ private static JsonEnvelope ensureIncludeApplications(final JsonEnvelope query) final JsonObjectBuilder builder = Json.createObjectBuilder(); final JsonObject payload = query.payloadAsJsonObject(); payload.keySet().forEach(key -> builder.add(key, payload.get(key))); - final boolean includeApplications = payload.containsKey("includeApplications") - ? payload.getBoolean("includeApplications") + final boolean includeApplications = payload.containsKey(INCLUDE_APPLICATIONS) + ? payload.getBoolean(INCLUDE_APPLICATIONS) : false; - builder.add("includeApplications", includeApplications); + builder.add(INCLUDE_APPLICATIONS, includeApplications); return envelopeFrom(query.metadata(), builder.build()); } } From 6359dee12458e0e68b5a45fc6084268a6453cb29 Mon Sep 17 00:00:00 2001 From: devops-team Date: Wed, 11 Mar 2026 10:10:48 +0000 Subject: [PATCH 36/39] New 17.0.243-cct-1981-SNAPSHOT --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index 9fe5fcb854..16f1ccc65f 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index 7145fdf8ef..cff5dab050 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index 57747c6b3c..b26db334cd 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index b052cd56d3..2d7c95c4e4 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index ab59c51eb8..2d263b5c09 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index 6690513f85..2a5a116259 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 7cc58cda00..7bb56e332a 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index 3cb5df1195..a00b9836a2 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index 27a20bdbd3..c31e07ef87 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index b876c9bbcd..f0e0bc220e 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index c885dc3b3c..8bf41d068f 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index c1cb05bc1f..111123f593 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index c9f0da3805..e0e13653f7 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 4d12ea61b1..3e878d3135 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index c7fd506cf0..4284239b1e 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index fea44f726c..e9ce939270 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index 546d1288de..078760749c 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index fd412efbb5..8d590b63ba 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index df282fb95f..e6c2115669 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index 35d377c997..408f8eafb5 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index b6a6828e09..7edb9b4a74 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 3a76407d65..6d5e3c8416 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index 969d215dde..aefda7b662 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index 3f1c7c08ea..4c65a45b26 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index 64f68610f8..641938c14a 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index 88ccca871b..7ae27b6599 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index 70685233e9..89ad617f77 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index 3fe5371640..d89109fb45 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index e9ef64c8dc..0a3eb814c3 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.242-cct-1981-SNAPSHOT + 17.0.243-cct-1981-SNAPSHOT progression-viewstore-persistence From 7b5344449ce9ebdd402a7c5b947200a3adff9eea Mon Sep 17 00:00:00 2001 From: devops-team Date: Thu, 12 Mar 2026 11:55:55 +0000 Subject: [PATCH 37/39] New 17.0.244-cct-1981-SNAPSHOT --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index 16f1ccc65f..3b617278ae 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index cff5dab050..73a5be0882 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index b26db334cd..4d33bb8f04 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index 2d7c95c4e4..8c6fa1b3c0 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index 2d263b5c09..56a2696c42 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index 2a5a116259..7b30370e5e 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index 7bb56e332a..c374193c94 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index a00b9836a2..aa21d516e1 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index c31e07ef87..cee9f47b67 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index f0e0bc220e..e58eb0d33c 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index 8bf41d068f..53cc913cd4 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index 111123f593..754bb9c0ac 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index e0e13653f7..02b123dbf7 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 3e878d3135..5c40528cc5 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index 4284239b1e..69e05c0c0c 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index e9ce939270..bb036adc42 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index 078760749c..ea08aa6cc6 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index 8d590b63ba..6f04f42944 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index e6c2115669..29f0ce6220 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index 408f8eafb5..45c76bf01d 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 7edb9b4a74..60c88152d5 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index 6d5e3c8416..a0e5752f78 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index aefda7b662..e9aeea7ad1 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index 4c65a45b26..43ac2eaf69 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index 641938c14a..4f8e5d7281 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index 7ae27b6599..d107543490 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index 89ad617f77..3f8dbf3879 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index d89109fb45..a534ffad79 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index 0a3eb814c3..600d59c043 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.243-cct-1981-SNAPSHOT + 17.0.244-cct-1981-SNAPSHOT progression-viewstore-persistence From fd62baf6daa5b6fcc19ecf44b2fd8e5e51064bf2 Mon Sep 17 00:00:00 2001 From: devops-team Date: Tue, 17 Mar 2026 12:57:13 +0000 Subject: [PATCH 38/39] New 17.0.245-cct-1981-SNAPSHOT --- pom.xml | 2 +- progression-command/pom.xml | 2 +- progression-command/progression-command-api/pom.xml | 2 +- progression-command/progression-command-handler/pom.xml | 2 +- progression-domain/pom.xml | 2 +- progression-domain/progression-datatypes-common/pom.xml | 2 +- progression-domain/progression-domain-aggregate/pom.xml | 2 +- progression-domain/progression-domain-common/pom.xml | 2 +- progression-domain/progression-domain-message/pom.xml | 2 +- progression-event-sources/pom.xml | 2 +- progression-event/pom.xml | 2 +- progression-event/progression-event-indexer/pom.xml | 2 +- progression-event/progression-event-listener/pom.xml | 2 +- progression-event/progression-event-processor/pom.xml | 2 +- progression-eventprocessorstore/pom.xml | 2 +- .../progression-eventprocessorstore-liquibase/pom.xml | 2 +- .../progression-eventprocessorstore-persistence/pom.xml | 2 +- progression-healthchecks/pom.xml | 2 +- progression-integration-test/pom.xml | 2 +- progression-performance-test/pom.xml | 2 +- progression-query/pom.xml | 2 +- progression-query/progression-query-api/pom.xml | 2 +- progression-query/progression-query-view/pom.xml | 2 +- progression-refdata-service/pom.xml | 2 +- progression-service/pom.xml | 2 +- progression-test-utilities/pom.xml | 2 +- progression-viewstore/pom.xml | 2 +- progression-viewstore/progression-viewstore-liquibase/pom.xml | 2 +- progression-viewstore/progression-viewstore-persistence/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index 3b617278ae..902a9736d5 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT pom Progression services application diff --git a/progression-command/pom.xml b/progression-command/pom.xml index 73a5be0882..d89e46cf5d 100644 --- a/progression-command/pom.xml +++ b/progression-command/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-command pom diff --git a/progression-command/progression-command-api/pom.xml b/progression-command/progression-command-api/pom.xml index 4d33bb8f04..a76739aea2 100644 --- a/progression-command/progression-command-api/pom.xml +++ b/progression-command/progression-command-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-command-api war diff --git a/progression-command/progression-command-handler/pom.xml b/progression-command/progression-command-handler/pom.xml index 8c6fa1b3c0..256032bbb2 100644 --- a/progression-command/progression-command-handler/pom.xml +++ b/progression-command/progression-command-handler/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-command - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-command-handler war diff --git a/progression-domain/pom.xml b/progression-domain/pom.xml index 56a2696c42..15b8d092dd 100644 --- a/progression-domain/pom.xml +++ b/progression-domain/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-domain pom diff --git a/progression-domain/progression-datatypes-common/pom.xml b/progression-domain/progression-datatypes-common/pom.xml index 7b30370e5e..a9fed69112 100644 --- a/progression-domain/progression-datatypes-common/pom.xml +++ b/progression-domain/progression-datatypes-common/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-domain/progression-domain-aggregate/pom.xml b/progression-domain/progression-domain-aggregate/pom.xml index c374193c94..78bd9856b3 100644 --- a/progression-domain/progression-domain-aggregate/pom.xml +++ b/progression-domain/progression-domain-aggregate/pom.xml @@ -3,7 +3,7 @@ progression-domain uk.gov.moj.cpp.progression - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT 4.0.0 progression-domain-aggregate diff --git a/progression-domain/progression-domain-common/pom.xml b/progression-domain/progression-domain-common/pom.xml index aa21d516e1..1dbeea5c25 100644 --- a/progression-domain/progression-domain-common/pom.xml +++ b/progression-domain/progression-domain-common/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-domain-common diff --git a/progression-domain/progression-domain-message/pom.xml b/progression-domain/progression-domain-message/pom.xml index cee9f47b67..b0442effe6 100644 --- a/progression-domain/progression-domain-message/pom.xml +++ b/progression-domain/progression-domain-message/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-domain - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-domain-message diff --git a/progression-event-sources/pom.xml b/progression-event-sources/pom.xml index e58eb0d33c..3caa6de27b 100644 --- a/progression-event-sources/pom.xml +++ b/progression-event-sources/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-event/pom.xml b/progression-event/pom.xml index 53cc913cd4..3c1459480f 100644 --- a/progression-event/pom.xml +++ b/progression-event/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-event pom diff --git a/progression-event/progression-event-indexer/pom.xml b/progression-event/progression-event-indexer/pom.xml index 754bb9c0ac..ffca6660fb 100644 --- a/progression-event/progression-event-indexer/pom.xml +++ b/progression-event/progression-event-indexer/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-event-indexer war diff --git a/progression-event/progression-event-listener/pom.xml b/progression-event/progression-event-listener/pom.xml index 02b123dbf7..67d6f814ff 100644 --- a/progression-event/progression-event-listener/pom.xml +++ b/progression-event/progression-event-listener/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-event-listener war diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 5c40528cc5..2121096e15 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-event - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-event-processor war diff --git a/progression-eventprocessorstore/pom.xml b/progression-eventprocessorstore/pom.xml index 69e05c0c0c..feab10c9b3 100644 --- a/progression-eventprocessorstore/pom.xml +++ b/progression-eventprocessorstore/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml index bb036adc42..db062827f7 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-liquibase/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-liquibase diff --git a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml index ea08aa6cc6..d64cd5769e 100644 --- a/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml +++ b/progression-eventprocessorstore/progression-eventprocessorstore-persistence/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-eventprocessorstore - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT 4.0.0 progression-eventprocessorstore-persistence diff --git a/progression-healthchecks/pom.xml b/progression-healthchecks/pom.xml index 6f04f42944..3d9db328cb 100644 --- a/progression-healthchecks/pom.xml +++ b/progression-healthchecks/pom.xml @@ -3,7 +3,7 @@ progression-parent uk.gov.moj.cpp.progression - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-integration-test/pom.xml b/progression-integration-test/pom.xml index 29f0ce6220..317beb9ccb 100644 --- a/progression-integration-test/pom.xml +++ b/progression-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT false diff --git a/progression-performance-test/pom.xml b/progression-performance-test/pom.xml index 45c76bf01d..3388def447 100644 --- a/progression-performance-test/pom.xml +++ b/progression-performance-test/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-query/pom.xml b/progression-query/pom.xml index 60c88152d5..b02709d788 100644 --- a/progression-query/pom.xml +++ b/progression-query/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-query pom diff --git a/progression-query/progression-query-api/pom.xml b/progression-query/progression-query-api/pom.xml index a0e5752f78..649f2e0bcb 100644 --- a/progression-query/progression-query-api/pom.xml +++ b/progression-query/progression-query-api/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-query-api war diff --git a/progression-query/progression-query-view/pom.xml b/progression-query/progression-query-view/pom.xml index e9aeea7ad1..0316b5fce6 100644 --- a/progression-query/progression-query-view/pom.xml +++ b/progression-query/progression-query-view/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-query - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-query-view jar diff --git a/progression-refdata-service/pom.xml b/progression-refdata-service/pom.xml index 43ac2eaf69..c76db666df 100644 --- a/progression-refdata-service/pom.xml +++ b/progression-refdata-service/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT diff --git a/progression-service/pom.xml b/progression-service/pom.xml index 4f8e5d7281..7526faf593 100644 --- a/progression-service/pom.xml +++ b/progression-service/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT 4.0.0 diff --git a/progression-test-utilities/pom.xml b/progression-test-utilities/pom.xml index d107543490..5b5300fb31 100644 --- a/progression-test-utilities/pom.xml +++ b/progression-test-utilities/pom.xml @@ -7,7 +7,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT diff --git a/progression-viewstore/pom.xml b/progression-viewstore/pom.xml index 3f8dbf3879..731cb0ea43 100644 --- a/progression-viewstore/pom.xml +++ b/progression-viewstore/pom.xml @@ -3,7 +3,7 @@ uk.gov.moj.cpp.progression progression-parent - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-viewstore pom diff --git a/progression-viewstore/progression-viewstore-liquibase/pom.xml b/progression-viewstore/progression-viewstore-liquibase/pom.xml index a534ffad79..2493bccff6 100644 --- a/progression-viewstore/progression-viewstore-liquibase/pom.xml +++ b/progression-viewstore/progression-viewstore-liquibase/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-viewstore-liquibase diff --git a/progression-viewstore/progression-viewstore-persistence/pom.xml b/progression-viewstore/progression-viewstore-persistence/pom.xml index 600d59c043..ad6a909adb 100644 --- a/progression-viewstore/progression-viewstore-persistence/pom.xml +++ b/progression-viewstore/progression-viewstore-persistence/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.progression progression-viewstore - 17.0.244-cct-1981-SNAPSHOT + 17.0.245-cct-1981-SNAPSHOT progression-viewstore-persistence From aa286fdd103ce9f6400577744a25469e8d73b2de Mon Sep 17 00:00:00 2001 From: yashpalnegi Date: Tue, 7 Apr 2026 10:16:15 +0100 Subject: [PATCH 39/39] LPT-1784 - remove core domain dependency on hearingDay --- ...ect-hearing-days-without-court-centre.json | 4 +- ...ect-hearing-days-without-court-centre.json | 4 +- .../schema/moj-progression-hearingDay.json | 32 +++++++++++++++ .../json/schema/shared-definitions.json | 10 ++++- .../aggregate/HearingAggregateTest.java | 2 +- ...g-days-without-court-centre-corrected.json | 40 +++++++++---------- ...houtCourtCentreCorrectedEventListener.java | 6 +-- ...CourtCentreCorrectedEventListenerTest.java | 2 +- ...g-days-without-court-centre-corrected.json | 6 +-- .../progression-event-processor/pom.xml | 5 +++ .../HearingUpdatedEventProcessorTest.java | 27 +++++++++++++ ...g-days-without-court-centre-corrected.json | 6 +-- ...g-days-without-court-centre-corrected.json | 4 +- 13 files changed, 110 insertions(+), 38 deletions(-) create mode 100644 progression-domain/progression-datatypes-common/src/main/resources/json/schema/moj-progression-hearingDay.json diff --git a/progression-command/progression-command-api/src/raml/json/schema/progression.correct-hearing-days-without-court-centre.json b/progression-command/progression-command-api/src/raml/json/schema/progression.correct-hearing-days-without-court-centre.json index ddcf398b00..eeb20c9672 100644 --- a/progression-command/progression-command-api/src/raml/json/schema/progression.correct-hearing-days-without-court-centre.json +++ b/progression-command/progression-command-api/src/raml/json/schema/progression.correct-hearing-days-without-court-centre.json @@ -4,13 +4,13 @@ "type": "object", "properties": { "id": { - "$ref": "http://justice.gov.uk/core/courts/courtsDefinitions.json#/definitions/uuid" + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/uuid" }, "hearingDays": { "type": "array", "minItems": 1, "items": { - "$ref": "http://justice.gov.uk/core/courts/hearingDay.json" + "$ref": "http://moj.gov.uk/progression/hearingDay.json" } } }, diff --git a/progression-command/progression-command-handler/src/raml/json/schema/progression.command.correct-hearing-days-without-court-centre.json b/progression-command/progression-command-handler/src/raml/json/schema/progression.command.correct-hearing-days-without-court-centre.json index 884c07220a..75b70d096e 100644 --- a/progression-command/progression-command-handler/src/raml/json/schema/progression.command.correct-hearing-days-without-court-centre.json +++ b/progression-command/progression-command-handler/src/raml/json/schema/progression.command.correct-hearing-days-without-court-centre.json @@ -4,13 +4,13 @@ "type": "object", "properties": { "id": { - "$ref": "http://justice.gov.uk/core/courts/courtsDefinitions.json#/definitions/uuid" + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/uuid" }, "hearingDays": { "type": "array", "minItems": 1, "items": { - "$ref": "http://justice.gov.uk/core/courts/hearingDay.json" + "$ref": "http://moj.gov.uk/progression/hearingDay.json" } } }, diff --git a/progression-domain/progression-datatypes-common/src/main/resources/json/schema/moj-progression-hearingDay.json b/progression-domain/progression-datatypes-common/src/main/resources/json/schema/moj-progression-hearingDay.json new file mode 100644 index 0000000000..75bf252907 --- /dev/null +++ b/progression-domain/progression-datatypes-common/src/main/resources/json/schema/moj-progression-hearingDay.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "http://moj.gov.uk/progression/hearingDay.json", + "type": "object", + "properties": { + "sittingDay": { + "type": "string", + "format": "date-time" + }, + "listingSequence": { + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/positiveInteger" + }, + "listedDurationMinutes": { + "description": "The listed duration in minutes", + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/positiveInteger" + }, + "courtCentreId": { + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/uuid" + }, + "courtRoomId": { + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/uuid" + }, + "hasSharedResults": { + "type": "boolean" + } + }, + "required": [ + "sittingDay", + "listedDurationMinutes" + ], + "additionalProperties": false +} diff --git a/progression-domain/progression-datatypes-common/src/main/resources/json/schema/shared-definitions.json b/progression-domain/progression-datatypes-common/src/main/resources/json/schema/shared-definitions.json index 6e7745d8b7..050790e8a2 100644 --- a/progression-domain/progression-datatypes-common/src/main/resources/json/schema/shared-definitions.json +++ b/progression-domain/progression-datatypes-common/src/main/resources/json/schema/shared-definitions.json @@ -3,11 +3,19 @@ "id": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json", "type": "object", "definitions": { + "uuid": { + "type": "string", + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + }, + "positiveInteger": { + "type": "integer", + "minimum": 0 + }, "refData": { "type": "object", "properties": { "directionRefDataId": { - "$ref": "http://justice.gov.uk/core/courts/courtsDefinitions.json#/definitions/uuid" + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/uuid" }, "directionRefDataType": { "type": "string" diff --git a/progression-domain/progression-domain-aggregate/src/test/java/uk/gov/moj/cpp/progression/aggregate/HearingAggregateTest.java b/progression-domain/progression-domain-aggregate/src/test/java/uk/gov/moj/cpp/progression/aggregate/HearingAggregateTest.java index 7f32747220..b4ef9f0908 100644 --- a/progression-domain/progression-domain-aggregate/src/test/java/uk/gov/moj/cpp/progression/aggregate/HearingAggregateTest.java +++ b/progression-domain/progression-domain-aggregate/src/test/java/uk/gov/moj/cpp/progression/aggregate/HearingAggregateTest.java @@ -4473,7 +4473,7 @@ private Hearing getHearing(final UUID offenceId) { private HearingDaysWithoutCourtCentreCorrected createHearingDaysWithoutCourtCentreCorrected() { return HearingDaysWithoutCourtCentreCorrected.hearingDaysWithoutCourtCentreCorrected() - .withHearingDays(asList(HearingDay.hearingDay() + .withHearingDays(asList(uk.gov.moj.progression.HearingDay.hearingDay() .withCourtCentreId(UUID.randomUUID()) .withCourtRoomId(UUID.randomUUID()) .withListedDurationMinutes(30) diff --git a/progression-domain/progression-domain-message/src/raml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json b/progression-domain/progression-domain-message/src/raml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json index e9da12e247..6235ed97a2 100644 --- a/progression-domain/progression-domain-message/src/raml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json +++ b/progression-domain/progression-domain-message/src/raml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json @@ -1,21 +1,21 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://justice.gov.uk/progression/events/progression.events.hearing-days-without-court-centre-corrected.json", - "type": "object", - "properties": { - "hearingDays": { - "type": "array", - "items": { - "$ref": "http://justice.gov.uk/core/courts/hearingDay.json" - } - }, - "id": { - "$ref": "http://justice.gov.uk/domain/core/common/definitions.json#/definitions/uuid" - } - }, - "required": [ - "id", - "hearingDays" - ], - "additionalProperties": false -} \ No newline at end of file + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "http://justice.gov.uk/progression/events/progression.events.hearing-days-without-court-centre-corrected.json", + "type": "object", + "properties": { + "hearingDays": { + "type": "array", + "items": { + "$ref": "http://moj.gov.uk/progression/hearingDay.json" + } + }, + "id": { + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/uuid" + } + }, + "required": [ + "id", + "hearingDays" + ], + "additionalProperties": false +} diff --git a/progression-event/progression-event-listener/src/main/java/uk/gov/moj/cpp/prosecutioncase/event/listener/HearingDaysWithoutCourtCentreCorrectedEventListener.java b/progression-event/progression-event-listener/src/main/java/uk/gov/moj/cpp/prosecutioncase/event/listener/HearingDaysWithoutCourtCentreCorrectedEventListener.java index 90dd657f6b..c6bb72dede 100644 --- a/progression-event/progression-event-listener/src/main/java/uk/gov/moj/cpp/prosecutioncase/event/listener/HearingDaysWithoutCourtCentreCorrectedEventListener.java +++ b/progression-event/progression-event-listener/src/main/java/uk/gov/moj/cpp/prosecutioncase/event/listener/HearingDaysWithoutCourtCentreCorrectedEventListener.java @@ -48,10 +48,10 @@ public void correctHearingDaysWithoutCourtCentre(final JsonEnvelope event) { } final HearingDaysWithoutCourtCentreCorrected hearingDaysWithoutCourtCentreCorrected = jsonObjectToObjectConverter.convert(event.payloadAsJsonObject(), HearingDaysWithoutCourtCentreCorrected.class); - final List hearingDays = hearingDaysWithoutCourtCentreCorrected.getHearingDays(); + final List correctedHearingDays = hearingDaysWithoutCourtCentreCorrected.getHearingDays(); final UUID hearingId = hearingDaysWithoutCourtCentreCorrected.getId(); - final UUID courtCentreId = hearingDays.get(0).getCourtCentreId(); - final UUID courtRoomId = hearingDays.get(0).getCourtRoomId(); + final UUID courtCentreId = correctedHearingDays.get(0).getCourtCentreId(); + final UUID courtRoomId = correctedHearingDays.get(0).getCourtRoomId(); final HearingEntity dbHearingEntity = hearingRepository.findBy(hearingId); final JsonObject dbHearingJsonObject = jsonFromString(dbHearingEntity.getPayload()); diff --git a/progression-event/progression-event-listener/src/test/java/uk/gov/moj/cpp/prosecutioncase/event/listener/HearingDaysWithoutCourtCentreCorrectedEventListenerTest.java b/progression-event/progression-event-listener/src/test/java/uk/gov/moj/cpp/prosecutioncase/event/listener/HearingDaysWithoutCourtCentreCorrectedEventListenerTest.java index 6e409e1bd5..67ccdc6046 100644 --- a/progression-event/progression-event-listener/src/test/java/uk/gov/moj/cpp/prosecutioncase/event/listener/HearingDaysWithoutCourtCentreCorrectedEventListenerTest.java +++ b/progression-event/progression-event-listener/src/test/java/uk/gov/moj/cpp/prosecutioncase/event/listener/HearingDaysWithoutCourtCentreCorrectedEventListenerTest.java @@ -7,7 +7,7 @@ import static uk.gov.justice.services.test.utils.core.reflection.ReflectionUtil.setField; import uk.gov.justice.core.courts.Hearing; -import uk.gov.justice.core.courts.HearingDay; +import uk.gov.moj.progression.HearingDay; import uk.gov.justice.progression.events.HearingDaysWithoutCourtCentreCorrected; import uk.gov.justice.services.common.converter.JsonObjectToObjectConverter; import uk.gov.justice.services.common.converter.ObjectToJsonObjectConverter; diff --git a/progression-event/progression-event-listener/src/yaml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json b/progression-event/progression-event-listener/src/yaml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json index f49f0e3b8f..6235ed97a2 100644 --- a/progression-event/progression-event-listener/src/yaml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json +++ b/progression-event/progression-event-listener/src/yaml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json @@ -6,11 +6,11 @@ "hearingDays": { "type": "array", "items": { - "$ref": "http://justice.gov.uk/core/courts/hearingDay.json" + "$ref": "http://moj.gov.uk/progression/hearingDay.json" } }, "id": { - "$ref": "http://justice.gov.uk/domain/core/common/definitions.json#/definitions/uuid" + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/uuid" } }, "required": [ @@ -18,4 +18,4 @@ "hearingDays" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/progression-event/progression-event-processor/pom.xml b/progression-event/progression-event-processor/pom.xml index 2121096e15..c94d7842c1 100644 --- a/progression-event/progression-event-processor/pom.xml +++ b/progression-event/progression-event-processor/pom.xml @@ -39,6 +39,11 @@ progression-domain-common ${project.version} + + uk.gov.moj.cpp.progression + progression-datatypes-common + ${project.version} + uk.gov.moj.cpp.material material-client diff --git a/progression-event/progression-event-processor/src/test/java/uk/gov/moj/cpp/progression/processor/HearingUpdatedEventProcessorTest.java b/progression-event/progression-event-processor/src/test/java/uk/gov/moj/cpp/progression/processor/HearingUpdatedEventProcessorTest.java index 9ae74bcf59..e677e2ae8b 100644 --- a/progression-event/progression-event-processor/src/test/java/uk/gov/moj/cpp/progression/processor/HearingUpdatedEventProcessorTest.java +++ b/progression-event/progression-event-processor/src/test/java/uk/gov/moj/cpp/progression/processor/HearingUpdatedEventProcessorTest.java @@ -442,6 +442,33 @@ public void shouldHearingOffenceVerdictUpdated() { } + @Test + public void shouldHandlerHearingChangedToProbationCaseWorkerSendCorrectHearingDaysCommand() { + final UUID hearingId = randomUUID(); + final JsonObject payload = createObjectBuilder() + .add("id", hearingId.toString()) + .add("hearingDays", Json.createArrayBuilder() + .add(createObjectBuilder() + .add("sittingDay", "2020-10-13T10:00:00.000Z") + .add("listedDurationMinutes", 60) + .build()) + .build()) + .build(); + final JsonEnvelope jsonEnvelope = envelopeFrom( + metadataWithRandomUUID("public.events.listing.hearing-days-without-court-centre-corrected"), + payload); + + eventProcessor.handlerHearingChangedToProbationCaseWorker(jsonEnvelope); + + verify(sender, times(1)).send(senderJsonEnvelopeCaptor.capture()); + final DefaultEnvelope sent = senderJsonEnvelopeCaptor.getValue(); + assertThat(sent.metadata().name(), is("progression.command.correct-hearing-days-without-court-centre")); + assertThat(sent.payload().toString(), isJson(allOf( + withJsonPath("$.id", is(hearingId.toString())), + withJsonPath("$.hearingDays.length()", is(1)), + withJsonPath("$.hearingDays[0].listedDurationMinutes", is(60))))); + } + @Test public void shouldUpdateDefendantOnApplicationHearing() { final UUID applicationId1 = randomUUID(); diff --git a/progression-event/progression-event-processor/src/yaml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json b/progression-event/progression-event-processor/src/yaml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json index f49f0e3b8f..6235ed97a2 100644 --- a/progression-event/progression-event-processor/src/yaml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json +++ b/progression-event/progression-event-processor/src/yaml/json/schema/progression.events.hearing-days-without-court-centre-corrected.json @@ -6,11 +6,11 @@ "hearingDays": { "type": "array", "items": { - "$ref": "http://justice.gov.uk/core/courts/hearingDay.json" + "$ref": "http://moj.gov.uk/progression/hearingDay.json" } }, "id": { - "$ref": "http://justice.gov.uk/domain/core/common/definitions.json#/definitions/uuid" + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/uuid" } }, "required": [ @@ -18,4 +18,4 @@ "hearingDays" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/progression-event/progression-event-processor/src/yaml/json/schema/public.events.listing.hearing-days-without-court-centre-corrected.json b/progression-event/progression-event-processor/src/yaml/json/schema/public.events.listing.hearing-days-without-court-centre-corrected.json index f936fb8823..b9b2e0bb6e 100644 --- a/progression-event/progression-event-processor/src/yaml/json/schema/public.events.listing.hearing-days-without-court-centre-corrected.json +++ b/progression-event/progression-event-processor/src/yaml/json/schema/public.events.listing.hearing-days-without-court-centre-corrected.json @@ -4,13 +4,13 @@ "type": "object", "properties": { "id": { - "$ref": "http://justice.gov.uk/domain/core/common/definitions.json#/definitions/uuid" + "$ref": "http://moj.gov.uk/cpp/progression/common/shared-definitions.json#/definitions/uuid" }, "hearingDays": { "type": "array", "minItems": 1, "items": { - "$ref": "http://justice.gov.uk/core/courts/hearingDay.json" + "$ref": "http://moj.gov.uk/progression/hearingDay.json" } } },