diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml
index 1275dd64e..9e1c45fc2 100644
--- a/azure-pipelines.yaml
+++ b/azure-pipelines.yaml
@@ -26,7 +26,7 @@ resources:
pool:
name: "MDV-ADO-AGENT-AKS-01"
demands:
- - identifier -equals centos8-j17
+ - identifier -equals ubuntu-j17
variables:
sonarqubeProject: "uk.gov.moj.cpp.hearing:hearing-parent" # update eg: uk.gov.moj.cpp.listing:listing-parent
diff --git a/hearing-integration-test/src/test/java/uk/gov/moj/cpp/hearing/it/Utilities.java b/hearing-integration-test/src/test/java/uk/gov/moj/cpp/hearing/it/Utilities.java
index 378a8fffc..214d78389 100644
--- a/hearing-integration-test/src/test/java/uk/gov/moj/cpp/hearing/it/Utilities.java
+++ b/hearing-integration-test/src/test/java/uk/gov/moj/cpp/hearing/it/Utilities.java
@@ -290,6 +290,7 @@ public void execute(final int httpStatusCode) {
.header(new Header(USER_ID, cppUserId != null ? cppUserId.toString() : getLoggedInUser().toString())).when()
.post(url)
.then().extract().response();
+
assertThat(writeResponse.getStatusCode(), equalTo(httpStatusCode));
}
}
diff --git a/hearing-performance-test/pom.xml b/hearing-performance-test/pom.xml
new file mode 100644
index 000000000..7d15e8b07
--- /dev/null
+++ b/hearing-performance-test/pom.xml
@@ -0,0 +1,218 @@
+
+
+
+ hearing-parent
+ uk.gov.moj.cpp.hearing
+ 17.104.158-SNAPSHOT
+
+ 4.0.0
+
+ hearing-performance-test
+
+ *.jmx
+
+ true
+ true
+ 1024
+ 768
+
+ yyyyMMdd
+ ${basedir}/target/jmeter
+
+
+
+ hearing-performance-test
+
+ false
+
+
+
+
+ maven-resources-plugin
+
+
+ copy-jmeter-resources
+ process-test-resources
+
+ copy-resources
+
+
+ ${project.build.directory}/jmeter/data
+
+
+ src/test/data
+
+ **/*.json
+
+
+
+
+
+
+
+
+ com.lazerycode.jmeter
+ jmeter-maven-plugin
+ ${jmeter-maven-plugin.version}
+
+ 100
+
+
+
+ configuration
+
+ configure
+
+
+
+
+ org.postgresql:postgresql:42.3.2
+ org.apache.activemq:activemq-client:5.18.3
+ javax.jms:javax.jms-api:2.0.1
+ org.wiremock:wiremock:3.0.1
+
+ org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1
+
+ true
+ true
+ true
+ true
+ true
+ ${project.build.directory}/testresults/
+
+
+ ${jmeter.hearing.loopCount}
+
+
+ ${jmeter.hearing.numberOfThreads}
+
+
+ ${jmeter.hearing.rampUpPeriod}
+
+
+
+ ${jmeter.hearing.protocol}
+
+
+ ${jmeter.hearing.hostName}
+
+
+ ${jmeter.hearing.port}
+
+
+ ${jmeter.hearing.userId}
+
+
+ ${jmeter.hearing.dbHost}
+
+
+ ${jmeter.hearing.dbPort}
+
+
+ ${jmeter.hearing.dbUserName}
+
+
+ ${jmeter.hearing.dbPassword}
+
+
+ ${jmeter.hearing.metricsIntervalInMs}
+
+
+ ${jmeter.hearing.pollerTimeout}
+
+
+ ${jmeter.hearing.pollInterval}
+
+
+ ${jmeter.hearing.resultDir}
+
+
+ xml
+ false
+ ${maven.build.timestamp.format}
+
+
+
+
+ jmeter-tests
+
+ jmeter
+
+
+
+
+ jmeter-check-results
+
+ results
+
+
+
+
+
+ com.lazerycode.jmeter
+ jmeter-analysis-maven-plugin
+ 1.0.6
+
+
+ verify
+
+ analyze
+
+
+ ${project.build.directory}/**/*.jtl
+ ${project.build.directory}/testresults/
+
+
+
+
+
+
+
+
+
+ plugins-setup
+
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+ 3.0.2
+
+
+ copy
+ package
+
+ copy
+
+
+
+
+ kg.apc
+ jmeter-plugins-standard
+ 1.4.0
+ true
+ ${jmeter.directory}/lib/ext
+
+
+ kg.apc
+ jmeter-plugins-json
+ 2.6
+ true
+ ${jmeter.directory}/lib/ext
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/hearing-performance-test/src/test/data/add-prosecution-counsel-request.json b/hearing-performance-test/src/test/data/add-prosecution-counsel-request.json
new file mode 100644
index 000000000..b4a6fdeb7
--- /dev/null
+++ b/hearing-performance-test/src/test/data/add-prosecution-counsel-request.json
@@ -0,0 +1,14 @@
+{
+ "prosecutionCounsel": {
+ "attendanceDays": ["2026-01-20"],
+ "firstName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "id": "${prosecutionCounselId}",
+ "lastName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "middleName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionCases": ["${caseId}"],
+ "status": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "title": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "userId": "${__UUID}"
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/assign-user-to-role.json b/hearing-performance-test/src/test/data/assign-user-to-role.json
new file mode 100644
index 000000000..fd8abb118
--- /dev/null
+++ b/hearing-performance-test/src/test/data/assign-user-to-role.json
@@ -0,0 +1,13 @@
+{
+ "roleId": "${roleIdParam}",
+ "startDate": "2025-09-03",
+ "endDate": "2035-09-05",
+ "userId": "${userIdParam}",
+ "_metadata": {
+ "name": "usersgroups.command.assign-role-to-user",
+ "context": {
+ "user": "${userId}"
+ },
+ "id": "${__UUID}"
+ }
+}
\ No newline at end of file
diff --git a/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-add-prosecution-counsel-request.json b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-add-prosecution-counsel-request.json
new file mode 100644
index 000000000..9009729c6
--- /dev/null
+++ b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-add-prosecution-counsel-request.json
@@ -0,0 +1,14 @@
+{
+ "prosecutionCounsel": {
+ "attendanceDays": ["2026-01-26"],
+ "firstName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "id": "${prosecutionCounselId}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "middleName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionCases": ["${caseId}"],
+ "status": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "title": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-initiate-hearing-request.json b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-initiate-hearing-request.json
new file mode 100644
index 000000000..34860611c
--- /dev/null
+++ b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-initiate-hearing-request.json
@@ -0,0 +1,447 @@
+{
+ "hearing": {
+ "courtApplications": [
+ {
+ "applicant": {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Lauren",
+ "gender": "FEMALE",
+ "lastName": "Michelle",
+ "middleName": "Mia"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ "applicationReceivedDate": "2026-01-26",
+ "applicationReference": "12AA3456716",
+ "applicationStatus": "DRAFT",
+ "courtApplicationCases": [
+ {
+ "caseStatus": "INACTIVE",
+ "isSJP": false,
+ "offences": [
+ {
+ "id": "${courtApplicationOffenceId}",
+ "offenceCode": "offenceCode",
+ "offenceDefinitionId": "aa18fdc6-59f1-48ec-b4de-5aab1dd626e4",
+ "offenceTitle": "offenceTitle",
+ "startDate": "2026-01-26",
+ "wording": "wording"
+ }
+ ],
+ "prosecutionCaseId": "${courtApplicationCaseId}",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "prodAuthCode",
+ "prosecutionAuthorityId": "${__UUID}",
+ "prosecutionAuthorityReference": "prosecutionAuthorityReference"
+ }
+ }
+ ],
+ "courtOrder": {
+ "canBeSubjectOfBreachProceedings": false,
+ "canBeSubjectOfVariationProceedings": false,
+ "courtOrderOffences": [
+ {
+ "offence": {
+ "id": "${courtOrderOffenceId}",
+ "offenceCode": "offenceCode",
+ "offenceDefinitionId": "aed62ec6-2119-4ea3-aeff-365c4fd0fe5b",
+ "offenceTitle": "offenceTitle",
+ "startDate": "2026-01-26",
+ "wording": "wording"
+ },
+ "prosecutionCaseId": "${courtOrderCaseId}",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "prodAuthCode",
+ "prosecutionAuthorityId": "${__UUID}",
+ "prosecutionAuthorityReference": "prosecutionAuthorityReference"
+ }
+ }
+ ],
+ "id": "${courtOrderId}",
+ "isSJPOrder": false,
+ "judicialResultTypeId": "66ad4ed7-858d-4f93-9a3c-5c3f7876ecc8",
+ "label": "label",
+ "orderDate": "2026-01-26",
+ "orderingCourt": {
+ "id": "${__UUID}",
+ "name": "courtName"
+ },
+ "orderingHearingId": "${__UUID}",
+ "startDate": "2026-01-27"
+ },
+ "hearingIdToBeVacated": "${__UUID}",
+ "id": "${applicationId}",
+ "respondents": [
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Nina",
+ "gender": "FEMALE",
+ "lastName": "Turner"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Gerald",
+ "gender": "MALE",
+ "lastName": "Harrison"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ }
+ ],
+ "subject": {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Lauren",
+ "gender": "FEMALE",
+ "lastName": "Michelle",
+ "middleName": "Mia"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ "thirdParties": [
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Nina",
+ "gender": "FEMALE",
+ "lastName": "Turner"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Gerald",
+ "gender": "MALE",
+ "lastName": "Harrison"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ }
+ ],
+ "type": {
+ "appealFlag": false,
+ "applicantAppellantFlag": false,
+ "breachType": "NOT_APPLICABLE",
+ "categoryCode": "appCategory",
+ "code": "appCode",
+ "commrOfOathFlag": false,
+ "courtExtractAvlFlag": false,
+ "courtOfAppealFlag": false,
+ "id": "6c549872-0a99-4894-a2b0-c948f9d5f47c",
+ "jurisdiction": "EITHER",
+ "legislation": "appLegislation",
+ "linkType": "LINKED",
+ "offenceActiveOrder": "NOT_APPLICABLE",
+ "pleaApplicableFlag": false,
+ "prosecutorThirdPartyFlag": false,
+ "spiOutApplicableFlag": false,
+ "summonsTemplateType": "BREACH",
+ "type": "applicationType"
+ }
+ }
+ ],
+ "courtCentre": {
+ "id": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "name": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "roomId": "5d5d7b5e-7833-4dc1-b94a-d1a5c635c623",
+ "roomName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshRoomName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "defendantReferralReasons": [
+ {
+ "defendantId": "${defendantId}",
+ "description": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "id": "${defendantReferralReasonId}",
+ "welshDescription": "welshDescription"
+ }
+ ],
+ "hearingDays": [
+ {
+ "courtCentreId": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "listedDurationMinutes": 1565432415,
+ "listingSequence": 605404227,
+ "sittingDay": "2025-12-14T03:17:09.850Z"
+ },
+ {
+ "courtCentreId": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "listedDurationMinutes": 3717700,
+ "listingSequence": 1590799568,
+ "sittingDay": "2028-05-20T23:23:58.332Z"
+ }
+ ],
+ "hearingLanguage": "ENGLISH",
+ "id": "${hearingId}",
+ "isGroupProceedings": false,
+ "judiciary": [
+ {
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "isBenchChairman": false,
+ "isDeputy": false,
+ "judicialId": "${__UUID}",
+ "judicialRoleType": {
+ "judicialRoleTypeId": "8142cc95-0b18-49e5-a31b-c0252d92ba57",
+ "judiciaryType": "CIRCUIT_JUDGE"
+ },
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "middleName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "title": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ }
+ ],
+ "jurisdictionType": "CROWN",
+ "numberOfGroupCases": 0,
+ "prosecutionCases": [
+ {
+ "caseMarkers": [
+ {
+ "id": "${__UUID}",
+ "markerTypeCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "markerTypeDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "markerTypeid": "${__UUID}"
+ }
+ ],
+ "caseStatus": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "classOfCase": "Class 1",
+ "defendants": [
+ {
+ "courtProceedingsInitiated": "2026-01-26T13:49:10.858Z",
+ "id": "${defendantId}",
+ "isYouth": true,
+ "masterDefendantId": "${defendantId}",
+ "numberOfPreviousConvictionsCited": 27370140,
+ "offences": [
+ {
+ "allocationDecision": {
+ "allocationDecisionDate": "2026-01-26",
+ "courtIndicatedSentence": {
+ "courtIndicatedSentenceDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "courtIndicatedSentenceTypeId": "c05600a6-e8a1-4e5e-98cf-97fd18c9e558"
+ },
+ "motReasonCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "motReasonDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "motReasonId": "${__UUID}",
+ "offenceId": "${offenceId}",
+ "originatingHearingId": "${__UUID}",
+ "sequenceNumber": 516875879
+ },
+ "arrestDate": "2022-04-09",
+ "chargeDate": "2024-09-24",
+ "count": 481082926,
+ "custodyTimeLimit": {
+ "daysSpent": 67218384,
+ "isCtlExtended": false,
+ "timeLimit": "2024-01-04"
+ },
+ "endDate": "2025-06-01",
+ "endorsableFlag": true,
+ "id": "${offenceId}",
+ "indicatedPlea": {
+ "indicatedPleaDate": "2024-01-27",
+ "indicatedPleaValue": "INDICATED_GUILTY",
+ "offenceId": "${offenceId}",
+ "source": "ONLINE"
+ },
+ "introducedAfterInitialProceedings": true,
+ "isDiscontinued": true,
+ "laidDate": "2024-11-17",
+ "listingNumber": 758556708,
+ "modeOfTrial": "Either Way",
+ "notifiedPlea": {
+ "notifiedPleaDate": "2022-07-01",
+ "notifiedPleaValue": "NOTIFIED_GUILTY",
+ "offenceId": "${offenceId}"
+ },
+ "offenceCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "offenceDefinitionId": "304b7cdc-a769-451a-897b-8ffa0cb967e6",
+ "offenceFacts": {
+ "alcoholReadingAmount": 31260938,
+ "alcoholReadingMethodCode": "B",
+ "vehicleMake": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "vehicleRegistration": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "offenceLegislation": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "offenceLegislationWelsh": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceTitle": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceTitleWelsh": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "orderIndex": 1521592157,
+ "proceedingsConcluded": true,
+ "reportingRestrictions": [
+ {
+ "id": "${__UUID}",
+ "judicialResultId": "${__UUID}",
+ "label": "Yes",
+ "orderedDate": "2026-01-26"
+ }
+ ],
+ "startDate": "2023-08-21",
+ "wording": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "wordingWelsh": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ }
+ ],
+ "personDefendant": {
+ "arrestSummonsNumber": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "bailStatus": {
+ "code": "C",
+ "description": "Remanded into Custody",
+ "id": "5b08696e-add3-4a93-98e9-d668219d1f7d"
+ },
+ "custodialEstablishment": {
+ "custody": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "id": "${__UUID}",
+ "name": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "custodyTimeLimit": "2025-03-22",
+ "driverNumber": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "employerOrganisation": {
+ "address": {
+ "address1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "postcode": "NU44 3XQ",
+ "welshAddress1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "contact": {
+ "fax": "${__RandomString(10,0123456789,)}",
+ "home": "${__RandomString(10,0123456789,)}",
+ "mobile": "${__RandomString(10,0123456789,)}",
+ "primaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(5,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "secondaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(5,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "work": "${__RandomString(10,0123456789,)}"
+ },
+ "incorporationNumber": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "name": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "registeredCharityNumber": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "employerPayrollReference": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "perceivedBirthYear": 2032651116,
+ "personDetails": {
+ "additionalNationalityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "additionalNationalityId": "${__UUID}",
+ "address": {
+ "address1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "postcode": "I38 3EP",
+ "welshAddress1": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress2": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress3": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress4": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress5": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "contact": {
+ "fax": "${__RandomString(10,0123456789,)}",
+ "home": "${__RandomString(10,0123456789,)}",
+ "mobile": "${__RandomString(10,0123456789,)}",
+ "primaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(5,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "secondaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(5,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "work": "${__RandomString(10,0123456789,)}"
+ },
+ "dateOfBirth": "2021-05-17",
+ "disabilityStatus": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "documentationLanguageNeeds": "ENGLISH",
+ "ethnicity": {
+ "observedEthnicityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "gender": "NOT_SPECIFIED",
+ "interpreterLanguageNeeds": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "middleName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "nationalInsuranceNumber": "AS374744D",
+ "nationalityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "nationalityDescription": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "nationalityId": "${__UUID}",
+ "occupation": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "occupationCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "specificRequirements": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "title": "Lieutanant"
+ }
+ },
+ "proceedingsConcluded": false,
+ "prosecutionAuthorityReference": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionCaseId": "${caseId}"
+ }
+ ],
+ "id": "${caseId}",
+ "initiationCode": "Z",
+ "isGroupMaster": false,
+ "originatingOrganisation": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}",
+ "caseURN": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "statementOfFacts": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "statementOfFactsWelsh": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ }
+ ],
+ "reportingRestrictionReason": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "type": {
+ "description": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "id": "9cc41e45-b594-4ba6-906e-1a4626b08fed",
+ "welshDescription": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ }
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-set-trial-type-request.json b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-set-trial-type-request.json
new file mode 100644
index 000000000..378702e8c
--- /dev/null
+++ b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-set-trial-type-request.json
@@ -0,0 +1,4 @@
+{
+ "trialTypeId": "9d738c6e-04fc-4e18-bc49-b599973af7c6"
+}
+
diff --git a/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-share-results-request.json b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-share-results-request.json
new file mode 100644
index 000000000..f9bdb6f62
--- /dev/null
+++ b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-share-results-request.json
@@ -0,0 +1,39 @@
+{
+ "courtClerk": {
+ "firstName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ },
+ "resultLines": [
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-09-15",
+ "sharedDate": "2026-01-26",
+ "resultLineId": "${resultLineId}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "1f3c83cc-53eb-4861-8cb8-2289b4a08307",
+ "prompts": [
+ {
+ "id": "1f3c83cc-53eb-4861-8cb8-2289b4a08307",
+ "label": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "fixedListCode": "fixedListCode",
+ "value": "value1",
+ "welshValue": "wvalue1"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ }
+ ]
+}
+
diff --git a/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-update-defendant-attendance-request.json b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-update-defendant-attendance-request.json
new file mode 100644
index 000000000..95ba2bb16
--- /dev/null
+++ b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-update-defendant-attendance-request.json
@@ -0,0 +1,9 @@
+{
+ "hearingId": "${hearingId}",
+ "defendantId": "${defendantId}",
+ "attendanceDay": {
+ "attendanceType": "IN_PERSON",
+ "day": "2025-12-14"
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-update-verdict-request.json b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-update-verdict-request.json
new file mode 100644
index 000000000..8ac0828e9
--- /dev/null
+++ b/hearing-performance-test/src/test/data/cancel-remaining-hearing-days-update-verdict-request.json
@@ -0,0 +1,31 @@
+{
+ "verdicts": [
+ {
+ "jurors": {
+ "numberOfJurors": 11,
+ "numberOfSplitJurors": 0,
+ "unanimous": true
+ },
+ "lesserOrAlternativeOffence": {
+ "offenceCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "offenceDefinitionId": "f66493f7-6081-4ea2-aaa2-cebc5105a428",
+ "offenceLegislation": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceLegislationWelsh": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "offenceTitle": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceTitleWelsh": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "offenceId": "${offenceId}",
+ "originatingHearingId": "${hearingId}",
+ "verdictDate": "2021-09-24",
+ "verdictType": {
+ "category": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "categoryType": "GUILTY",
+ "description": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "id": "c4ca4238-a0b9-3382-8dcc-509a6f75849b",
+ "sequence": 1427069882,
+ "verdictCode": "VC01"
+ }
+ }
+ ]
+}
+
diff --git a/hearing-performance-test/src/test/data/court-list-restriction-app-initiate-hearing-request.json b/hearing-performance-test/src/test/data/court-list-restriction-app-initiate-hearing-request.json
new file mode 100644
index 000000000..d3b078b2a
--- /dev/null
+++ b/hearing-performance-test/src/test/data/court-list-restriction-app-initiate-hearing-request.json
@@ -0,0 +1,272 @@
+{
+ "hearing": {
+ "courtApplications": [
+ {
+ "applicant": {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Lauren",
+ "gender": "FEMALE",
+ "lastName": "Michelle",
+ "middleName": "Mia"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ "applicationReceivedDate": "2026-01-23",
+ "applicationReference": "12AA3456716",
+ "applicationStatus": "DRAFT",
+ "courtApplicationCases": [
+ {
+ "caseStatus": "ACTIVE",
+ "isSJP": false,
+ "offences": [
+ {
+ "id": "${__UUID}",
+ "offenceCode": "OFC",
+ "offenceDefinitionId": "${__UUID}",
+ "offenceLegislation": "OffenceLegislation",
+ "offenceTitle": "OFC TITLE",
+ "startDate": "2026-01-23",
+ "wording": "WORDING"
+ }
+ ],
+ "prosecutionCaseId": "${caseId}",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionAuthorityId": "${__UUID}",
+ "caseURN": "Case Reference"
+ }
+ }
+ ],
+ "courtOrder": {
+ "canBeSubjectOfBreachProceedings": false,
+ "canBeSubjectOfVariationProceedings": false,
+ "courtOrderOffences": [
+ {
+ "offence": {
+ "id": "${__UUID}",
+ "offenceCode": "OFC",
+ "offenceDefinitionId": "${__UUID}",
+ "offenceLegislation": "OffenceLegislation",
+ "offenceTitle": "OFC TITLE",
+ "startDate": "2026-01-23",
+ "wording": "WORDING"
+ },
+ "prosecutionCaseId": "${__UUID}",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionAuthorityId": "${__UUID}",
+ "caseURN": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ }
+ }
+ ],
+ "id": "${__UUID}",
+ "isSJPOrder": false,
+ "judicialResultTypeId": "${__UUID}",
+ "label": "label",
+ "orderDate": "2026-01-23",
+ "orderingCourt": {
+ "id": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "name": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "roomId": "5d5d7b5e-7833-4dc1-b94a-d1a5c635c623",
+ "roomName": "CourtRoom 1",
+ "welshName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshRoomName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "orderingHearingId": "${__UUID}",
+ "startDate": "2026-01-23"
+ },
+ "hearingIdToBeVacated": "${__UUID}",
+ "id": "${__UUID}",
+ "respondents": [
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Nina",
+ "gender": "FEMALE",
+ "lastName": "Turner"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Gerald",
+ "gender": "MALE",
+ "lastName": "Harrison"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ }
+ ],
+ "subject": {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Lauren",
+ "gender": "FEMALE",
+ "lastName": "Michelle",
+ "middleName": "Mia"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ "thirdParties": [
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Nina",
+ "gender": "FEMALE",
+ "lastName": "Turner"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Gerald",
+ "gender": "MALE",
+ "lastName": "Harrison"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ }
+ ],
+ "type": {
+ "appealFlag": false,
+ "applicantAppellantFlag": false,
+ "breachType": "NOT_APPLICABLE",
+ "categoryCode": "appCategory",
+ "code": "appCode",
+ "commrOfOathFlag": false,
+ "courtExtractAvlFlag": false,
+ "courtOfAppealFlag": false,
+ "id": "${__UUID}",
+ "jurisdiction": "EITHER",
+ "legislation": "appLegislation",
+ "linkType": "LINKED",
+ "offenceActiveOrder": "NOT_APPLICABLE",
+ "pleaApplicableFlag": false,
+ "prosecutorThirdPartyFlag": false,
+ "spiOutApplicableFlag": false,
+ "summonsTemplateType": "BREACH",
+ "type": "applicationType"
+ }
+ }
+ ],
+ "courtCentre": {
+ "id": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "name": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "roomId": "5d5d7b5e-7833-4dc1-b94a-d1a5c635c623",
+ "roomName": "CourtRoom 1",
+ "welshName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshRoomName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "defenceCounsels": [
+ {
+ "attendanceDays": ["2026-01-23"],
+ "defendants": ["${defendantId}"],
+ "firstName": "John",
+ "id": "${defenceCounselId}",
+ "lastName": "Jones",
+ "status": "OPEN",
+ "title": "Mr"
+ }
+ ],
+ "defendantReferralReasons": [
+ {
+ "defendantId": "${defendantId}",
+ "description": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "id": "${defendantReferralReasonId}",
+ "welshDescription": "welshDescription"
+ }
+ ],
+ "hearingDays": [
+ {
+ "listedDurationMinutes": 2007013476,
+ "listingSequence": 1,
+ "sittingDay": "2026-01-24T11:00:11.297Z"
+ },
+ {
+ "listedDurationMinutes": 38549104,
+ "listingSequence": 4,
+ "sittingDay": "2026-01-23T11:00:11.297Z"
+ },
+ {
+ "listedDurationMinutes": 1279293904,
+ "listingSequence": 4,
+ "sittingDay": "2026-01-22T11:00:11.297Z"
+ }
+ ],
+ "hearingLanguage": "ENGLISH",
+ "id": "${hearingId}",
+ "judiciary": [
+ {
+ "firstName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "isBenchChairman": false,
+ "isDeputy": false,
+ "judicialId": "${__UUID}",
+ "judicialRoleType": {
+ "judicialRoleTypeId": "${__UUID}",
+ "judiciaryType": "CIRCUIT_JUDGE"
+ },
+ "lastName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "middleName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "title": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "userId": "${__UUID}"
+ }
+ ],
+ "jurisdictionType": "CROWN",
+ "reportingRestrictionReason": "",
+ "type": {
+ "description": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "id": "9cc41e45-b594-4ba6-906e-1a4626b08fed",
+ "welshDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ }
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/court-list-restriction-initiate-hearing-request.json b/hearing-performance-test/src/test/data/court-list-restriction-initiate-hearing-request.json
new file mode 100644
index 000000000..beaa7f494
--- /dev/null
+++ b/hearing-performance-test/src/test/data/court-list-restriction-initiate-hearing-request.json
@@ -0,0 +1,353 @@
+{
+ "hearing": {
+ "courtCentre": {
+ "id": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "name": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "roomId": "5d5d7b5e-7833-4dc1-b94a-d1a5c635c623",
+ "roomName": "CourtRoom 1",
+ "welshName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshRoomName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "defenceCounsels": [
+ {
+ "attendanceDays": ["2026-01-23"],
+ "defendants": ["${defendantId}"],
+ "firstName": "John",
+ "id": "${defenceCounselId}",
+ "lastName": "Jones",
+ "status": "OPEN",
+ "title": "Mr"
+ }
+ ],
+ "defendantReferralReasons": [
+ {
+ "defendantId": "${defendantId}",
+ "description": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "id": "${defendantReferralReasonId}",
+ "welshDescription": "welshDescription"
+ }
+ ],
+ "hearingDays": [
+ {
+ "listedDurationMinutes": 227266322,
+ "listingSequence": 4,
+ "sittingDay": "2026-01-24T11:00:11.297Z"
+ },
+ {
+ "listedDurationMinutes": 497344717,
+ "listingSequence": 3,
+ "sittingDay": "2026-01-23T11:00:11.297Z"
+ },
+ {
+ "listedDurationMinutes": 571297702,
+ "listingSequence": 5,
+ "sittingDay": "2026-01-22T11:00:11.297Z"
+ }
+ ],
+ "hearingLanguage": "ENGLISH",
+ "id": "${hearingId}",
+ "judiciary": [
+ {
+ "firstName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "isBenchChairman": true,
+ "isDeputy": true,
+ "judicialId": "${__UUID}",
+ "judicialRoleType": {
+ "judicialRoleTypeId": "${__UUID}",
+ "judiciaryType": "CIRCUIT_JUDGE"
+ },
+ "lastName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "middleName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "title": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "userId": "${__UUID}"
+ }
+ ],
+ "jurisdictionType": "CROWN",
+ "prosecutionCases": [
+ {
+ "caseMarkers": [
+ {
+ "id": "${__UUID}",
+ "markerTypeCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "markerTypeDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "markerTypeid": "${__UUID}"
+ }
+ ],
+ "caseStatus": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "classOfCase": "Class 1",
+ "defendants": [
+ {
+ "associatedPersons": [
+ {
+ "person": {
+ "additionalNationalityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "additionalNationalityId": "${__UUID}",
+ "address": {
+ "address1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "postcode": "YK2 6QU",
+ "welshAddress1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "contact": {
+ "fax": "${__Random(1000000000,9999999999,)}",
+ "home": "${__Random(1000000000,9999999999,)}",
+ "mobile": "${__Random(1000000000,9999999999,)}",
+ "primaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "secondaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "work": "${__Random(1000000000,9999999999,)}"
+ },
+ "dateOfBirth": "2024-06-07",
+ "disabilityStatus": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "documentationLanguageNeeds": "ENGLISH",
+ "ethnicity": {
+ "observedEthnicityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "firstName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "gender": "MALE",
+ "interpreterLanguageNeeds": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "lastName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "middleName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "nationalInsuranceNumber": "LB201184A",
+ "nationalityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "nationalityDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "nationalityId": "${__UUID}",
+ "occupation": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "occupationCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "specificRequirements": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "title": "Lieutanant"
+ },
+ "role": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ }
+ ],
+ "courtProceedingsInitiated": "2026-01-23T15:40:51.859Z",
+ "defenceOrganisation": {
+ "address": {
+ "address1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "postcode": "YK2 6QU",
+ "welshAddress1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "contact": {
+ "fax": "${__Random(1000000000,9999999999,)}",
+ "home": "${__Random(1000000000,9999999999,)}",
+ "mobile": "${__Random(1000000000,9999999999,)}",
+ "primaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "secondaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "work": "${__Random(1000000000,9999999999,)}"
+ },
+ "incorporationNumber": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "name": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "registeredCharityNumber": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "id": "${defendantId}",
+ "isYouth": true,
+ "masterDefendantId": "${defendantId}",
+ "numberOfPreviousConvictionsCited": 2025639425,
+ "offences": [
+ {
+ "allocationDecision": {
+ "allocationDecisionDate": "2026-01-23",
+ "courtIndicatedSentence": {
+ "courtIndicatedSentenceDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "courtIndicatedSentenceTypeId": "${__UUID}"
+ },
+ "motReasonCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "motReasonDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "motReasonId": "${__UUID}",
+ "offenceId": "${offenceId}",
+ "originatingHearingId": "${__UUID}",
+ "sequenceNumber": 690293944
+ },
+ "arrestDate": "2024-03-13",
+ "chargeDate": "2022-06-28",
+ "count": 1734848576,
+ "custodyTimeLimit": {
+ "daysSpent": 920092848,
+ "isCtlExtended": false,
+ "timeLimit": "2024-10-23"
+ },
+ "endDate": "2022-02-28",
+ "endorsableFlag": true,
+ "id": "${offenceId}",
+ "indicatedPlea": {
+ "indicatedPleaDate": "2023-09-14",
+ "indicatedPleaValue": "INDICATED_GUILTY",
+ "offenceId": "${offenceId}",
+ "source": "IN_COURT"
+ },
+ "introducedAfterInitialProceedings": true,
+ "isDiscontinued": true,
+ "laidDate": "2024-10-11",
+ "listingNumber": 846956288,
+ "modeOfTrial": "Either Way",
+ "notifiedPlea": {
+ "notifiedPleaDate": "2022-08-11",
+ "notifiedPleaValue": "NOTIFIED_NOT_GUILTY",
+ "offenceId": "${offenceId}"
+ },
+ "offenceCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceDefinitionId": "${__UUID}",
+ "offenceFacts": {
+ "alcoholReadingAmount": 361089850,
+ "alcoholReadingMethodCode": "B",
+ "vehicleMake": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "vehicleRegistration": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "offenceLegislation": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceLegislationWelsh": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceTitle": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceTitleWelsh": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "orderIndex": 188666691,
+ "proceedingsConcluded": true,
+ "reportingRestrictions": [
+ {
+ "id": "${__UUID}",
+ "judicialResultId": "${__UUID}",
+ "label": "Yes",
+ "orderedDate": "2026-01-23"
+ }
+ ],
+ "startDate": "2021-09-28",
+ "wording": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "wordingWelsh": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ }
+ ],
+ "personDefendant": {
+ "arrestSummonsNumber": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "bailStatus": {
+ "code": "C",
+ "description": "Remanded into Custody",
+ "id": "ee3993f1-c047-41ab-8b30-3d842c6529e4"
+ },
+ "custodialEstablishment": {
+ "custody": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "id": "${__UUID}",
+ "name": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "custodyTimeLimit": "2021-03-30",
+ "driverNumber": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "employerOrganisation": {
+ "address": {
+ "address1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "postcode": "YK2 6QU",
+ "welshAddress1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "contact": {
+ "fax": "${__Random(1000000000,9999999999,)}",
+ "home": "${__Random(1000000000,9999999999,)}",
+ "mobile": "${__Random(1000000000,9999999999,)}",
+ "primaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "secondaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "work": "${__Random(1000000000,9999999999,)}"
+ },
+ "incorporationNumber": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "name": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "registeredCharityNumber": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "employerPayrollReference": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "perceivedBirthYear": 1973824563,
+ "personDetails": {
+ "additionalNationalityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "additionalNationalityId": "${__UUID}",
+ "address": {
+ "address1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "postcode": "YK2 6QU",
+ "welshAddress1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress2": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress3": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress4": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "welshAddress5": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "contact": {
+ "fax": "${__Random(1000000000,9999999999,)}",
+ "home": "${__Random(1000000000,9999999999,)}",
+ "mobile": "${__Random(1000000000,9999999999,)}",
+ "primaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "secondaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "work": "${__Random(1000000000,9999999999,)}"
+ },
+ "dateOfBirth": "2024-02-16",
+ "disabilityStatus": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "documentationLanguageNeeds": "ENGLISH",
+ "ethnicity": {
+ "observedEthnicityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "firstName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "gender": "MALE",
+ "interpreterLanguageNeeds": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "lastName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "middleName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "nationalInsuranceNumber": "LB201184A",
+ "nationalityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "nationalityDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "nationalityId": "${__UUID}",
+ "occupation": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "occupationCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "specificRequirements": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "title": "Lieutanant"
+ }
+ },
+ "prosecutionCaseId": "${caseId}"
+ }
+ ],
+ "id": "${caseId}",
+ "initiationCode": "J",
+ "isGroupMaster": false,
+ "originatingOrganisation": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionCaseIdentifier": {
+ "address": {
+ "address1": "line 1",
+ "address2": "line 2",
+ "address3": "line 3",
+ "address4": "line 4",
+ "address5": "line 5",
+ "postcode": "E14 4EX"
+ },
+ "contact": {
+ "primaryEmail": "contact@cpp.co.uk"
+ },
+ "prosecutionAuthorityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "prosecutionAuthorityId": "${__UUID}",
+ "prosecutionAuthorityName": "ProsecutionAuthorityName",
+ "prosecutorCategory": "Charity",
+ "caseURN": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "statementOfFacts": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "statementOfFactsWelsh": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ }
+ ],
+ "reportingRestrictionReason": "",
+ "type": {
+ "description": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "id": "9cc41e45-b594-4ba6-906e-1a4626b08fed",
+ "welshDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ }
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/create-group-request.json b/hearing-performance-test/src/test/data/create-group-request.json
new file mode 100644
index 000000000..af47d5163
--- /dev/null
+++ b/hearing-performance-test/src/test/data/create-group-request.json
@@ -0,0 +1,13 @@
+{
+ "name": "${groupName}",
+ "source": "CPP",
+ "category": "AREA",
+ "organisationId": "${organisationId}",
+ "_metadata": {
+ "name": "usersgroups.command.create-group",
+ "context": {
+ "user": "${userId}"
+ },
+ "id": "${__UUID}"
+ }
+}
\ No newline at end of file
diff --git a/hearing-performance-test/src/test/data/create-organisation-request.json b/hearing-performance-test/src/test/data/create-organisation-request.json
new file mode 100644
index 000000000..f6d0b110f
--- /dev/null
+++ b/hearing-performance-test/src/test/data/create-organisation-request.json
@@ -0,0 +1,20 @@
+{
+ "timeTriggered": "2011-12-03T10:15:30+01:00",
+ "organisationId": "${organisationId}",
+ "organisationType": "CPS",
+ "organisationName": "${__RandomString(20,abcdefghijklmnoprqstvwxyz,)}",
+ "addressLine1": "Legal House",
+ "addressLine2": "15 Sewell Street",
+ "addressLine3": "Hammersmith",
+ "addressLine4": "London",
+ "addressPostcode": "SE14 2AB",
+ "phoneNumber": "080012345678",
+ "email": "joe@example.com",
+ "_metadata": {
+ "name": "usersgroups.create-organisation-with-details",
+ "context": {
+ "user": "${userId}"
+ },
+ "id": "${__UUID}"
+ }
+}
\ No newline at end of file
diff --git a/hearing-performance-test/src/test/data/create-permission-with-details.json b/hearing-performance-test/src/test/data/create-permission-with-details.json
new file mode 100644
index 000000000..fc2f11a71
--- /dev/null
+++ b/hearing-performance-test/src/test/data/create-permission-with-details.json
@@ -0,0 +1,15 @@
+{
+ "object": "case",
+ "action": "view",
+ "active": true,
+ "id": "${__UUID}",
+ "source": "${userIdParam}",
+ "target": "${__UUID}",
+ "_metadata": {
+ "name": "usersgroups.create-permission-with-details",
+ "context": {
+ "user": "${userId}"
+ },
+ "id": "${__UUID}"
+ }
+}
\ No newline at end of file
diff --git a/hearing-performance-test/src/test/data/create-role-request.json b/hearing-performance-test/src/test/data/create-role-request.json
new file mode 100644
index 000000000..2cd40dc19
--- /dev/null
+++ b/hearing-performance-test/src/test/data/create-role-request.json
@@ -0,0 +1,15 @@
+{
+ "label": "${roleName}",
+ "description": "${__RandomString(50,abcdefghijklmnoprqstvwxyz,)}",
+ "selectable": false,
+ "groupIds": [
+ "${groupId}"
+ ],
+ "_metadata": {
+ "name": "usersgroups.create-role-with-details",
+ "context": {
+ "user": "${userId}"
+ },
+ "id": "${__UUID}"
+ }
+}
\ No newline at end of file
diff --git a/hearing-performance-test/src/test/data/create-user-request.json b/hearing-performance-test/src/test/data/create-user-request.json
new file mode 100644
index 000000000..f1a876b4d
--- /dev/null
+++ b/hearing-performance-test/src/test/data/create-user-request.json
@@ -0,0 +1,16 @@
+{
+ "firstName": "${__RandomString(20,abcdefghijklmnoprqstvwxyz,)}",
+ "lastName": "${__RandomString(20,abcdefghijklmnoprqstvwxyz,)}",
+ "email": "Fred.Bloggs@jones.com",
+ "source": "IDAM",
+ "userType": "User",
+ "organisationId": "${organisationId}",
+ "userId": "${newUserId}",
+ "_metadata": {
+ "name": "usersgroups.set-user-details",
+ "context": {
+ "user": "${userId}"
+ },
+ "id": "${__UUID}"
+ }
+}
\ No newline at end of file
diff --git a/hearing-performance-test/src/test/data/initiate-hearing-request.json b/hearing-performance-test/src/test/data/initiate-hearing-request.json
new file mode 100644
index 000000000..a230fb225
--- /dev/null
+++ b/hearing-performance-test/src/test/data/initiate-hearing-request.json
@@ -0,0 +1,246 @@
+{
+ "hearing": {
+ "courtApplications": [
+ {
+ "applicant": {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "gender": "FEMALE",
+ "lastName": "${__RandomString(20,abcdefghijklmnoprqstvwxyz,)}",
+ "middleName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "j7TOYA96md",
+ "prosecutionAuthorityId": "ae88eff2-a3e4-4845-b793-05896e8c07e2"
+ },
+ "summonsRequired": false
+ },
+ "applicationReceivedDate": "2026-01-20",
+ "applicationReference": "12AA3456716",
+ "applicationStatus": "DRAFT",
+ "courtApplicationCases": [
+ {
+ "caseStatus": "INACTIVE",
+ "isSJP": false,
+ "offences": [
+ {
+ "id": "${courtApplicationOffenceId}",
+ "offenceCode": "offenceCode",
+ "offenceDefinitionId": "67f1a0db-c703-4705-b224-7f023cb47ce5",
+ "offenceTitle": "offenceTitle",
+ "startDate": "2026-01-20",
+ "wording": "wording"
+ }
+ ],
+ "prosecutionCaseId": "${courtApplicationCaseId}",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "prodAuthCode",
+ "prosecutionAuthorityId": "a8897f5e-42a9-43d5-940d-ca9df8b84bf2",
+ "prosecutionAuthorityReference": "prosecutionAuthorityReference"
+ }
+ }
+ ],
+ "courtOrder": {
+ "canBeSubjectOfBreachProceedings": false,
+ "canBeSubjectOfVariationProceedings": false,
+ "courtOrderOffences": [
+ {
+ "offence": {
+ "id": "${courtOrderOffenceId}",
+ "offenceCode": "offenceCode",
+ "offenceDefinitionId": "1fc16701-cae4-41e4-b4b9-1413ba42bcb1",
+ "offenceTitle": "offenceTitle",
+ "startDate": "2026-01-20",
+ "wording": "wording"
+ },
+ "prosecutionCaseId": "${courtOrderCaseId}",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "prodAuthCode",
+ "prosecutionAuthorityId": "6d2c790e-ab5b-4738-be5e-1f834e2cc52f",
+ "prosecutionAuthorityReference": "prosecutionAuthorityReference"
+ }
+ }
+ ],
+ "id": "${courtOrderId}",
+ "isSJPOrder": false,
+ "judicialResultTypeId": "bacdfcc7-46a4-4a8f-8260-8f79b9b01e5f",
+ "label": "label",
+ "orderDate": "2026-01-20",
+ "orderingCourt": {
+ "id": "ca8ae807-d925-4931-8cb7-455d6bc53d6e",
+ "name": "courtName"
+ },
+ "orderingHearingId": "b3849551-529b-41a3-b2e8-dd3bf6365cfa",
+ "startDate": "2026-01-21"
+ },
+ "hearingIdToBeVacated": "282fe98c-6ddb-447e-929d-7c92d3e8191f",
+ "id": "${applicationId}",
+ "respondents": [
+ {
+ "id": "4bfe0098-ec6c-4172-bd52-6db4272adef2",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Nina",
+ "gender": "FEMALE",
+ "lastName": "Turner"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "RHbiYcF0Ci",
+ "prosecutionAuthorityId": "60eb6f53-9908-4759-ab32-745ed716e909"
+ },
+ "summonsRequired": false
+ }
+ ],
+ "subject": {
+ "id": "7cb00f54-a847-4b51-a72b-68796372a404",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Lauren",
+ "gender": "FEMALE",
+ "lastName": "Michelle",
+ "middleName": "Mia"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "j7TOYA96md",
+ "prosecutionAuthorityId": "ae88eff2-a3e4-4845-b793-05896e8c07e2"
+ },
+ "summonsRequired": false
+ },
+ "type": {
+ "appealFlag": false,
+ "applicantAppellantFlag": false,
+ "breachType": "NOT_APPLICABLE",
+ "categoryCode": "appCategory",
+ "code": "appCode",
+ "commrOfOathFlag": false,
+ "courtExtractAvlFlag": false,
+ "courtOfAppealFlag": false,
+ "id": "22ad6fc5-9e0a-4452-a339-7b7679407aff",
+ "jurisdiction": "EITHER",
+ "legislation": "appLegislation",
+ "linkType": "LINKED",
+ "offenceActiveOrder": "NOT_APPLICABLE",
+ "pleaApplicableFlag": false,
+ "prosecutorThirdPartyFlag": false,
+ "spiOutApplicableFlag": false,
+ "summonsTemplateType": "BREACH",
+ "type": "applicationType"
+ }
+ }
+ ],
+ "courtCentre": {
+ "id": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "name": "8hsBh0ZDod",
+ "roomId": "5d5d7b5e-7833-4dc1-b94a-d1a5c635c623",
+ "roomName": "WIZXpa0OOw",
+ "welshName": "RRiSWWmVlO",
+ "welshRoomName": "pwUFk0Ccg1"
+ },
+ "hearingDays": [
+ {
+ "courtCentreId": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "courtRoomId": "5d5d7b5e-7833-4dc1-b94a-d1a5c635c623",
+ "hasSharedResults": true,
+ "listedDurationMinutes": 876436711,
+ "listingSequence": 631433925,
+ "sittingDay": "2026-01-27T15:54:36.393Z"
+ }
+ ],
+ "hearingLanguage": "ENGLISH",
+ "id": "${hearingId}",
+ "isGroupProceedings": false,
+ "judiciary": [
+ {
+ "firstName": "m4Do0AdtmK",
+ "isBenchChairman": true,
+ "isDeputy": false,
+ "judicialId": "a07fb1ad-c8cd-4f51-994a-6f95e574d0c5",
+ "judicialRoleType": {
+ "judicialRoleTypeId": "3cbda180-6e28-4e86-8827-e0a1c813c17d",
+ "judiciaryType": "CIRCUIT_JUDGE"
+ },
+ "lastName": "rrwpl7yUjZ",
+ "middleName": "ehfJYESLFh",
+ "title": "xzOMitR9eh",
+ "userId": "5b4c725b-ad50-492b-b4b3-a42b824f181a"
+ }
+ ],
+ "jurisdictionType": "CROWN",
+ "numberOfGroupCases": 0,
+ "prosecutionCases": [
+ {
+ "caseStatus": "xnKVZk5Vtl",
+ "classOfCase": "Class 1",
+ "defendants": [
+ {
+ "courtProceedingsInitiated": "2026-01-20T15:54:36.421Z",
+ "id": "${defendantId}",
+ "isYouth": true,
+ "masterDefendantId": "${defendantId}",
+ "numberOfPreviousConvictionsCited": 855030297,
+ "offences": [
+ {
+ "arrestDate": "2024-07-01",
+ "chargeDate": "2024-06-19",
+ "count": 1117366867,
+ "endDate": "2022-08-29",
+ "endorsableFlag": true,
+ "id": "${offenceId}",
+ "laidDate": "2023-06-01",
+ "listingNumber": 1750859322,
+ "modeOfTrial": "Either Way",
+ "offenceCode": "I7DAVA9QhH",
+ "offenceDefinitionId": "0dec3e1f-c08e-4f4b-85a4-82e9ba4cd15b",
+ "offenceTitle": "DTU0NrmP5A",
+ "orderIndex": 2030006957,
+ "proceedingsConcluded": true,
+ "startDate": "2025-02-11",
+ "wording": "2hcayBZcZu"
+ }
+ ],
+ "personDefendant": {
+ "personDetails": {
+ "firstName": "AtRIwDWgMY",
+ "gender": "FEMALE",
+ "lastName": "K3JES1hhAq",
+ "middleName": "WlA5TjLcQL",
+ "title": "Lieutanant"
+ }
+ },
+ "proceedingsConcluded": false,
+ "prosecutionCaseId": "${caseId}"
+ }
+ ],
+ "id": "${caseId}",
+ "initiationCode": "O",
+ "isGroupMaster": false,
+ "originatingOrganisation": "BSh5JUEn6D",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "M0ibyD9cLq",
+ "prosecutionAuthorityId": "406a61c5-4d71-4a81-82e4-16e7234424dd",
+ "caseURN": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "statementOfFacts": "JjfUxJWmrn",
+ "statementOfFactsWelsh": "Uki6Q8Cewu"
+ }
+ ],
+ "reportingRestrictionReason": "bv7N1W8K4V",
+ "type": {
+ "description": "9XxhRjrq8K",
+ "id": "9cc41e45-b594-4ba6-906e-1a4626b08fed",
+ "welshDescription": "aj24P8ZbB1"
+ }
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/log-hearing-event-request.json b/hearing-performance-test/src/test/data/log-hearing-event-request.json
new file mode 100644
index 000000000..35e7f90b6
--- /dev/null
+++ b/hearing-performance-test/src/test/data/log-hearing-event-request.json
@@ -0,0 +1,11 @@
+{
+ "hearingEventId": "${hearingEventId}",
+ "hearingId": "${hearingId}",
+ "hearingEventDefinitionId": "e9060336-4821-4f46-969c-e08b33b48071",
+ "recordedLabel": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "eventTime": "2026-01-23T15:35:51.804Z",
+ "lastModifiedTime": "2025-12-05T15:40:53.897Z",
+ "alterable": false,
+ "defenceCounselId": "${defenceCounselId}"
+}
+
diff --git a/hearing-performance-test/src/test/data/publish-court-list-request.json b/hearing-performance-test/src/test/data/publish-court-list-request.json
new file mode 100644
index 000000000..3ae142316
--- /dev/null
+++ b/hearing-performance-test/src/test/data/publish-court-list-request.json
@@ -0,0 +1,5 @@
+{
+ "courtCentreId": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "createdTime": "2019-10-26T16:34:45.132Z"
+}
+
diff --git a/hearing-performance-test/src/test/data/result-should-publish-ddch-add-prosecution-counsel-request.json b/hearing-performance-test/src/test/data/result-should-publish-ddch-add-prosecution-counsel-request.json
new file mode 100644
index 000000000..cd34e1900
--- /dev/null
+++ b/hearing-performance-test/src/test/data/result-should-publish-ddch-add-prosecution-counsel-request.json
@@ -0,0 +1,14 @@
+{
+ "prosecutionCounsel": {
+ "attendanceDays": ["2026-01-27"],
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "id": "${prosecutionCounselId}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "middleName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionCases": ["${caseId}"],
+ "status": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "title": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/result-should-publish-ddch-initiate-hearing-request.json b/hearing-performance-test/src/test/data/result-should-publish-ddch-initiate-hearing-request.json
new file mode 100644
index 000000000..3031c29a0
--- /dev/null
+++ b/hearing-performance-test/src/test/data/result-should-publish-ddch-initiate-hearing-request.json
@@ -0,0 +1,443 @@
+{
+ "hearing": {
+ "courtApplications": [
+ {
+ "applicant": {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Lauren",
+ "gender": "FEMALE",
+ "lastName": "Michelle",
+ "middleName": "Mia"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ "applicationReceivedDate": "2026-01-27",
+ "applicationReference": "12AA3456716",
+ "applicationStatus": "DRAFT",
+ "courtApplicationCases": [
+ {
+ "caseStatus": "INACTIVE",
+ "isSJP": false,
+ "offences": [
+ {
+ "id": "${courtApplicationOffenceId}",
+ "offenceCode": "offenceCode",
+ "offenceDefinitionId": "d7c391dc-cde4-451e-a819-517d84c68709",
+ "offenceTitle": "offenceTitle",
+ "startDate": "2026-01-27",
+ "wording": "wording"
+ }
+ ],
+ "prosecutionCaseId": "${courtApplicationCaseId}",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "prodAuthCode",
+ "prosecutionAuthorityId": "${__UUID}",
+ "prosecutionAuthorityReference": "prosecutionAuthorityReference"
+ }
+ }
+ ],
+ "courtOrder": {
+ "canBeSubjectOfBreachProceedings": false,
+ "canBeSubjectOfVariationProceedings": false,
+ "courtOrderOffences": [
+ {
+ "offence": {
+ "id": "${courtOrderOffenceId}",
+ "offenceCode": "offenceCode",
+ "offenceDefinitionId": "bf3109a3-8806-4b48-8077-646a0a1188a2",
+ "offenceTitle": "offenceTitle",
+ "startDate": "2026-01-27",
+ "wording": "wording"
+ },
+ "prosecutionCaseId": "${courtOrderCaseId}",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "prodAuthCode",
+ "prosecutionAuthorityId": "${__UUID}",
+ "prosecutionAuthorityReference": "prosecutionAuthorityReference"
+ }
+ }
+ ],
+ "id": "${courtOrderId}",
+ "isSJPOrder": false,
+ "judicialResultTypeId": "8f439113-db18-460d-a8f1-3ae611ee55d7",
+ "label": "label",
+ "orderDate": "2026-01-27",
+ "orderingCourt": {
+ "id": "${__UUID}",
+ "name": "courtName"
+ },
+ "orderingHearingId": "${__UUID}",
+ "startDate": "2026-01-28"
+ },
+ "hearingIdToBeVacated": "${__UUID}",
+ "id": "${applicationId}",
+ "respondents": [
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Nina",
+ "gender": "FEMALE",
+ "lastName": "Turner"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Gerald",
+ "gender": "MALE",
+ "lastName": "Harrison"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ }
+ ],
+ "subject": {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Lauren",
+ "gender": "FEMALE",
+ "lastName": "Michelle",
+ "middleName": "Mia"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ "thirdParties": [
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Nina",
+ "gender": "FEMALE",
+ "lastName": "Turner"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ },
+ {
+ "id": "${__UUID}",
+ "notificationRequired": false,
+ "organisation": {
+ "name": "OrganisationName"
+ },
+ "personDetails": {
+ "firstName": "Gerald",
+ "gender": "MALE",
+ "lastName": "Harrison"
+ },
+ "prosecutingAuthority": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}"
+ },
+ "summonsRequired": false
+ }
+ ],
+ "type": {
+ "appealFlag": false,
+ "applicantAppellantFlag": false,
+ "breachType": "NOT_APPLICABLE",
+ "categoryCode": "appCategory",
+ "code": "appCode",
+ "commrOfOathFlag": false,
+ "courtExtractAvlFlag": false,
+ "courtOfAppealFlag": false,
+ "id": "1c8700ab-369b-432f-b0a4-07af44544dac",
+ "jurisdiction": "EITHER",
+ "legislation": "appLegislation",
+ "linkType": "LINKED",
+ "offenceActiveOrder": "NOT_APPLICABLE",
+ "pleaApplicableFlag": false,
+ "prosecutorThirdPartyFlag": false,
+ "spiOutApplicableFlag": false,
+ "summonsTemplateType": "BREACH",
+ "type": "applicationType"
+ }
+ }
+ ],
+ "courtCentre": {
+ "id": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "name": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "roomId": "5d5d7b5e-7833-4dc1-b94a-d1a5c635c623",
+ "roomName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshRoomName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "defendantReferralReasons": [
+ {
+ "defendantId": "${defendantId}",
+ "description": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "id": "${defendantReferralReasonId}",
+ "welshDescription": "welshDescription"
+ }
+ ],
+ "hearingDays": [
+ {
+ "courtCentreId": "b52f805c-2821-4904-a0e0-26f7fda6dd08",
+ "courtRoomId": "5d5d7b5e-7833-4dc1-b94a-d1a5c635c623",
+ "hasSharedResults": true,
+ "listedDurationMinutes": 101548736,
+ "listingSequence": 1515736350,
+ "sittingDay": "2026-01-17T13:34:21.87Z"
+ }
+ ],
+ "hearingLanguage": "ENGLISH",
+ "id": "${hearingId}",
+ "isGroupProceedings": false,
+ "judiciary": [
+ {
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "isBenchChairman": false,
+ "isDeputy": false,
+ "judicialId": "${__UUID}",
+ "judicialRoleType": {
+ "judicialRoleTypeId": "0878534e-6e1d-45fa-acc2-32d372ba6e28",
+ "judiciaryType": "CIRCUIT_JUDGE"
+ },
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "middleName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "title": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ }
+ ],
+ "jurisdictionType": "CROWN",
+ "numberOfGroupCases": 0,
+ "prosecutionCases": [
+ {
+ "caseMarkers": [
+ {
+ "id": "${__UUID}",
+ "markerTypeCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "markerTypeDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "markerTypeid": "${__UUID}"
+ }
+ ],
+ "caseStatus": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "classOfCase": "Class 1",
+ "defendants": [
+ {
+ "courtProceedingsInitiated": "2026-01-27T13:34:21.896Z",
+ "id": "${defendantId}",
+ "isYouth": true,
+ "masterDefendantId": "${defendantId}",
+ "numberOfPreviousConvictionsCited": 1174791737,
+ "offences": [
+ {
+ "allocationDecision": {
+ "allocationDecisionDate": "2026-01-27",
+ "courtIndicatedSentence": {
+ "courtIndicatedSentenceDescription": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "courtIndicatedSentenceTypeId": "134d71dc-e038-4a94-83da-7ae49ad75aa0"
+ },
+ "motReasonCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "motReasonDescription": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "motReasonId": "${__UUID}",
+ "offenceId": "${offenceId}",
+ "originatingHearingId": "${__UUID}",
+ "sequenceNumber": 588434254
+ },
+ "arrestDate": "2021-11-21",
+ "chargeDate": "2023-05-06",
+ "count": 1686988613,
+ "custodyTimeLimit": {
+ "daysSpent": 308756525,
+ "isCtlExtended": false,
+ "timeLimit": "2022-04-19"
+ },
+ "endDate": "2023-09-05",
+ "endorsableFlag": true,
+ "id": "${offenceId}",
+ "indicatedPlea": {
+ "indicatedPleaDate": "2024-05-31",
+ "indicatedPleaValue": "INDICATED_GUILTY",
+ "offenceId": "${offenceId}",
+ "source": "ONLINE"
+ },
+ "introducedAfterInitialProceedings": true,
+ "isDiscontinued": true,
+ "laidDate": "2022-10-30",
+ "listingNumber": 11662609,
+ "modeOfTrial": "Either Way",
+ "notifiedPlea": {
+ "notifiedPleaDate": "2021-08-02",
+ "notifiedPleaValue": "NOTIFIED_GUILTY",
+ "offenceId": "${offenceId}"
+ },
+ "offenceCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "offenceDefinitionId": "5241ffbf-8e79-4b53-851e-032b7d67101f",
+ "offenceFacts": {
+ "alcoholReadingAmount": 1977092480,
+ "alcoholReadingMethodCode": "B",
+ "vehicleMake": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "vehicleRegistration": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "offenceLegislation": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "offenceLegislationWelsh": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "offenceTitle": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "offenceTitleWelsh": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "orderIndex": 201562866,
+ "proceedingsConcluded": true,
+ "reportingRestrictions": [
+ {
+ "id": "${__UUID}",
+ "judicialResultId": "${__UUID}",
+ "label": "Yes",
+ "orderedDate": "2026-01-27"
+ }
+ ],
+ "startDate": "2022-05-07",
+ "wording": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "wordingWelsh": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ }
+ ],
+ "personDefendant": {
+ "arrestSummonsNumber": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "bailStatus": {
+ "code": "C",
+ "description": "Remanded into Custody",
+ "id": "9202e363-7dea-40eb-8360-34ac85a84557"
+ },
+ "custodialEstablishment": {
+ "custody": "POLICE",
+ "id": "6c8ef17c-29f4-45d3-9c3c-56cffa057560",
+ "name": "East Croydon Police Station"
+ },
+ "custodyTimeLimit": "2021-11-30",
+ "driverNumber": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "employerOrganisation": {
+ "address": {
+ "address1": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "address2": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "address3": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "address4": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "address5": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "postcode": "J6 2RQ",
+ "welshAddress1": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress2": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress3": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress4": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress5": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "contact": {
+ "fax": "${__RandomString(10,0123456789,)}",
+ "home": "${__RandomString(10,0123456789,)}",
+ "mobile": "${__RandomString(10,0123456789,)}",
+ "primaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(5,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "secondaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(5,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "work": "${__RandomString(10,0123456789,)}"
+ },
+ "incorporationNumber": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "name": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "registeredCharityNumber": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "employerPayrollReference": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "perceivedBirthYear": 1412452674,
+ "personDetails": {
+ "additionalNationalityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "additionalNationalityId": "${__UUID}",
+ "address": {
+ "address1": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "address2": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "address3": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "address4": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "address5": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "postcode": "E1A 2LA",
+ "welshAddress1": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress2": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress3": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress4": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "welshAddress5": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "contact": {
+ "fax": "${__RandomString(10,0123456789,)}",
+ "home": "${__RandomString(10,0123456789,)}",
+ "mobile": "${__RandomString(10,0123456789,)}",
+ "primaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(5,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "secondaryEmail": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}@${__RandomString(5,abcdefghijklmnoprqstvwxyz,)}.${__RandomString(3,abcdefghijklmnoprqstvwxyz,)}",
+ "work": "${__RandomString(10,0123456789,)}"
+ },
+ "dateOfBirth": "2023-01-31",
+ "disabilityStatus": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "documentationLanguageNeeds": "ENGLISH",
+ "ethnicity": {
+ "observedEthnicityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "gender": "FEMALE",
+ "interpreterLanguageNeeds": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "middleName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "nationalInsuranceNumber": "HH281715B",
+ "nationalityCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "nationalityDescription": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "nationalityId": "${__UUID}",
+ "occupation": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "occupationCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "specificRequirements": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "title": "Lieutanant"
+ }
+ },
+ "proceedingsConcluded": false,
+ "prosecutionAuthorityReference": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionCaseId": "${caseId}"
+ }
+ ],
+ "id": "${caseId}",
+ "initiationCode": "S",
+ "isGroupMaster": false,
+ "originatingOrganisation": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionCaseIdentifier": {
+ "prosecutionAuthorityCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "prosecutionAuthorityId": "${__UUID}",
+ "caseURN": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ },
+ "statementOfFacts": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "statementOfFactsWelsh": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ }
+ ],
+ "reportingRestrictionReason": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "type": {
+ "description": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "id": "9cc41e45-b594-4ba6-906e-1a4626b08fed",
+ "welshDescription": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}"
+ }
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/result-should-publish-ddch-set-trial-type-request.json b/hearing-performance-test/src/test/data/result-should-publish-ddch-set-trial-type-request.json
new file mode 100644
index 000000000..217465c21
--- /dev/null
+++ b/hearing-performance-test/src/test/data/result-should-publish-ddch-set-trial-type-request.json
@@ -0,0 +1,4 @@
+{
+ "trialTypeId": "9b738c6e-04fc-4e18-bc49-b599973af7e7"
+}
+
diff --git a/hearing-performance-test/src/test/data/result-should-publish-ddch-share-results-amend-request.json b/hearing-performance-test/src/test/data/result-should-publish-ddch-share-results-amend-request.json
new file mode 100644
index 000000000..60279268c
--- /dev/null
+++ b/hearing-performance-test/src/test/data/result-should-publish-ddch-share-results-amend-request.json
@@ -0,0 +1,173 @@
+{
+ "courtClerk": {
+ "firstName": "Siouxsie",
+ "lastName": "Sioux",
+ "userId": "${__UUID}"
+ },
+ "resultLines": [
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2022-07-21",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId1}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "1f3c83cc-53eb-4861-8cb8-2289b4a08307",
+ "prompts": [
+ {
+ "id": "1f3c83cc-53eb-4861-8cb8-2289b4a08307",
+ "label": "promptLabel",
+ "fixedListCode": "fixedListCode",
+ "value": "value1",
+ "welshValue": "wvalue1"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ },
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-04-04",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId2}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "ebed169e-5e22-46b2-af32-8e5fb0461f05",
+ "prompts": [
+ {
+ "id": "ebed169e-5e22-46b2-af32-8e5fb0461f05",
+ "label": "promptLabel",
+ "fixedListCode": "fixedList0",
+ "value": "val0",
+ "welshValue": "wval0"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "amendmentReasonId": "${amendmentReasonId1}",
+ "amendmentReason": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "amendmentDate": "2026-01-27",
+ "fourEyesApproval": {
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ },
+ "approvedDate": "2021-06-05",
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ },
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-04-04",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId3}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "969f150c-cd05-46b0-9dd9-30891efcc766",
+ "prompts": [
+ {
+ "id": "969f150c-cd05-46b0-9dd9-30891efcc766",
+ "label": "promptLabel",
+ "fixedListCode": "fixedList0",
+ "value": "val0",
+ "welshValue": "wval0"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "amendmentReasonId": "${amendmentReasonId2}",
+ "amendmentReason": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "amendmentDate": "2026-01-27",
+ "fourEyesApproval": {
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ },
+ "approvedDate": "2021-08-24",
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ },
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-09-17",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId4}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "b8cd526c-4ca1-43ae-93bd-fc5a8f03c0d5",
+ "prompts": [
+ {
+ "id": "b8cd526c-4ca1-43ae-93bd-fc5a8f03c0d5",
+ "label": "promptLabel",
+ "fixedListCode": "fixedList0",
+ "value": "val0",
+ "welshValue": "wval0"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ },
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-09-17",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId5}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "de946ddc-ad77-44b1-8480-8bbc251cdcfb",
+ "prompts": [
+ {
+ "id": "de946ddc-ad77-44b1-8480-8bbc251cdcfb",
+ "label": "promptLabel",
+ "fixedListCode": "fixedList1",
+ "value": "val1",
+ "welshValue": "wval1"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ }
+ ]
+}
+
diff --git a/hearing-performance-test/src/test/data/result-should-publish-ddch-share-results-initial-request.json b/hearing-performance-test/src/test/data/result-should-publish-ddch-share-results-initial-request.json
new file mode 100644
index 000000000..a930bc879
--- /dev/null
+++ b/hearing-performance-test/src/test/data/result-should-publish-ddch-share-results-initial-request.json
@@ -0,0 +1,39 @@
+{
+ "courtClerk": {
+ "firstName": "Andrew",
+ "lastName": "Eldritch",
+ "userId": "${__UUID}"
+ },
+ "resultLines": [
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2022-07-21",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId1}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "1f3c83cc-53eb-4861-8cb8-2289b4a08307",
+ "prompts": [
+ {
+ "id": "1f3c83cc-53eb-4861-8cb8-2289b4a08307",
+ "label": "promptLabel",
+ "fixedListCode": "fixedListCode",
+ "value": "value1",
+ "welshValue": "wvalue1"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ }
+ ]
+}
+
diff --git a/hearing-performance-test/src/test/data/result-should-publish-ddch-share-results-reshare-request.json b/hearing-performance-test/src/test/data/result-should-publish-ddch-share-results-reshare-request.json
new file mode 100644
index 000000000..6b6da7df8
--- /dev/null
+++ b/hearing-performance-test/src/test/data/result-should-publish-ddch-share-results-reshare-request.json
@@ -0,0 +1,249 @@
+{
+ "courtClerk": {
+ "firstName": "Siouxsie",
+ "lastName": "Sioux",
+ "userId": "${__UUID}"
+ },
+ "resultLines": [
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2022-07-21",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId1}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "969f150c-cd05-46b0-9dd9-30891efcc766",
+ "prompts": [
+ {
+ "id": "969f150c-cd05-46b0-9dd9-30891efcc766",
+ "label": "promptLabel",
+ "fixedListCode": "fixedListCode",
+ "value": "value1",
+ "welshValue": "wvalue1"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ },
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-04-04",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId2}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "ebed169e-5e22-46b2-af32-8e5fb0461f05",
+ "prompts": [
+ {
+ "id": "ebed169e-5e22-46b2-af32-8e5fb0461f05",
+ "label": "promptLabel",
+ "fixedListCode": "fixedList0",
+ "value": "val0",
+ "welshValue": "wval0"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "amendmentReasonId": "${amendmentReasonId1}",
+ "amendmentReason": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "amendmentDate": "2026-01-27",
+ "fourEyesApproval": {
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ },
+ "approvedDate": "2021-06-05",
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ },
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-04-04",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId3}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "969f150c-cd05-46b0-9dd9-30891efcc766",
+ "prompts": [
+ {
+ "id": "969f150c-cd05-46b0-9dd9-30891efcc766",
+ "label": "promptLabel",
+ "fixedListCode": "fixedList0",
+ "value": "val0",
+ "welshValue": "wval0"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "amendmentReasonId": "${amendmentReasonId2}",
+ "amendmentReason": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "amendmentDate": "2026-01-27",
+ "fourEyesApproval": {
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ },
+ "approvedDate": "2021-08-24",
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ },
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-09-17",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId4}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "b8cd526c-4ca1-43ae-93bd-fc5a8f03c0d5",
+ "prompts": [
+ {
+ "id": "b8cd526c-4ca1-43ae-93bd-fc5a8f03c0d5",
+ "label": "promptLabel",
+ "fixedListCode": "fixedList0",
+ "value": "val0",
+ "welshValue": "wval0"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ },
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-09-17",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId5}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "de946ddc-ad77-44b1-8480-8bbc251cdcfb",
+ "prompts": [
+ {
+ "id": "de946ddc-ad77-44b1-8480-8bbc251cdcfb",
+ "label": "promptLabel",
+ "fixedListCode": "fixedList1",
+ "value": "val1",
+ "welshValue": "wval1"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ },
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-04-04",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId6}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "ebed169e-5e22-46b2-af32-8e5fb0461f05",
+ "prompts": [
+ {
+ "id": "ebed169e-5e22-46b2-af32-8e5fb0461f05",
+ "label": "promptLabel",
+ "fixedListCode": "fixedList0",
+ "value": "val0",
+ "welshValue": "wval0"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "amendmentReasonId": "${amendmentReasonId3}",
+ "amendmentReason": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "amendmentDate": "2026-01-27",
+ "fourEyesApproval": {
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ },
+ "approvedDate": "2022-10-06",
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ },
+ {
+ "delegatedPowers": {
+ "firstName": "David",
+ "lastName": "Bowie",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-04-04",
+ "sharedDate": "2026-01-27",
+ "resultLineId": "${resultLineId7}",
+ "offenceId": "${offenceId}",
+ "defendantId": "${defendantId}",
+ "resultDefinitionId": "969f150c-cd05-46b0-9dd9-30891efcc766",
+ "prompts": [
+ {
+ "id": "969f150c-cd05-46b0-9dd9-30891efcc766",
+ "label": "promptLabel",
+ "fixedListCode": "fixedList0",
+ "value": "val0",
+ "welshValue": "wval0"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "amendmentReasonId": "${amendmentReasonId4}",
+ "amendmentReason": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "amendmentDate": "2026-01-27",
+ "fourEyesApproval": {
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ },
+ "approvedDate": "2022-12-30",
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}"
+ }
+ ]
+}
+
diff --git a/hearing-performance-test/src/test/data/result-should-publish-ddch-update-defendant-attendance-request.json b/hearing-performance-test/src/test/data/result-should-publish-ddch-update-defendant-attendance-request.json
new file mode 100644
index 000000000..cd760d9fc
--- /dev/null
+++ b/hearing-performance-test/src/test/data/result-should-publish-ddch-update-defendant-attendance-request.json
@@ -0,0 +1,9 @@
+{
+ "hearingId": "${hearingId}",
+ "defendantId": "${defendantId}",
+ "attendanceDay": {
+ "attendanceType": "IN_PERSON",
+ "day": "2026-01-17"
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/result-should-publish-ddch-update-plea-request.json b/hearing-performance-test/src/test/data/result-should-publish-ddch-update-plea-request.json
new file mode 100644
index 000000000..f93dbfa44
--- /dev/null
+++ b/hearing-performance-test/src/test/data/result-should-publish-ddch-update-plea-request.json
@@ -0,0 +1,40 @@
+{
+ "pleas": [
+ {
+ "allocationDecision": {
+ "allocationDecisionDate": "2026-01-27",
+ "courtIndicatedSentence": {
+ "courtIndicatedSentenceDescription": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "courtIndicatedSentenceTypeId": "2b5e532e-60a2-4ac3-a545-7a66e81c4df6"
+ },
+ "motReasonCode": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "motReasonDescription": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "motReasonId": "${__UUID}",
+ "offenceId": "${offenceId}",
+ "originatingHearingId": "${__UUID}",
+ "sequenceNumber": 2082862263
+ },
+ "defendantId": "${defendantId}",
+ "indicatedPlea": {
+ "indicatedPleaDate": "2022-06-05",
+ "indicatedPleaValue": "INDICATED_GUILTY",
+ "offenceId": "${offenceId}",
+ "source": "ONLINE"
+ },
+ "offenceId": "${offenceId}",
+ "plea": {
+ "delegatedPowers": {
+ "firstName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "lastName": "${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,)}",
+ "userId": "${__UUID}"
+ },
+ "offenceId": "${offenceId}",
+ "originatingHearingId": "${__UUID}",
+ "pleaDate": "2025-01-05",
+ "pleaValue": "GUILTY"
+ },
+ "prosecutionCaseId": "${caseId}"
+ }
+ ]
+}
+
diff --git a/hearing-performance-test/src/test/data/shared-results-request.json b/hearing-performance-test/src/test/data/shared-results-request.json
new file mode 100644
index 000000000..d0504ed99
--- /dev/null
+++ b/hearing-performance-test/src/test/data/shared-results-request.json
@@ -0,0 +1,50 @@
+{
+ "courtClerk": {
+ "firstName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "lastName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "userId": "${__UUID}"
+ },
+ "resultLines": [
+ {
+ "shortCode": "SHORT_CODE",
+ "delegatedPowers": {
+ "firstName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "lastName": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "userId": "${__UUID}"
+ },
+ "orderedDate": "2025-09-07",
+ "sharedDate": "${hearingDay}",
+ "resultLineId": "${resultLineId}",
+ "offenceId": "${offenceId}",
+ "resultDefinitionId": "1f3c83cc-53eb-4861-8cb8-2289b4a08307",
+ "prompts": [
+ {
+ "id": "1f3c83cc-53eb-4861-8cb8-2289b4a08307",
+ "label": "promptLabel",
+ "fixedListCode": "fixedListCode",
+ "value": "value1",
+ "welshValue": "wvalue1",
+ "promptRef": "bailConditionReason"
+ }
+ ],
+ "resultLabel": "imprisonment",
+ "level": "OFFENCE",
+ "isModified": true,
+ "isComplete": true,
+ "applicationId": "${applicationId}",
+ "caseId": "${caseId}",
+ "amendmentDate": "2026-01-23T11:54:42.585634329Z",
+ "isDeleted": false,
+ "shadowListed": false,
+ "draftResult": "{}",
+ "amendmentsLog": "AMENDMENTS_LOG",
+ "category": "I",
+ "nonStandaloneAncillaryResult": false,
+ "autoPopulateBooleanResult": "${__UUID}",
+ "disabled": false
+ }
+ ],
+ "hearingDay": "${hearingDay}",
+ "version": 1
+}
+
diff --git a/hearing-performance-test/src/test/data/update-defendant-attendance-request.json b/hearing-performance-test/src/test/data/update-defendant-attendance-request.json
new file mode 100644
index 000000000..04f14da40
--- /dev/null
+++ b/hearing-performance-test/src/test/data/update-defendant-attendance-request.json
@@ -0,0 +1,9 @@
+{
+ "hearingId": "${hearingId}",
+ "defendantId": "${defendantId}",
+ "attendanceDay": {
+ "attendanceType": "IN_PERSON",
+ "day": "2026-01-10"
+ }
+}
+
diff --git a/hearing-performance-test/src/test/data/update-verdict-request.json b/hearing-performance-test/src/test/data/update-verdict-request.json
new file mode 100644
index 000000000..619f3f8de
--- /dev/null
+++ b/hearing-performance-test/src/test/data/update-verdict-request.json
@@ -0,0 +1,31 @@
+{
+ "verdicts": [
+ {
+ "jurors": {
+ "numberOfJurors": 11,
+ "numberOfSplitJurors": 0,
+ "unanimous": true
+ },
+ "lesserOrAlternativeOffence": {
+ "offenceCode": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceDefinitionId": "cae4f04d-3f59-403c-93ee-47944507f391",
+ "offenceLegislation": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceLegislationWelsh": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceTitle": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "offenceTitleWelsh": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}"
+ },
+ "offenceId": "${offenceId}",
+ "originatingHearingId": "${hearingId}",
+ "verdictDate": "2024-10-30",
+ "verdictType": {
+ "category": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "categoryType": "GUILTY",
+ "description": "${__RandomString(10,abcdefghijklmnoprqstvwxyz,)}",
+ "id": "c4ca4238-a0b9-3382-8dcc-509a6f75849b",
+ "sequence": 96481693,
+ "verdictCode": "VC01"
+ }
+ }
+ ]
+}
+
diff --git a/hearing-performance-test/src/test/jmeter/perf-tests.jmx b/hearing-performance-test/src/test/jmeter/perf-tests.jmx
new file mode 100644
index 000000000..722945f64
--- /dev/null
+++ b/hearing-performance-test/src/test/jmeter/perf-tests.jmx
@@ -0,0 +1,3311 @@
+
+
+
+
+
+
+
+ numberOfThreads
+ ${__P(jmeter.hearing.numberOfThreads, 1)}
+ =
+
+
+ loopCount
+ ${__P(jmeter.hearing.loopCount, 1)}
+ =
+
+
+ rampUpPeriod
+ ${__P(jmeter.hearing.rampUpPeriod, 1)}
+ =
+
+
+ protocol
+ ${__P(jmeter.hearing.protocol, http)}
+ =
+
+
+ hostName
+ ${__P(jmeter.hearing.hostName, localhost)}
+ =
+
+
+ port
+ ${__P(jmeter.hearing.port, 8080)}
+ =
+
+
+ userId
+ ${__P(jmeter.hearing.userId, 7a04cabb-102a-4737-9ae1-a703dcf62cff)}
+ =
+
+
+ dbHost
+ ${__P(jmeter.hearing.dbHost, localhost)}
+ =
+
+
+ dbPort
+ ${__P(jmeter.hearing.dbPort, 5432)}
+ =
+
+
+ dbUserName
+ ${__P(jmeter.hearing.dbUserName, postgres)}
+ =
+
+
+ dbPassword
+ ${__P(jmeter.hearing.dbPassword, postgres)}
+ =
+
+
+ metricsIntervalInMs
+ ${__P(jmeter.hearing.metricsIntervalInMs, 10000)}
+ =
+
+
+ resultDir
+ ${__P(jmeter.hearing.resultDir)}
+ =
+
+
+ pollerTimeout
+ ${__P(jmeter.hearing.pollerTimeout, 10000)}
+ =
+
+
+ pollInterval
+ ${__P(jmeter.hearing.pollInterval, 100)}
+ =
+
+
+ waitAfterEachCommand
+ 200
+ =
+
+
+
+
+
+
+ true
+
+ 5000
+
+ hearingviewstore
+ jdbc:postgresql://${dbHost}:${dbPort}/hearingviewstore
+ org.postgresql.Driver
+
+ true
+ ${dbPassword}
+ 0
+ false
+ 10000
+ DEFAULT
+ 60000
+ ${dbUserName}
+
+
+
+ true
+
+ 5000
+
+ hearingeventstore
+ jdbc:postgresql://${dbHost}:${dbPort}/hearingeventstore
+ org.postgresql.Driver
+
+ true
+ ${dbPassword}
+ 0
+ false
+ 10000
+ DEFAULT
+ 60000
+ ${dbUserName}
+
+
+
+ 1
+ 1
+ true
+ continue
+
+ 1
+ false
+
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+
+try {
+ String wiremockHost = System.getProperty("WIREMOCK_HOST", "localhost")
+ int wiremockPort = Integer.parseInt(System.getProperty("WIREMOCK_PORT", "8080"))
+
+ WireMock.configureFor(wiremockHost, wiremockPort)
+ WireMock.reset()
+ log.info("WireMock reset completed and request journal disabled")
+} catch (Exception e) {
+ log.warn("Failed to reset WireMock: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+String courtCentreId = "b52f805c-2821-4904-a0e0-26f7fda6dd08"
+ String organisationUnitUrl = "/referencedata-service/query/api/rest/referencedata/organisation-units/" + courtCentreId
+ String mediaType = "application/vnd.referencedata.query.organisation-unit.v2+json"
+
+ // Organisation unit response matching the stub data structure with EnforcementArea
+
+ String organisationUnitJson = "{\"address1\":\"address 1\",\"enforcementArea\":{\"bankAccntName\":\"account name\",\"bankAccntNum\":1,\"bankAccntSortCode\":\"867878\",\"bankAddressLine1\":\"address1\",\"remittanceAdviceEmailAddress\":\"test@test.com\",\"additionalProperties\":{}},\"id\":\"b52f805c-2821-4904-a0e0-26f7fda6dd08\",\"isWelsh\":true,\"lja\":\"2745\",\"oucode\":\"2745\",\"oucodeL3Name\":\"hfn56ie1jR\",\"oucodeL3WelshName\":\"hfn56ie1jR\",\"postcode\":\"AL4 9LG\",\"welshAddress1\":\"Welsh address1\",\"welshAddress2\":\"Welsh address2\",\"welshAddress3\":\"Welsh address3\",\"welshAddress4\":\"Welsh address5\"}"
+
+
+ stubFor(get(urlPathEqualTo(organisationUnitUrl))
+ .withHeader("Accept", equalTo(mediaType))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", mediaType)
+ .withBody(organisationUnitJson)))
+
+ log.info("WireMock stub for organisation unit configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for organisation unit: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub organisationunits
+ String organisationUnitsUrl = "/referencedata-service/query/api/rest/referencedata/organisationunits"
+ String organisationUnitsMediaType = "application/vnd.referencedata.query.organisationunits+json"
+
+ // Organisation units response matching the structure provided
+ String organisationUnitsJson = "{\"organisationunits\":[{\"id\":\"b52f805c-2821-4904-a0e0-26f7fda6dd08\",\"oucode\":\"B01BH00\",\"oucodeL3Code\":\"BH\",\"oucodeL3Name\":\"Bexley Magistrates' Court\",\"oucodeL1Code\":\"B\",\"oucodeL1Name\":\"Magistrates' Courts\",\"oucodeL2Code\":\"1\",\"oucodeL2Name\":\"London\",\"region\":\"London\",\"lja\":\"2575\",\"oucodeEffectiveFromDate\":\"1899-12-31\",\"address1\":\"Norwich Place\",\"address2\":\"Bexleyheath\",\"address3\":\"Kent\",\"postcode\":\"DA6 7ND\",\"oucodeL3WelshName\":\"Llys Ynadon Bexley\",\"defaultStartTime\":\"10:00:00\",\"defaultDurationHrs\":\"07:00:00\",\"lastModified\":\"2020-03-19T15:51:45.242Z\",\"cpsEmailAddress\":\"London.magistrates@cps.gov.uk\"},{\"id\":\"a25848d6-d96e-4a52-8c54-de55b6542afc\",\"oucode\":\"B01CE00\",\"oucodeL3Code\":\"CE\",\"oucodeL3Name\":\"Willesden Magistrates' Court\",\"oucodeL1Code\":\"B\",\"oucodeL1Name\":\"Magistrates' Courts\",\"oucodeL2Code\":\"1\",\"oucodeL2Name\":\"London\",\"region\":\"London\",\"lja\":\"2571\",\"oucodeEffectiveFromDate\":\"1899-12-31\",\"address1\":\"448 High Road\",\"address2\":\"London\",\"postcode\":\"NW10 2DZ\",\"oucodeL3WelshName\":\"Llys Ynadon Willesden\",\"defaultStartTime\":\"10:00:00\",\"defaultDurationHrs\":\"07:00:00\",\"lastModified\":\"2020-03-19T15:51:55.025Z\",\"cpsEmailAddress\":\"London.magistrates@cps.gov.uk\",\"pecsContractorEmail\":\"PECSBrentMags@serco.com\"}]}"
+
+ stubFor(get(urlPathEqualTo(organisationUnitsUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", organisationUnitsMediaType)
+ .withBody(organisationUnitsJson)))
+
+ log.info("WireMock stub for organisationunits configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for organisationunits: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+String enforcementAreaUrl = "/referencedata-service/query/api/rest/referencedata/enforcement-area"
+ String mediaType = "application/vnd.referencedata.query.enforcement-area+json"
+
+ // Enforcement area response matching the structure from integration tests
+ String enforcementAreaJson = "{\"accountDivisionCode\":5673,\"address1\":\"address1 2745\",\"address2\":\"address2 2745\",\"address3\":\"address3 2745\",\"address4\":\"address4 2745\",\"email\":\"enforcement2745@gov.com\",\"localJusticeArea\":{\"name\":\"ljaName2745\",\"nationalCourtCode\":\"123\",\"additionalProperties\":{}},\"nationalPaymentPhone\":\"12344566\",\"phone\":\"123456789\",\"postcode\":\"AL4 9LG\",\"additionalProperties\":{}}"
+
+ // Stub for any localJusticeAreaNationalCourtCode query parameter
+ stubFor(get(urlPathEqualTo(enforcementAreaUrl))
+ .withQueryParam("localJusticeAreaNationalCourtCode", matching(".*"))
+ .withHeader("Accept", equalTo(mediaType))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", mediaType)
+ .withBody(enforcementAreaJson)))
+
+ log.info("WireMock stub for enforcement area configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for enforcement area: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// stubUsersAndGroupsGetLoggedInPermissionsWithoutCases
+ String permissionsUrl = "/usersgroups-service/query/api/rest/usersgroups/users/logged-in-user/permissions"
+ String permissionsJson = "{\"groups\":[{\"groupId\":\"7e2f843e-d639-40b3-8611-8015f3a13333\",\"groupName\":\"groupName1\",\"prosecutingAuthority\":\"TFL\"},{\"groupId\":\"7e2f843e-d639-40b3-8611-8015f3a13334\",\"groupName\":\"groupName2\",\"prosecutingAuthority\":\"TVL\"}],\"permissions\":[{\"action\":\"groupName1\",\"object\":\"TFL\",\"source\":\"7e2f843e-d639-40b3-8611-8015f3a13333\",\"target\":\"7e2f843e-d639-40b3-8611-8015f3a13334\"},{\"action\":\"groupName2\",\"object\":\"TVL\",\"source\":\"7e2f843e-d639-40b3-8611-8015f3a13333\",\"target\":\"7e2f843e-d639-40b3-8611-8015f3a13334\"}],\"switchableRoles\":[{\"roleId\":\"7e2f843e-d639-40b3-8611-8015f3a13333\",\"description\":\"description1\",\"label\":\"label1\",\"selectable\":true},{\"roleId\":\"7e2f843e-d639-40b3-8611-8015f3a13334\",\"description\":\"description2\",\"label\":\"label2\",\"selectable\":false}]}"
+
+ stubFor(get(urlPathEqualTo(permissionsUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", "application/json")
+ .withBody(permissionsJson)))
+
+ log.info("WireMock stub for logged-in user permissions configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for logged-in user permissions: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Get userId from JMeter variables (defaults to the one from user defined variables)
+ String userId = vars.get("userId")
+ if (userId == null || userId.isEmpty()) {
+ userId = "7a04cabb-102a-4737-9ae1-a703dcf62cff"
+ }
+
+ // stubUsersAndGroupsUserRoles
+ String rolesUrl = "/usersgroups-service/query/api/rest/usersgroups/users/" + userId + "/roles"
+ String rolesJson = "{\"groups\":[{\"groupId\":\"1e2f843e-d639-40b3-8611-8015f3a18958\"},{\"groupId\":\"1e2f843e-d639-40b3-8211-8015f3a18958\"}],\"allRoles\":[{\"roleId\":\"1e2f843e-d649-40b3-8611-8015f3a18952\",\"label\":\"role label\",\"description\":\"role description\",\"selectable\":true,\"startDate\":null,\"endDate\":null}]}"
+
+ stubFor(get(urlPathEqualTo(rolesUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", "application/json")
+ .withBody(rolesJson)))
+
+ log.info("WireMock stub for user roles configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for user roles: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Get userId from JMeter variables (defaults to the one from user defined variables)
+ String userId = vars.get("userId")
+ if (userId == null || userId.isEmpty()) {
+ userId = "7a04cabb-102a-4737-9ae1-a703dcf62cff"
+ }
+
+ // setupAsAuthorisedUser
+ String groupsUrl = "/usersgroups-service/query/api/rest/usersgroups/users/" + userId + "/groups"
+ String groupsJson = "{\"groups\":[{\"groupId\":\"7e2f143e-d619-40b3-8611-8015f3a18957\",\"groupName\":\"Court Clerks\"}, {\"groupId\":\"14986cb7-eefa-48b3-b7e2-34431c3265e5\",\"groupName\":\"System Users\"}]}"
+
+ stubFor(get(urlPathEqualTo(groupsUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", userId)
+ .withHeader("Content-Type", "application/json")
+ .withBody(groupsJson)))
+
+ log.info("WireMock stub for user groups configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for user groups: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// setupAsSystemUser
+ String groupsUrl2 = "/usersgroups-service/query/api/rest/usersgroups/users/46986cb7-eefa-48b3-b7e2-34431c3265e5/groups"
+ String groupsJson2 = "{\"groups\":[{\"groupId\":\"14986cb7-eefa-48b3-b7e2-34431c3265e5\",\"groupName\":\"System Users\"}]}"
+
+ stubFor(get(urlPathEqualTo(groupsUrl2))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", "46986cb7-eefa-48b3-b7e2-34431c3265e5")
+ .withHeader("Content-Type", "application/json")
+ .withBody(groupsJson2)))
+
+ log.info("WireMock stub for system user groups configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for system user groups: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// stubUserGroupLoggedInUserHasPermissionForObject
+ stubFor(get(urlMatching("/usersgroups-service/query/api/rest/usersgroups/users/logged-in-user/permissions.*"))
+ .atPriority(1)
+ .withHeader("Accept", containing("application/vnd.usersgroups.is-logged-in-user-has-permission-for-object+json"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", "application/json")
+ .withBody("{\"hasPermission\":true}")))
+
+ log.info("WireMock stub for permission for object configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for permission for object: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// stubUserGroupLoggedInUserHasPermissionForAction
+ stubFor(get(urlMatching("/usersgroups-service/query/api/rest/usersgroups/users/logged-in-user/permissions.*"))
+ .atPriority(1)
+ .withHeader("Accept", containing("application/vnd.usersgroups.is-logged-in-user-has-permission-for-action+json"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", "application/json")
+ .withBody("{\"permissions\":[]}")))
+
+ log.info("WireMock stub for permission for action configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for permission for action: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// stubPleaTypeGuiltyFlags
+ String pleaTypesUrl = "/referencedata-service/query/api/rest/referencedata/plea-types"
+ String pleaTypesMediaType = "application/vnd.referencedata.plea-types+json"
+ String pleaTypesJson = "{\"pleaStatusTypes\":[{\"sequence\":20,\"pleaTypeCode\":\"G\",\"pleaTypeUIFlag\":true,\"pleaTypeDescription\":\"Guilty\",\"pleaTypeGuiltyFlag\":\"Yes\",\"pleaTypeCivilFlag\":\"No\",\"pleaStatusCode\":\"1\",\"pleaValue\":\"GUILTY\",\"jurisdiction\":\"EITHER\"},{\"sequence\":40,\"pleaTypeCode\":\"GSJP\",\"pleaTypeUIFlag\":true,\"pleaTypeDescription\":\"Guilty Single Justice Procedure\",\"pleaTypeGuiltyFlag\":\"Yes\",\"pleaTypeCivilFlag\":\"No\",\"pleaStatusCode\":\"6\",\"pleaValue\":\"GUILTY_SINGLE_JUSTICE_PROCEDURE\",\"jurisdiction\":\"MAGISTRATES\"},{\"sequence\":50,\"pleaTypeCode\":\"IG\",\"pleaTypeUIFlag\":true,\"pleaTypeDescription\":\"Indicated plea of Guilty\",\"pleaTypeGuiltyFlag\":\"Yes\",\"pleaTypeCivilFlag\":\"No\",\"pleaStatusCode\":\"1\",\"pleaValue\":\"INDICATED_GUILTY\",\"jurisdiction\":\"MAGISTRATES\"},{\"sequence\":60,\"pleaTypeCode\":\"ADB\",\"pleaTypeUIFlag\":false,\"pleaTypeDescription\":\"Admits Breach\",\"pleaTypeGuiltyFlag\":\"Yes\",\"pleaTypeCivilFlag\":\"No\",\"pleaStatusCode\":\"1\",\"pleaValue\":\"ADMITS_BREACH\",\"jurisdiction\":\"MAGISTRATES\"},{\"sequence\":70,\"pleaTypeCode\":\"NG\",\"pleaTypeUIFlag\":true,\"pleaTypeDescription\":\"Not Guilty\",\"pleaTypeGuiltyFlag\":\"No\",\"pleaTypeCivilFlag\":\"No\",\"pleaStatusCode\":\"2\",\"pleaValue\":\"NOT_GUILTY\",\"jurisdiction\":\"EITHER\"},{\"sequence\":80,\"pleaTypeCode\":\"UNFIT\",\"pleaTypeUIFlag\":true,\"pleaTypeDescription\":\"Unfit to Plead\",\"pleaTypeGuiltyFlag\":\"No\",\"pleaTypeCivilFlag\":\"No\",\"pleaStatusCode\":\"3\",\"pleaValue\":\"UNFIT_TO_PLEAD\",\"jurisdiction\":\"MAGISTRATES\"},{\"sequence\":130,\"pleaTypeCode\":\"CON\",\"pleaTypeUIFlag\":false,\"pleaTypeDescription\":\"Consents\",\"pleaTypeGuiltyFlag\":\"Yes\",\"pleaTypeCivilFlag\":\"Yes\",\"pleaStatusCode\":\"7\",\"pleaValue\":\"CONSENTS\",\"jurisdiction\":\"MAGISTRATES\"}]}"
+
+ stubFor(get(urlPathMatching(pleaTypesUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", pleaTypesMediaType)
+ .withBody(pleaTypesJson)))
+
+ log.info("WireMock stub for plea types configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for plea types: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub prosecutor for any prosecutionAuthorityId
+ // The prosecutor ID comes from prosecutionAuthorityId in the test data
+ String prosecutorMediaType = "application/vnd.referencedata.query.get-prosecutor+json"
+
+ // Stub for any prosecutor ID - use urlPathMatching to extract the ID dynamically
+ stubFor(get(urlMatching("/referencedata-service/query/api/rest/referencedata/prosecutors/[a-f0-9\\-]+"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", prosecutorMediaType)
+ .withBody("{\"id\":\"406a61c5-4d71-4a81-82e4-16e7234424dd\",\"fullName\":\"Prosecutor Name\",\"oucode\":\"OuCode\",\"majorCreditorCode\":\"Major creditor code\",\"address\":{\"address1\":\"Address1\",\"postcode\":\"NU44 3XQ\"},\"informantEmailAddress\":\"dummy@email.com\"}")))
+
+ log.info("WireMock stub for prosecutor configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for prosecutor: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub local justice areas
+ String localJusticeAreasUrl = "/referencedata-service/query/api/rest/referencedata/local-justice-areas"
+ String localJusticeAreasMediaType = "application/vnd.referencedata.query.local-justice-areas+json"
+ String localJusticeAreasJson = "{\"localJusticeAreas\":[{\"nationalCourtCode\":\"123\",\"name\":\"Test LJA\",\"welshName\":\"testetestetes\"}]}"
+
+ // Stub for any nationalCourtCode query parameter
+ stubFor(get(urlPathEqualTo(localJusticeAreasUrl))
+ .withQueryParam("nationalCourtCode", matching(".*"))
+ .withHeader("Accept", equalTo(localJusticeAreasMediaType))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", localJusticeAreasMediaType)
+ .withBody(localJusticeAreasJson)))
+
+ log.info("WireMock stub for local justice areas configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for local justice areas: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+import java.time.LocalDate
+
+try {
+// Stub nows metadata
+ String nowsMetadataUrl = "/referencedata-service/query/api/rest/referencedata/nows-metadata"
+ String nowsMetadataMediaType = "application/vnd.referencedata.get-all-now-metadata+json"
+
+ // Minimal nows metadata response matching the structure from integration tests
+ String nowId1 = UUID.randomUUID().toString()
+ String nowId2 = "10115268-8efc-49fe-b8e8-feee216a03da"
+ String resultDefId1 = UUID.randomUUID().toString()
+ String resultDefId2 = UUID.randomUUID().toString()
+ String resultDefId3 = "de946ddc-ad77-44b1-8480-8bbc251cdcfb"
+ String nowsMetadataJson = "{\"nows\":[{\"id\":\"" + nowId1 + "\",\"name\":\"Test Now\",\"text\":\"NowLevel/Test\",\"templateName\":\"TestTemplate\",\"rank\":1,\"jurisdiction\":\"B\",\"remotePrintingRequired\":false,\"resultDefinitions\":[{\"id\":\"" + resultDefId1 + "\",\"mandatory\":true,\"primary\":true},{\"id\":\"" + resultDefId2 + "\",\"mandatory\":false,\"primary\":false}]},{\"id\":\"" + nowId2 + "\",\"name\":\"Attachment of Earnings\",\"text\":\"NowLevel/Attachment\",\"templateName\":\"AttachmentTemplate\",\"rank\":2,\"jurisdiction\":\"B\",\"remotePrintingRequired\":false,\"resultDefinitions\":[{\"id\":\"" + resultDefId3 + "\",\"mandatory\":true,\"primary\":true}]}]}"
+
+ // Stub for any date query parameter
+ stubFor(get(urlPathEqualTo(nowsMetadataUrl))
+ .withQueryParam("on", matching(".*"))
+ .withHeader("Accept", equalTo(nowsMetadataMediaType))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", nowsMetadataMediaType)
+ .withBody(nowsMetadataJson)))
+
+ log.info("WireMock stub for nows metadata configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for nows metadata: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub courtrooms
+ String courtroomsUrl = "/referencedata-service/query/api/rest/referencedata/courtrooms"
+ String courtroomsMediaType = "application/vnd.referencedata.ou-courtrooms+json"
+
+ // Courtrooms response matching the structure from integration tests
+ String courtCentreId = "b52f805c-2821-4904-a0e0-26f7fda6dd08"
+ String roomId = "5d5d7b5e-7833-4dc1-b94a-d1a5c635c623"
+ String courtroomsJson = "{\"organisationunits\":[{\"id\":\"" + courtCentreId + "\",\"oucodeL3Name\":\"Liverpool Crown Court\",\"isWelsh\":false,\"courtrooms\":[{\"id\":\"" + roomId + "\",\"venueName\":\"Liverpool Crown Court\",\"courtroomName\":\"CourtRoom 1\"}]},{\"id\":\"" + courtCentreId + "\",\"oucode\":\"B01BE01\",\"oucodeL1Code\":\"C\",\"oucodeL3Name\":\"Wimbledon\",\"address1\":\"4 Belmarsh Road\",\"address2\":\"London\",\"postcode\":\"SE28 0HA\",\"defaultStartTime\":\"10:00\",\"defaultDurationHrs\":\"7:00\",\"isWelsh\":false,\"courtrooms\":[{\"id\":\"f703dc83-d0e4-42c8-8d44-0352d46e5194\",\"venueName\":\"WIMBLEDON MAGISTRATES' COURT\",\"courtroomId\":789,\"courtroomName\":\"Room A\",\"oucodeL3Name\":\"Wimbledon\"},{\"id\":\"2bd3e322-f603-411d-a5ab-2e42ff4b6e00\",\"venueName\":\"WIMBLEDON MAGISTRATES' COURT\",\"courtroomId\":790,\"courtroomName\":\"Room B\",\"oucodeL3Name\":\"Wimbledon\"}]}]}"
+
+ stubFor(get(urlPathEqualTo(courtroomsUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", courtroomsMediaType)
+ .withBody(courtroomsJson)))
+
+ log.info("WireMock stub for courtrooms configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for courtrooms: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub cracked-ineffective-vacated-trial-types
+ String trialTypesUrl = "/referencedata-service/query/api/rest/referencedata/cracked-ineffective-vacated-trial-types"
+ String trialTypesMediaType = "application/vnd.referencedata.cracked-ineffective-vacated-trial-types+json"
+
+ // Trial types response matching the structure from integration tests
+ String trialTypesJson = "{\"crackedIneffectiveVacatedTrialTypes\":[{\"id\":\"9b738c6e-04fc-4e18-bc49-b599973af7e7\",\"reasonCode\":\"code\",\"trialType\":\"InEffective\",\"reasonShortDescription\":\"Prosecution witness absent: police\",\"reasonFullDescription\":\"fullDescription\",\"date\":null},{\"id\":\"9c738c6e-04fc-4e18-bc49-b599973af7b8\",\"reasonCode\":\"code\",\"trialType\":\"Vacated\",\"reasonShortDescription\":\"Prosecution failed to disclose unused material\",\"reasonFullDescription\":\"fullDescription\",\"date\":null},{\"id\":\"9d738c6e-04fc-4e18-bc49-b599973af7c6\",\"reasonCode\":\"code\",\"trialType\":\"Cracked\",\"reasonShortDescription\":\"Prosecution not ready: specify in comments\",\"reasonFullDescription\":\"fullDescription\",\"date\":null}]}"
+
+ stubFor(get(urlPathEqualTo(trialTypesUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", trialTypesMediaType)
+ .withBody(trialTypesJson)))
+
+ log.info("WireMock stub for cracked-ineffective-vacated-trial-types configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for cracked-ineffective-vacated-trial-types: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub result definitions
+ String resultDefinitionsUrl = "/referencedata-service/query/api/rest/referencedata/result-definitions"
+ String resultDefinitionsMediaType = "application/vnd.referencedata.get-all-result-definitions+json"
+
+ // Minimal result definitions response - includes the result definition IDs used in the test
+ String resultDefId1 = "969f150c-cd05-46b0-9dd9-30891efcc766"
+ String resultDefId2 = "1f3c83cc-53eb-4861-8cb8-2289b4a08307"
+ String resultDefId3 = "ebed169e-5e22-46b2-af32-8e5fb0461f05"
+ String resultDefId4 = "b8cd526c-4ca1-43ae-93bd-fc5a8f03c0d5"
+ String resultDefId5 = "de946ddc-ad77-44b1-8480-8bbc251cdcfb"
+
+ String resultDefinitionsJson = "{\"resultDefinitions\":[{\"id\":\"" + resultDefId1 + "\",\"version\":\"2021-12-10T10:23:51.677Z\",\"startDate\":\"2021-12-11\",\"label\":\"Fine\",\"shortCode\":\"FINE\",\"level\":\"OFFENCE\",\"rank\":100,\"wordGroups\":[{\"wordGroup\":[\"FINE\"]}],\"prompts\":[{\"id\":\"" + resultDefId1 + "\",\"label\":\"promptLabel\",\"resultPromptRule\":\"mandatory\",\"type\":\"FIXL\",\"sequence\":100,\"financial\":\"N\",\"reference\":\"bailConditionReason\",\"fixedListCode\":\"fixedListCode\",\"userGroups\":[],\"courtExtract\":\"N\",\"jurisdiction\":\"B\",\"hidden\":false,\"referenceDataKey\":\"bailConditionReason\",\"nameEmail\":false,\"associatedWithReferenceData\":true}],\"financial\":\"Y\",\"unscheduled\":false,\"adjournment\":\"N\",\"category\":\"I\",\"urgent\":false,\"convicted\":\"N\",\"d20\":false,\"postHearingCustodyStatus\":\"A\",\"terminatesOffenceProceedings\":false,\"lifeDuration\":false,\"rollUpPrompts\":false,\"publishedForNows\":false,\"publishedAsAPrompt\":false,\"excludedFromResults\":false,\"alwaysPublished\":false,\"jurisdiction\":\"B\",\"canBeSubjectOfBreach\":false,\"canBeSubjectOfVariation\":false,\"isAvailableForCourtExtract\":true,\"isBooleanResult\":false},{\"id\":\"" + resultDefId2 + "\",\"version\":\"2021-12-10T10:23:51.677Z\",\"startDate\":\"2021-12-11\",\"label\":\"Result Definition\",\"shortCode\":\"RD\",\"level\":\"OFFENCE\",\"rank\":200,\"wordGroups\":[{\"wordGroup\":[\"RD\"]}],\"prompts\":[{\"id\":\"" + resultDefId2 + "\",\"label\":\"promptLabel\",\"resultPromptRule\":\"mandatory\",\"type\":\"FIXL\",\"sequence\":100,\"financial\":\"N\",\"reference\":\"bailConditionReason\",\"fixedListCode\":\"fixedListCode\",\"userGroups\":[],\"courtExtract\":\"N\",\"jurisdiction\":\"B\",\"hidden\":false,\"referenceDataKey\":\"bailConditionReason\",\"nameEmail\":false,\"associatedWithReferenceData\":true}],\"financial\":\"N\",\"unscheduled\":false,\"adjournment\":\"N\",\"category\":\"I\",\"urgent\":false,\"convicted\":\"N\",\"d20\":false,\"postHearingCustodyStatus\":\"A\",\"terminatesOffenceProceedings\":false,\"lifeDuration\":false,\"rollUpPrompts\":false,\"publishedForNows\":false,\"publishedAsAPrompt\":false,\"excludedFromResults\":false,\"alwaysPublished\":false,\"jurisdiction\":\"B\",\"canBeSubjectOfBreach\":false,\"canBeSubjectOfVariation\":false,\"isAvailableForCourtExtract\":true,\"isBooleanResult\":false},{\"id\":\"" + resultDefId3 + "\",\"version\":\"2021-12-10T10:23:51.677Z\",\"startDate\":\"2021-12-11\",\"label\":\"Result Definition\",\"shortCode\":\"RD\",\"level\":\"OFFENCE\",\"rank\":300,\"wordGroups\":[{\"wordGroup\":[\"RD\"]}],\"prompts\":[{\"id\":\"" + resultDefId3 + "\",\"label\":\"promptLabel\",\"resultPromptRule\":\"mandatory\",\"type\":\"FIXL\",\"sequence\":100,\"financial\":\"N\",\"reference\":\"bailConditionReason\",\"fixedListCode\":\"fixedListCode\",\"userGroups\":[],\"courtExtract\":\"N\",\"jurisdiction\":\"B\",\"hidden\":false,\"referenceDataKey\":\"bailConditionReason\",\"nameEmail\":false,\"associatedWithReferenceData\":true}],\"financial\":\"N\",\"unscheduled\":false,\"adjournment\":\"N\",\"category\":\"I\",\"urgent\":false,\"convicted\":\"N\",\"d20\":false,\"postHearingCustodyStatus\":\"A\",\"terminatesOffenceProceedings\":false,\"lifeDuration\":false,\"rollUpPrompts\":false,\"publishedForNows\":false,\"publishedAsAPrompt\":false,\"excludedFromResults\":false,\"alwaysPublished\":false,\"jurisdiction\":\"B\",\"canBeSubjectOfBreach\":false,\"canBeSubjectOfVariation\":false,\"isAvailableForCourtExtract\":true,\"isBooleanResult\":false},{\"id\":\"" + resultDefId4 + "\",\"version\":\"2021-12-10T10:23:51.677Z\",\"startDate\":\"2021-12-11\",\"label\":\"Result Definition\",\"shortCode\":\"RD\",\"level\":\"OFFENCE\",\"rank\":400,\"wordGroups\":[{\"wordGroup\":[\"RD\"]}],\"prompts\":[{\"id\":\"" + resultDefId4 + "\",\"label\":\"promptLabel\",\"resultPromptRule\":\"mandatory\",\"type\":\"FIXL\",\"sequence\":100,\"financial\":\"N\",\"reference\":\"bailConditionReason\",\"fixedListCode\":\"fixedListCode\",\"userGroups\":[],\"courtExtract\":\"N\",\"jurisdiction\":\"B\",\"hidden\":false,\"referenceDataKey\":\"bailConditionReason\",\"nameEmail\":false,\"associatedWithReferenceData\":true}],\"financial\":\"N\",\"unscheduled\":false,\"adjournment\":\"N\",\"category\":\"I\",\"urgent\":false,\"convicted\":\"N\",\"d20\":false,\"postHearingCustodyStatus\":\"A\",\"terminatesOffenceProceedings\":false,\"lifeDuration\":false,\"rollUpPrompts\":false,\"publishedForNows\":false,\"publishedAsAPrompt\":false,\"excludedFromResults\":false,\"alwaysPublished\":false,\"jurisdiction\":\"B\",\"canBeSubjectOfBreach\":false,\"canBeSubjectOfVariation\":false,\"isAvailableForCourtExtract\":true,\"isBooleanResult\":false},{\"id\":\"" + resultDefId5 + "\",\"version\":\"2021-12-10T10:23:51.677Z\",\"startDate\":\"2021-12-11\",\"label\":\"Result Definition\",\"shortCode\":\"RD\",\"level\":\"OFFENCE\",\"rank\":500,\"wordGroups\":[{\"wordGroup\":[\"RD\"]}],\"prompts\":[{\"id\":\"" + resultDefId5 + "\",\"label\":\"promptLabel\",\"resultPromptRule\":\"mandatory\",\"type\":\"FIXL\",\"sequence\":100,\"financial\":\"N\",\"reference\":\"bailConditionReason\",\"fixedListCode\":\"fixedListCode\",\"userGroups\":[],\"courtExtract\":\"N\",\"jurisdiction\":\"B\",\"hidden\":false,\"referenceDataKey\":\"bailConditionReason\",\"nameEmail\":false,\"associatedWithReferenceData\":true}],\"financial\":\"N\",\"unscheduled\":false,\"adjournment\":\"N\",\"category\":\"I\",\"urgent\":false,\"convicted\":\"N\",\"d20\":false,\"postHearingCustodyStatus\":\"A\",\"terminatesOffenceProceedings\":false,\"lifeDuration\":false,\"rollUpPrompts\":false,\"publishedForNows\":false,\"publishedAsAPrompt\":false,\"excludedFromResults\":false,\"alwaysPublished\":false,\"jurisdiction\":\"B\",\"canBeSubjectOfBreach\":false,\"canBeSubjectOfVariation\":false,\"isAvailableForCourtExtract\":true,\"isBooleanResult\":false}]}"
+
+ // Stub for any date query parameter
+ stubFor(get(urlPathEqualTo(resultDefinitionsUrl))
+ .withQueryParam("on", matching(".*"))
+ .withHeader("Accept", equalTo(resultDefinitionsMediaType))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", resultDefinitionsMediaType)
+ .withBody(resultDefinitionsJson)))
+
+ log.info("WireMock stub for result definitions configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for result definitions: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub fixed list
+ String fixedListUrl = "/referencedata-service/query/api/rest/referencedata/fixed-list"
+ String fixedListMediaType = "application/vnd.referencedata.get-all-fixed-list+json"
+
+ // Fixed list response matching the structure from integration tests
+ String fixedListJson = "{\"fixedListCollection\":[{\"id\":\"d06f6539-2a7c-4bc8-bca3-A1e5a225471a\",\"version\":\"2018-04-19T10:44:50.219Z\",\"elements\":[{\"code\":\"CON\",\"value\":\"Convicted\"},{\"code\":\"ACQ\",\"value\":\"Acquitted\"}]}]}"
+
+ // Stub for any date query parameter
+ stubFor(get(urlPathEqualTo(fixedListUrl))
+ .withQueryParam("on", matching(".*"))
+ .withHeader("Accept", equalTo(fixedListMediaType))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", fixedListMediaType)
+ .withBody(fixedListJson)))
+
+ log.info("WireMock stub for fixed list configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for fixed list: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub verdict types
+ String verdictTypesUrl = "/referencedata-service/query/api/rest/referencedata/verdict-types"
+ String verdictTypesMediaType = "application/vnd.reference-data.verdict-types+json"
+
+ // Verdict types response matching the structure from integration tests
+ String verdictTypesJson = "{\"verdictTypes\":[{\"id\":\"c4ca4238-a0b9-3382-8dcc-509a6f75849b\",\"verdictCode\":\"VC01\",\"category\":\"Guilty\",\"categoryType\":\"GUILTY_BY_JURY_CONVICTED\",\"description\":\"Guilty\",\"sequence\":1,\"cjsVerdictCode\":\"G\"},{\"id\":\"c51ce410-c124-310e-8db5-e4b97fc2af39\",\"verdictCode\":\"VC13\",\"category\":\"Not Guilty\",\"categoryType\":\"NOT_GUILTY\",\"description\":\"Not guilty by reason of insanity\",\"sequence\":13,\"cjsVerdictCode\":\"N\"}]}"
+
+ stubFor(get(urlPathEqualTo(verdictTypesUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", verdictTypesMediaType)
+ .withBody(verdictTypesJson)))
+
+ log.info("WireMock stub for verdict types configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for verdict types: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub alcohol level methods
+ String alcoholLevelMethodsUrl = "/referencedata-service/query/api/rest/referencedata/alcohol-level-methods"
+ String alcoholLevelMethodsMediaType = "application/vnd.referencedata.alcohol-level-methods+json"
+
+ // Alcohol level methods response matching the structure from integration tests
+ String alcoholMethodId1 = UUID.randomUUID().toString()
+ String alcoholMethodId2 = UUID.randomUUID().toString()
+ String alcoholLevelMethodsJson = "{\"alcoholLevelMethods\":[{\"id\":\"" + alcoholMethodId1 + "\",\"seqNo\":1,\"methodCode\":\"A\",\"methodDescription\":\"Blood\"},{\"id\":\"" + alcoholMethodId2 + "\",\"seqNo\":2,\"methodCode\":\"B\",\"methodDescription\":\"Breath\"}]}"
+
+ stubFor(get(urlPathEqualTo(alcoholLevelMethodsUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", alcoholLevelMethodsMediaType)
+ .withBody(alcoholLevelMethodsJson)))
+
+ log.info("WireMock stub for alcohol level methods configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for alcohol level methods: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub bail statuses
+ String bailStatusesUrl = "/referencedata-service/query/api/rest/referencedata/bail-statuses"
+ String bailStatusesMediaType = "application/vnd.referencedata.bail-statuses+json"
+
+ // Bail statuses response matching the structure from integration tests
+ String bailStatusesJson = "{\"bailStatuses\":[{\"statusDescription\":\"Conditional Bail\",\"statusRanking\":1,\"id\":\"b81ac80b-81a9-48b6-87b0-cc34610eec97\",\"statusCode\":\"B\"},{\"statusDescription\":\"Unconditional Bail\",\"statusRanking\":2,\"id\":\"b81ac80b-81a9-48b6-87b0-cc34610eec98\",\"statusCode\":\"U\"},{\"statusDescription\":\"Not applicable\",\"statusRanking\":3,\"id\":\"b81ac80b-81a9-48b6-87b0-cc34610eec99\",\"statusCode\":\"A\"},{\"statusDescription\":\"Remanded into Custody\",\"statusRanking\":4,\"id\":\"5aaecac5-222b-402d-9047-84803679edac\",\"statusCode\":\"C\"}]}"
+
+ // Stub for any date path parameter or base URL
+ stubFor(get(urlMatching(bailStatusesUrl + ".*"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", bailStatusesMediaType)
+ .withBody(bailStatusesJson)))
+
+ log.info("WireMock stub for bail statuses configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for bail statuses: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub result definitions with category
+ String resultDefinitionsWithCategoryUrl = "/referencedata-service/query/api/rest/referencedata/result-definitions"
+ String resultDefinitionsWithCategoryMediaType = "application/vnd.referencedata.query-result-definitions-with-category+json"
+
+ // Result definitions with category response matching the structure from integration tests
+ String resultDefinitionsWithCategoryJson = "{\"resultDefinitions\":[{\"id\":\"969f150c-cd05-46b0-9dd9-30891efcc766\"},{\"id\":\"45b0c1fe-afe6-4652-822f-7842d79eada9\"}]}"
+
+ // Stub for category query parameter (e.g., "F") and date query parameter
+ stubFor(get(urlPathEqualTo(resultDefinitionsWithCategoryUrl))
+ .withQueryParam("category", matching(".*"))
+ .withQueryParam("on", matching(".*"))
+ .withHeader("Accept", equalTo(resultDefinitionsWithCategoryMediaType))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", resultDefinitionsWithCategoryMediaType)
+ .withBody(resultDefinitionsWithCategoryJson)))
+
+ log.info("WireMock stub for result definitions with category configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for result definitions with category: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub hearing types
+ String hearingTypesUrl = "/referencedata-service/query/api/rest/referencedata/hearing-types"
+ String hearingTypesMediaType = "application/vnd.referencedata.query.hearing-types+json"
+
+ // Hearing types response - includes the hearing type ID used in the test (9cc41e45-b594-4ba6-906e-1a4626b08fed)
+ String hearingTypesJson = "{\"hearingTypes\":[{\"id\":\"9cc41e45-b594-4ba6-906e-1a4626b08fed\",\"seqId\":29,\"hearingCode\":\"FPTP\",\"hearingDescription\":\"Further Plea and Trial Preparation\",\"welshHearingDescription\":\"Diffynnydd i fynychu 2\",\"defaultDurationMin\":20,\"validFrom\":null,\"validTo\":null,\"exhibitHearingCode\":\"CCT\",\"exhibitHearingDescription\":\"Plea and Trial Preparation\",\"trialTypeFlag\":true},{\"id\":\"8dd41e45-b594-4ba6-906e-1a4626b08fed\",\"seqId\":28,\"hearingCode\":\"PTP\",\"hearingDescription\":\"Plea and Trial Preparation\",\"welshHearingDescription\":\"Diffynnydd i fynychu i\",\"defaultDurationMin\":20,\"validFrom\":null,\"validTo\":null,\"exhibitHearingCode\":\"CCT\",\"exhibitHearingDescription\":\"Plea and Trial Preparation\",\"trialTypeFlag\":false}]}"
+
+ stubFor(get(urlPathEqualTo(hearingTypesUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", hearingTypesMediaType)
+ .withBody(hearingTypesJson)))
+
+ log.info("WireMock stub for hearing types configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for hearing types: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub cp-xhibit-hearing-event-mappings
+ String xhibitHearingEventMappingsUrl = "/referencedata-service/query/api/rest/referencedata/cp-xhibit-hearing-event-mappings"
+ String xhibitHearingEventMappingsMediaType = "application/vnd.referencedata.query.cp-xhibit-hearing-event-mappings+json"
+
+ // CP Xhibit hearing event mappings response matching the structure from integration tests
+ String xhibitHearingEventMappingsJson = " { \"cpXhibitHearingEventMappings\": [ { \"cpHearingEventId\": \"b71e7d2a-d3b3-4a55-a393-6d451767fc05\", \"xhibitHearingEventCode\": \"10200\", \"xhibitHearingEventDescription\": \"Start Hearing\", \"validFrom\": \"2016-04-08\" }, { \"cpHearingEventId\": \"50fb4a64-943d-4a2a-afe6-4b5c9e99e043\", \"xhibitHearingEventCode\": \"20606\", \"xhibitHearingEventDescription\": \"Appellant opens\", \"validFrom\": \"2016-04-08\" }, { \"cpHearingEventId\": \"e9060336-4821-4f46-969c-e08b33b48071\", \"xhibitHearingEventCode\": \"20903\", \"xhibitHearingEventDescription\": \"Open case prosecution\", \"validFrom\": \"2016-04-08\" }, { \"cpHearingEventId\": \"a3a9fe0c-a9a7-4e17-b0cd-42606722bbb0\", \"xhibitHearingEventCode\": \"20906\", \"xhibitHearingEventDescription\": \"Defence counsel.name opens case regarding defendant defendant.name\", \"validFrom\": \"2016-04-08\" }, { \"cpHearingEventId\": \"cc00cca8-39ba-431c-b08f-8c6f9be185d1\", \"xhibitHearingEventCode\": \"20910\", \"xhibitHearingEventDescription\": \"Defence counsel.name closes case regarding defendant defendant.name\", \"validFrom\": \"2016-04-08\" }, { \"cpHearingEventId\": \"b335327a-7f58-4f26-a2ef-7e07134ba60b\", \"xhibitHearingEventCode\": \"20916\", \"xhibitHearingEventDescription\": \"Point of law discussion prosecution\", \"validFrom\": \"2016-04-08\" } ]}"
+
+ stubFor(get(urlPathEqualTo(xhibitHearingEventMappingsUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", xhibitHearingEventMappingsMediaType)
+ .withBody(xhibitHearingEventMappingsJson)))
+
+ log.info("WireMock stub for cp-xhibit-hearing-event-mappings configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for cp-xhibit-hearing-event-mappings: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub cp-xhibit-court-mappings
+ String xhibitCourtMappingsUrl = "/referencedata-service/query/api/rest/referencedata/cp-xhibit-court-mappings"
+ String xhibitCourtMappingsMediaType = "application/vnd.referencedata.query.cp-xhibit-court-mappings+json"
+
+ // CP Xhibit court mappings response matching the structure from integration tests
+ String xhibitCourtMappingsJson = " { \"cpXhibitCourtMappings\": [{ \"id\": \"0a43a1dd-9ba7-33d9-a306-554784e5b116\", \"oucode\": \"C04PR00\", \"crestCourtId\": \"448\", \"crestCourtSiteId\": \"751\", \"crestCourtSiteName\": \"BARROW-IN-FURNESS\", \"crestCourtName\": \"PRESTON\", \"crestCourtShortName\": \"PREST\", \"crestCourtFullName\": \"PRESTON\", \"crestCourtSiteCode\": \"C\", \"courtType\": \"CROWN_COURT\"},{ \"id\": \"26767ef5-5441-32d1-bf5e-baf746936b37\", \"oucode\": \"C04PR00\", \"crestCourtId\": \"448\", \"crestCourtSiteId\": \"448\", \"crestCourtSiteName\": \"PRESTON\", \"crestCourtName\": \"PRESTON\", \"crestCourtShortName\": \"PREST\", \"crestCourtFullName\": \"PRESTON\", \"crestCourtSiteCode\": \"A\", \"courtType\": \"CROWN_COURT\"},{ \"id\": \"e2afcfff-48f3-3647-9ead-a06dcba4bb47\", \"oucode\": \"C04PR00\", \"crestCourtId\": \"448\", \"crestCourtSiteId\": \"448\", \"crestCourtSiteName\": \"PRESTON [THE SESSIONS HOUSE]\", \"crestCourtName\": \"PRESTON\", \"crestCourtShortName\": \"PREST\", \"crestCourtFullName\": \"PRESTON\", \"crestCourtSiteCode\": \"B\", \"courtType\": \"CROWN_COURT\"},{ \"id\": \"cadfb7e2-f293-36a6-b466-3875d88ba6e4\", \"oucode\": \"C04PR00\", \"crestCourtId\": \"448\", \"crestCourtSiteId\": \"768\", \"crestCourtSiteName\": \"LANCASTER\", \"crestCourtName\": \"PRESTON\", \"crestCourtShortName\": \"PREST\", \"crestCourtFullName\": \"PRESTON\", \"crestCourtSiteCode\": \"D\", \"courtType\": \"CROWN_COURT\"} ]}"
+
+ stubFor(get(urlPathEqualTo(xhibitCourtMappingsUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", xhibitCourtMappingsMediaType)
+ .withBody(xhibitCourtMappingsJson)))
+
+ log.info("WireMock stub for cp-xhibit-court-mappings configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for cp-xhibit-court-mappings: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+// Stub cp-xhibit-court-mappings
+ String xhibitCourtMappingsUrl = "/referencedata-service/query/api/rest/referencedata/cp-xhibit-mags-court-mapping"
+ String xhibitCourtMappingsMediaType = "application/vnd.referencedata.query.cp-xhibit-mags-court-mapping+json"
+
+ // CP Xhibit court mappings response matching the structure from integration tests
+ String xhibitCourtMappingsJson = " { \"id\": \"b52f805c-2821-4904-a0e0-26f7fda6dd08\", \"oucode\": \"B01BH00\", \"crestCourtId\": \"448\", \"crestCourtSiteId\": \"751\", \"crestCourtSiteName\": \"BARROW-IN-FURNESS\", \"crestCourtName\": \"PRESTON\", \"crestCourtShortName\": \"PREST\", \"crestCourtFullName\": \"PRESTON\", \"crestCourtSiteCode\": \"C\", \"courtType\": \"CROWN_COURT\"}}"
+
+ stubFor(get(urlPathEqualTo(xhibitCourtMappingsUrl))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())
+ .withHeader("Content-Type", xhibitCourtMappingsMediaType)
+ .withBody(xhibitCourtMappingsJson)))
+
+ log.info("WireMock stub for cp-xhibit-court-mappings configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub for cp-xhibit-court-mappings: " + e.getMessage())
+}
+ groovy
+
+
+
+ true
+
+
+ import com.github.tomakehurst.wiremock.client.WireMock
+import static com.github.tomakehurst.wiremock.client.WireMock.*
+import java.util.UUID
+
+try {
+String xhibitGatewayPathRegex = "/xhibit-gateway/send-to-xhibit/.*\\.xml"
+
+ stubFor(put(urlPathMatching(xhibitGatewayPathRegex))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("CPPID", UUID.randomUUID().toString())))
+
+ log.info("WireMock stub for Xhibit gateway file upload configured successfully")
+} catch (Exception e) {
+ log.warn("Failed to configure WireMock stub: " + e.getMessage())
+}
+ groovy
+
+
+
+ groovy
+
+
+ true
+ def customMetricsFile = new File(vars.get("resultDir") + "/custom-metrics.csv")
+customMetricsFile.append("timestamp,eventLogCount,publishedEventCount,notLinked,sumPositionsEventListener,sumLatestKnownPositionEventListener,sumPositionsEventIndexer,sumLatestKnownPositionEventIndexer\n")
+
+
+
+
+ 6
+ ${hostName}
+ ${port}
+ ${protocol}
+ /hearing-service/command/api/rest/hearing/hearings/event-definitions
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ {"id":"96ff13bf-0aac-43ba-877d-c7da67b1e30d","eventDefinitions":[{"id":"67b75d91-085f-4c75-b941-09c80bee6df6","caseAttribute":"SENTENCING","actionLabel":"Hearing ended","actionSequence":882929325,"groupLabel":"wKkH7am4zz","groupSequence":2095509888,"alterable":false,"recordedLabel":"Hearing ended"},{"id":"b71e7d2a-d3b3-4a55-a393-6d451767fc05","caseAttribute":"SENTENCING","actionLabel":"Start Hearing","actionSequence":936967479,"groupLabel":"4428rcyPcN","groupSequence":1603353170,"alterable":false,"recordedLabel":"YOxCjRZgyK"},{"id":"699a2d2e-56f3-4952-90ab-e22870b2196d","caseAttribute":"SENTENCING","actionLabel":"Identify defendant","actionSequence":1359865467,"groupLabel":"y6x4DdKgv9","groupSequence":685479997,"alterable":true,"recordedLabel":"6Zs6zndse1"},{"id":"a66576ab-b966-4480-988f-3f17f019897e","caseAttribute":"SENTENCING","actionLabel":"Take Plea","actionSequence":1593556401,"groupLabel":"zLiKB6nUV3","groupSequence":606936825,"alterable":true,"recordedLabel":"ZrWfdKkZkn"},{"id":"be59557a-d89d-47d3-a6f1-a4db67986616","caseAttribute":"SENTENCING","actionLabel":"Prosecution Opening","actionSequence":1559526053,"groupLabel":"hWAX5qq2Aw","groupSequence":970603096,"alterable":true,"recordedLabel":"IQ5Mkrdk13"},{"id":"9d3eaaef-1f67-47ab-8b8f-18877110fa34","caseAttribute":"SENTENCING","actionLabel":"<counsel.name>","actionSequence":2072444200,"groupLabel":"mm4jEfVemq","groupSequence":54208119,"alterable":true,"recordedLabel":"R8g9vE0tVD"},{"id":"b21b4aea-e372-4448-99cc-577b9e8c6ab4","caseAttribute":"SENTENCING","actionLabel":"Sentencing","actionSequence":325334225,"groupLabel":"trk2y8UF4X","groupSequence":1904954095,"alterable":true,"recordedLabel":"M7O5kYljzS"},{"id":"0df93f18-0a21-40f5-9fb3-da4749cd70fe","caseAttribute":"SENTENCING","actionLabel":"End Hearing","actionSequence":229112933,"groupLabel":"LWtWrTepQf","groupSequence":1106999235,"alterable":false,"recordedLabel":"n9qjPfrIQQ"},{"id":"160ecb51-29ee-4954-bbbf-daab18a24fbb","caseAttribute":"PAUSE_RESUME","actionLabel":"Pause","actionSequence":809187934,"groupLabel":"W8267kGIM8","groupSequence":837036653,"alterable":false,"recordedLabel":"tD4x6oPzpO"},{"id":"64476e43-2138-46d5-b58b-848582cf9b07","caseAttribute":"PAUSE_RESUME","actionLabel":"Resume","actionSequence":1777760034,"groupLabel":"DfxVnClQRk","groupSequence":257720856,"alterable":false,"recordedLabel":"Ek3fJ90eXr"},{"id":"50fb4a64-943d-4a2a-afe6-4b5c9e99e043","caseAttribute":"APPEAL","actionLabel":"Appellant opens","actionSequence":1165860257,"groupLabel":"UJko9uPUfy","groupSequence":1583647649,"alterable":false,"recordedLabel":"oVVmNi7sgT"},{"id":"e9060336-4821-4f46-969c-e08b33b48071","caseAttribute":"OPEN_CASE","actionLabel":"Open case prosecution","actionSequence":157682722,"groupLabel":"dYRCaSpAB0","groupSequence":2111600802,"alterable":false,"recordedLabel":"fsGrkq8Kko"},{"id":"a3a9fe0c-a9a7-4e17-b0cd-42606722bbb0","caseAttribute":"OPEN_CASE","actionLabel":"Defence counsel.name opens case regarding defendant defendant.name","actionSequence":573161802,"groupLabel":"L2SMODumuq","groupSequence":270979194,"alterable":false,"recordedLabel":"UCMuuYkd3I"},{"id":"cc00cca8-39ba-431c-b08f-8c6f9be185d1","caseAttribute":"CLOSE_CASE","actionLabel":"Defence counsel.name closes case regarding defendant defendant.name","actionSequence":788845658,"groupLabel":"v15wqkRiYq","groupSequence":262053570,"alterable":false,"recordedLabel":"yUPzPboGjk"},{"id":"b335327a-7f58-4f26-a2ef-7e07134ba60b","caseAttribute":"DISCUSSION","actionLabel":"Point of law discussion prosecution","actionSequence":437014501,"groupLabel":"vizhheLRn2","groupSequence":56047713,"alterable":false,"recordedLabel":"xf7NtBpO3B"},{"id":"c3edf650-13c4-4ecb-9f85-6100ad8e4ffc","caseAttribute":"DISCUSSION","actionLabel":"Arraign defendant.name","actionSequence":1582758733,"groupLabel":"aaJa2BpROG","groupSequence":1843187454,"alterable":false,"recordedLabel":"rpEKxA3iAu"}]}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.create-hearing-event-definitions+json
+
+
+
+
+
+
+ 1
+ 0
+ 0
+
+
+
+ groovy
+
+
+ true
+ import org.apache.jmeter.services.FileServer;
+import org.apache.jmeter.util.JMeterUtils;
+
+def baseDir = FileServer.getFileServer().getBaseDir();
+def projectRoot = new File(baseDir).getParentFile();
+def dataDir = new File(projectRoot, "data")
+
+// Save as variable
+JMeterUtils.setProperty("DATA_DIR", dataDir.getAbsolutePath())
+
+log.info("DATA_DIR -> " + dataDir.getAbsolutePath())
+log.info("thread count -> " + vars.get("numberOfThreads"))
+
+
+
+
+
+
+
+
+ ${numberOfThreads}
+ ${rampUpPeriod}
+ true
+ continue
+
+ ${loopCount}
+ false
+
+
+
+
+ ${hostName}
+ ${port}
+ ${protocol}
+
+
+
+
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.initiate+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "initiate-hearing-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+vars.put("hearingId", UUID.randomUUID().toString())
+log.info("hearingId-> " + vars.get("hearingId"))
+
+vars.put("applicationId", UUID.randomUUID().toString())
+log.info("applicationId-> " + vars.get("applicationId"))
+
+vars.put("caseId", UUID.randomUUID().toString())
+log.info("caseId-> " + vars.get("caseId"))
+
+vars.put("courtOrderId", UUID.randomUUID().toString())
+log.info("courtOrderId-> " + vars.get("courtOrderId"))
+
+vars.put("defendantId", UUID.randomUUID().toString())
+log.info("defendantId-> " + vars.get("defendantId"))
+
+vars.put("offenceId", UUID.randomUUID().toString())
+log.info("offenceId-> " + vars.get("offenceId"))
+
+vars.put("courtOrderOffenceId", UUID.randomUUID().toString())
+log.info("courtOrderOffenceId-> " + vars.get("courtOrderOffenceId"))
+
+vars.put("courtApplicationOffenceId", UUID.randomUUID().toString())
+log.info("courtApplicationOffenceId-> " + vars.get("courtApplicationOffenceId"))
+
+vars.put("courtApplicationCaseId", UUID.randomUUID().toString())
+log.info("courtApplicationCaseId-> " + vars.get("courtApplicationCaseId"))
+
+vars.put("courtOrderCaseId", UUID.randomUUID().toString())
+log.info("courtOrderCaseId-> " + vars.get("courtOrderCaseId"))
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ groovy
+
+
+ true
+ import org.apache.jmeter.protocol.jdbc.config.DataSourceElement
+
+def hearingId = vars.get("hearingId")
+def pollerTimeout = Long.parseLong(vars.get("pollerTimeout"))
+def pollInterval = Long.parseLong(vars.get("pollInterval"))
+def startTime = System.currentTimeMillis()
+
+log.info("Polling for hearing " + hearingId + " with timeout " + pollerTimeout + "ms and interval " + pollInterval + "ms")
+println("Polling for hearing " + hearingId + " with timeout " + pollerTimeout + "ms and interval " + pollInterval + "ms")
+def found = false
+ def conn = null
+ try {
+ conn = org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection("hearingviewstore")
+ while (!found && (System.currentTimeMillis() - startTime) < pollerTimeout) {
+ def ps = conn.prepareStatement("SELECT count(*) FROM ha_hearing WHERE id = ?::uuid")
+ ps.setString(1, hearingId)
+ def rs = ps.executeQuery()
+ if (rs.next() && rs.getInt(1) > 0) {
+ found = true
+ }
+ rs.close()
+ ps.close()
+
+ if (!found) {
+ Thread.sleep(pollInterval)
+ }
+ }
+ } finally {
+ if (conn != null) conn.close()
+ }
+
+
+def elapsed = System.currentTimeMillis() - startTime
+if (found) {
+ log.info("Hearing " + hearingId + " found after " + elapsed + "ms")
+ println("Hearing " + hearingId + " found after " + elapsed + "ms")
+ SampleResult.setResponseMessage("Hearing found after " + elapsed + "ms")
+} else {
+ SampleResult.setSuccessful(false)
+ SampleResult.setResponseMessage("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+ log.error("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+ println("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.update-defendant-attendance-on-hearing-day+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "update-defendant-attendance-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.add-prosecution-counsel+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "add-prosecution-counsel-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("prosecutionCounselId", UUID.randomUUID().toString())
+log.info("prosecutionCounselId-> " + vars.get("prosecutionCounselId"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.update-verdict+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "update-verdict-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}/${hearingDay}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.shared-results+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "shared-results-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("hearingDay", "2026-01-23")
+log.info("hearingDay-> " + vars.get("hearingDay"))
+
+vars.put("resultLineId", UUID.randomUUID().toString())
+log.info("resultLineId-> " + vars.get("resultLineId"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.update-verdict+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "update-verdict-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}/${hearingDay}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.shared-results+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "shared-results-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("resultLineId", UUID.randomUUID().toString())
+log.info("resultLineId-> " + vars.get("resultLineId"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ true
+
+ saveConfig
+
+
+ true
+ true
+ true
+
+ true
+ true
+ true
+ true
+ false
+ true
+ true
+ false
+ false
+ false
+ true
+ false
+ false
+ false
+ true
+ 0
+ true
+ true
+ true
+ true
+ true
+ true
+
+
+ ${resultDir}/errors.csv
+
+
+
+
+ ${numberOfThreads}
+ ${rampUpPeriod}
+ true
+ continue
+
+ ${loopCount}
+ false
+
+
+
+
+ ${hostName}
+ ${port}
+ ${protocol}
+
+
+
+
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.initiate+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "court-list-restriction-initiate-hearing-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("hearingId", UUID.randomUUID().toString())
+log.info("hearingId-> " + vars.get("hearingId"))
+
+vars.put("defendantId", UUID.randomUUID().toString())
+log.info("defendantId-> " + vars.get("defendantId"))
+
+vars.put("defenceCounselId", UUID.randomUUID().toString())
+log.info("defenceCounselId-> " + vars.get("defenceCounselId"))
+
+vars.put("defendantReferralReasonId", UUID.randomUUID().toString())
+log.info("defendantReferralReasonId-> " + vars.get("defendantReferralReasonId"))
+
+vars.put("caseId", UUID.randomUUID().toString())
+log.info("caseId-> " + vars.get("caseId"))
+
+vars.put("offenceId", UUID.randomUUID().toString())
+log.info("offenceId-> " + vars.get("offenceId"))
+
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+ 1000
+
+
+
+
+ groovy
+
+
+ true
+ import org.apache.jmeter.protocol.jdbc.config.DataSourceElement
+
+def hearingId = vars.get("hearingId")
+def pollerTimeout = Long.parseLong(vars.get("pollerTimeout"))
+def pollInterval = Long.parseLong(vars.get("pollInterval"))
+def startTime = System.currentTimeMillis()
+
+log.info("Polling for hearing " + hearingId + " with timeout " + pollerTimeout + "ms and interval " + pollInterval + "ms")
+println("Polling for hearing " + hearingId + " with timeout " + pollerTimeout + "ms and interval " + pollInterval + "ms")
+def found = false
+ def conn = null
+ try {
+ conn = org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection("hearingviewstore")
+ while (!found && (System.currentTimeMillis() - startTime) < pollerTimeout) {
+ def ps = conn.prepareStatement("SELECT count(*) FROM ha_hearing WHERE id = ?::uuid")
+ ps.setString(1, hearingId)
+ def rs = ps.executeQuery()
+ if (rs.next() && rs.getInt(1) > 0) {
+ found = true
+ }
+ rs.close()
+ ps.close()
+
+ if (!found) {
+ Thread.sleep(pollInterval)
+ }
+ }
+ } finally {
+ if (conn != null) conn.close()
+ }
+
+
+def elapsed = System.currentTimeMillis() - startTime
+if (found) {
+ log.info("Hearing " + hearingId + " found after " + elapsed + "ms")
+ println("Hearing " + hearingId + " found after " + elapsed + "ms")
+ SampleResult.setResponseMessage("Hearing found after " + elapsed + "ms")
+} else {
+ SampleResult.setSuccessful(false)
+ SampleResult.setResponseMessage("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+ log.error("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+ println("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}/event
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.log-hearing-event+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "log-hearing-event-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("hearingEventId", UUID.randomUUID().toString())
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ 1000
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/publish-court-list
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.publish-court-list+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "publish-court-list-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+ 100
+
+
+
+
+ 200
+
+
+
+ true
+
+ saveConfig
+
+
+ true
+ true
+ true
+
+ true
+ true
+ true
+ true
+ false
+ true
+ true
+ false
+ false
+ false
+ true
+ false
+ false
+ false
+ true
+ 0
+ true
+ true
+ true
+ true
+ true
+ true
+
+
+ ${resultDir}/errors.csv
+
+
+
+
+ ${numberOfThreads}
+ ${rampUpPeriod}
+ true
+ continue
+
+ ${loopCount}
+ false
+
+
+
+
+ ${hostName}
+ ${port}
+ ${protocol}
+
+
+
+
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.initiate+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "cancel-remaining-hearing-days-initiate-hearing-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("hearingId", UUID.randomUUID().toString())
+log.info("hearingId-> " + vars.get("hearingId"))
+
+vars.put("applicationId", UUID.randomUUID().toString())
+log.info("applicationId-> " + vars.get("applicationId"))
+
+vars.put("caseId", UUID.randomUUID().toString())
+log.info("caseId-> " + vars.get("caseId"))
+
+vars.put("courtOrderId", UUID.randomUUID().toString())
+log.info("courtOrderId-> " + vars.get("courtOrderId"))
+
+vars.put("defendantId", UUID.randomUUID().toString())
+log.info("defendantId-> " + vars.get("defendantId"))
+
+vars.put("offenceId", UUID.randomUUID().toString())
+log.info("offenceId-> " + vars.get("offenceId"))
+
+vars.put("courtOrderOffenceId", UUID.randomUUID().toString())
+log.info("courtOrderOffenceId-> " + vars.get("courtOrderOffenceId"))
+
+vars.put("courtApplicationOffenceId", UUID.randomUUID().toString())
+log.info("courtApplicationOffenceId-> " + vars.get("courtApplicationOffenceId"))
+
+vars.put("courtApplicationCaseId", UUID.randomUUID().toString())
+log.info("courtApplicationCaseId-> " + vars.get("courtApplicationCaseId"))
+
+vars.put("courtOrderCaseId", UUID.randomUUID().toString())
+log.info("courtOrderCaseId-> " + vars.get("courtOrderCaseId"))
+
+vars.put("defendantReferralReasonId", UUID.randomUUID().toString())
+log.info("defendantReferralReasonId-> " + vars.get("defendantReferralReasonId"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+ 1000
+
+
+
+
+ groovy
+
+
+ true
+ import org.apache.jmeter.protocol.jdbc.config.DataSourceElement
+
+def hearingId = vars.get("hearingId")
+def pollerTimeout = Long.parseLong(vars.get("pollerTimeout"))
+def pollInterval = Long.parseLong(vars.get("pollInterval"))
+def startTime = System.currentTimeMillis()
+
+log.info("Polling for hearing " + hearingId + " with timeout " + pollerTimeout + "ms and interval " + pollInterval + "ms")
+println("Polling for hearing " + hearingId + " with timeout " + pollerTimeout + "ms and interval " + pollInterval + "ms")
+def found = false
+ def conn = null
+ try {
+ conn = org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection("hearingviewstore")
+ while (!found && (System.currentTimeMillis() - startTime) < pollerTimeout) {
+ def ps = conn.prepareStatement("SELECT count(*) FROM ha_hearing WHERE id = ?::uuid")
+ ps.setString(1, hearingId)
+ def rs = ps.executeQuery()
+ if (rs.next() && rs.getInt(1) > 0) {
+ found = true
+ }
+ rs.close()
+ ps.close()
+
+ if (!found) {
+ Thread.sleep(pollInterval)
+ }
+ }
+ } finally {
+ if (conn != null) conn.close()
+ }
+
+
+def elapsed = System.currentTimeMillis() - startTime
+if (found) {
+ log.info("Hearing " + hearingId + " found after " + elapsed + "ms")
+ println("Hearing " + hearingId + " found after " + elapsed + "ms")
+ SampleResult.setResponseMessage("Hearing found after " + elapsed + "ms")
+} else {
+ SampleResult.setSuccessful(false)
+ SampleResult.setResponseMessage("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+ log.error("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+ println("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.update-defendant-attendance-on-hearing-day+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "cancel-remaining-hearing-days-update-defendant-attendance-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.add-prosecution-counsel+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "cancel-remaining-hearing-days-add-prosecution-counsel-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("prosecutionCounselId", UUID.randomUUID().toString())
+log.info("prosecutionCounselId-> " + vars.get("prosecutionCounselId"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.update-verdict+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "cancel-remaining-hearing-days-update-verdict-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.set-trial-type+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "cancel-remaining-hearing-days-set-trial-type-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}/share-results
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.share-results+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "cancel-remaining-hearing-days-share-results-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("resultLineId", UUID.randomUUID().toString())
+log.info("resultLineId-> " + vars.get("resultLineId"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ true
+
+ saveConfig
+
+
+ true
+ true
+ true
+
+ true
+ true
+ true
+ true
+ false
+ true
+ true
+ false
+ false
+ false
+ true
+ false
+ false
+ false
+ true
+ 0
+ true
+ true
+ true
+ true
+ true
+ true
+
+
+ ${resultDir}/errors.csv
+
+
+
+ localhost
+ 8080
+ /__admin/requests
+ true
+ DELETE
+ true
+ false
+
+
+
+
+
+
+
+ ${numberOfThreads}
+ ${rampUpPeriod}
+ true
+ continue
+
+ ${loopCount}
+ false
+
+
+
+
+ ${hostName}
+ ${port}
+ ${protocol}
+
+
+
+
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.initiate+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "result-should-publish-ddch-initiate-hearing-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("hearingId", UUID.randomUUID().toString())
+log.info("hearingId-> " + vars.get("hearingId"))
+
+vars.put("applicationId", UUID.randomUUID().toString())
+log.info("applicationId-> " + vars.get("applicationId"))
+
+vars.put("caseId", UUID.randomUUID().toString())
+log.info("caseId-> " + vars.get("caseId"))
+
+vars.put("courtOrderId", UUID.randomUUID().toString())
+log.info("courtOrderId-> " + vars.get("courtOrderId"))
+
+vars.put("defendantId", UUID.randomUUID().toString())
+log.info("defendantId-> " + vars.get("defendantId"))
+
+vars.put("offenceId", UUID.randomUUID().toString())
+log.info("offenceId-> " + vars.get("offenceId"))
+
+vars.put("courtOrderOffenceId", UUID.randomUUID().toString())
+log.info("courtOrderOffenceId-> " + vars.get("courtOrderOffenceId"))
+
+vars.put("courtApplicationOffenceId", UUID.randomUUID().toString())
+log.info("courtApplicationOffenceId-> " + vars.get("courtApplicationOffenceId"))
+
+vars.put("courtApplicationCaseId", UUID.randomUUID().toString())
+log.info("courtApplicationCaseId-> " + vars.get("courtApplicationCaseId"))
+
+vars.put("courtOrderCaseId", UUID.randomUUID().toString())
+log.info("courtOrderCaseId-> " + vars.get("courtOrderCaseId"))
+
+vars.put("defendantReferralReasonId", UUID.randomUUID().toString())
+log.info("defendantReferralReasonId-> " + vars.get("defendantReferralReasonId"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ groovy
+
+
+ true
+ import org.apache.jmeter.protocol.jdbc.config.DataSourceElement
+
+def hearingId = vars.get("hearingId")
+def pollerTimeout = Long.parseLong(vars.get("pollerTimeout"))
+def pollInterval = Long.parseLong(vars.get("pollInterval"))
+def startTime = System.currentTimeMillis()
+
+log.info("Polling for hearing " + hearingId + " with timeout " + pollerTimeout + "ms and interval " + pollInterval + "ms")
+println("Polling for hearing " + hearingId + " with timeout " + pollerTimeout + "ms and interval " + pollInterval + "ms")
+def found = false
+ def conn = null
+ try {
+ conn = org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection("hearingviewstore")
+ while (!found && (System.currentTimeMillis() - startTime) < pollerTimeout) {
+ def ps = conn.prepareStatement("SELECT count(*) FROM ha_hearing WHERE id = ?::uuid")
+ ps.setString(1, hearingId)
+ def rs = ps.executeQuery()
+ if (rs.next() && rs.getInt(1) > 0) {
+ found = true
+ }
+ rs.close()
+ ps.close()
+
+ if (!found) {
+ Thread.sleep(pollInterval)
+ }
+ }
+ } finally {
+ if (conn != null) conn.close()
+ }
+
+
+def elapsed = System.currentTimeMillis() - startTime
+if (found) {
+ log.info("Hearing " + hearingId + " found after " + elapsed + "ms")
+ println("Hearing " + hearingId + " found after " + elapsed + "ms")
+ SampleResult.setResponseMessage("Hearing found after " + elapsed + "ms")
+} else {
+ SampleResult.setSuccessful(false)
+ SampleResult.setResponseMessage("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+ log.error("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+ println("Hearing " + hearingId + " not found within " + pollerTimeout + "ms timeout")
+}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.update-defendant-attendance-on-hearing-day+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "result-should-publish-ddch-update-defendant-attendance-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.add-prosecution-counsel+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "result-should-publish-ddch-add-prosecution-counsel-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("prosecutionCounselId", UUID.randomUUID().toString())
+log.info("prosecutionCounselId-> " + vars.get("prosecutionCounselId"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.update-plea+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "result-should-publish-ddch-update-plea-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.set-trial-type+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "result-should-publish-ddch-set-trial-type-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}/share-results
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.share-results+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "result-should-publish-ddch-share-results-initial-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("resultLineId1", UUID.randomUUID().toString())
+log.info("resultLineId1-> " + vars.get("resultLineId1"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}/share-results
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.share-results+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "result-should-publish-ddch-share-results-amend-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("resultLineId2", UUID.randomUUID().toString())
+log.info("resultLineId2-> " + vars.get("resultLineId2"))
+
+vars.put("resultLineId3", UUID.randomUUID().toString())
+log.info("resultLineId3-> " + vars.get("resultLineId3"))
+
+vars.put("resultLineId4", UUID.randomUUID().toString())
+log.info("resultLineId4-> " + vars.get("resultLineId4"))
+
+vars.put("resultLineId5", UUID.randomUUID().toString())
+log.info("resultLineId5-> " + vars.get("resultLineId5"))
+
+vars.put("amendmentReasonId1", UUID.randomUUID().toString())
+log.info("amendmentReasonId1-> " + vars.get("amendmentReasonId1"))
+
+vars.put("amendmentReasonId2", UUID.randomUUID().toString())
+log.info("amendmentReasonId2-> " + vars.get("amendmentReasonId2"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ 6
+ /hearing-service/command/api/rest/hearing/hearings/${hearingId}/share-results
+ true
+ POST
+ true
+ true
+
+
+
+ false
+ ${jsonMessage}
+ =
+
+
+
+ HttpClient4
+
+
+
+
+
+ CJSCPPUID
+ ${userId}
+
+
+ Content-Type
+ application/vnd.hearing.share-results+json
+
+
+
+
+
+ true
+
+
+ import org.apache.jmeter.engine.util.CompoundVariable
+import org.apache.jmeter.util.JMeterUtils;
+
+def dataDir = JMeterUtils.getProperty("DATA_DIR")
+
+def file = new File(dataDir, "result-should-publish-ddch-share-results-reshare-request.json")
+if (!file.exists()) {
+ throw new FileNotFoundException("File not found: ${file.absolutePath}")
+}
+
+def rawJson = file.text
+
+vars.put("resultLineId6", UUID.randomUUID().toString())
+log.info("resultLineId6-> " + vars.get("resultLineId6"))
+
+vars.put("resultLineId7", UUID.randomUUID().toString())
+log.info("resultLineId7-> " + vars.get("resultLineId7"))
+
+vars.put("amendmentReasonId3", UUID.randomUUID().toString())
+log.info("amendmentReasonId3-> " + vars.get("amendmentReasonId3"))
+
+vars.put("amendmentReasonId4", UUID.randomUUID().toString())
+log.info("amendmentReasonId4-> " + vars.get("amendmentReasonId4"))
+
+def evaluatedJson = new CompoundVariable(rawJson).execute()
+
+vars.put("jsonMessage", evaluatedJson)
+ groovy
+
+
+
+
+ ${waitAfterEachCommand}
+
+
+
+ true
+
+ saveConfig
+
+
+ true
+ true
+ true
+
+ true
+ true
+ true
+ true
+ false
+ true
+ true
+ false
+ false
+ false
+ true
+ false
+ false
+ false
+ true
+ 0
+ true
+ true
+ true
+ true
+ true
+ true
+
+
+ ${resultDir}/errors.csv
+
+
+
+
+ 1
+ 1
+ true
+ continue
+
+ -1
+ false
+
+
+
+
+ localhost
+ 8080
+ /__admin/requests
+ true
+ DELETE
+ true
+ false
+
+
+
+
+
+
+ hearingeventstore
+ select count(*) as event_log_count,
+ count(*) filter (where is_published is true) as published_events,
+ count(*) filter (where event_number is null) as not_linked from event_log;
+
+
+
+ Select Statement
+ Store as String
+
+ eventLogCountResultSet
+
+
+
+
+ Object rsObj = vars.getObject("eventLogCountResultSet");
+
+// default value
+vars.put("eventLogCount", "0");
+vars.put("published_events", "0");
+vars.put("not_linked", "0");
+
+// exit early if result set object is missing
+if (rsObj == null) {
+ return;
+}
+
+// must be a List
+if (!(rsObj instanceof java.util.List)) {
+ return;
+}
+
+java.util.List rs = (java.util.List) rsObj;
+
+// must have at least one row
+if (rs.isEmpty()) {
+ return;
+}
+
+Object rowObj = rs.get(0);
+
+// first row must be a Map
+if (!(rowObj instanceof java.util.Map)) {
+ return;
+}
+java.util.Map row = (java.util.Map) rowObj;
+
+// must contain the column
+if (!row.containsKey("event_log_count")) {
+ return;
+}
+
+vars.put("eventLogCount", row.get("event_log_count").toString());
+
+vars.put("publishedEvents", row.get("published_events").toString());
+
+vars.put("notLinked", row.get("not_linked").toString());
+
+
+
+ false
+
+
+
+ true
+
+
+ prev.setIgnore();
+ groovy
+
+
+
+
+ hearingviewstore
+ select component, sum(position) as sum_position, sum(latest_known_position) as sum_latest_known_position from stream_status
+group by component;
+
+
+
+ Select Statement
+ Store as String
+
+ streamStatusResultSet
+
+
+
+
+ import java.util.List;
+import java.util.Map;
+
+// Get the result set
+Object resultSetObj = vars.getObject("streamStatusResultSet");
+
+if (resultSetObj != null && resultSetObj instanceof List) {
+ List resultSet = (List) resultSetObj;
+
+ // Initialize variables
+ String sumPositionsEventListener = "0";
+ String sumPositionsEventIndexer = "0";
+ String sumLatestKnownPositionEventListener = "0";
+ String sumLatestKnownPositionEventIndexer = "0";
+
+
+ // Iterate through results
+ for (int i = 0; i < resultSet.size(); i++) {
+
+ Object rowObj = resultSet.get(i);
+ if (rowObj instanceof Map) {
+ Map row = (Map) rowObj;
+ String component = row.get("component") != null ? row.get("component").toString() : "";
+
+ if ("EVENT_LISTENER".equals(component)) {
+ sumPositionsEventListener = row.get("sum_position") != null ? row.get("sum_position").toString() : "0";
+ sumLatestKnownPositionEventListener = row.get("sum_latest_known_position") != null ? row.get("sum_latest_known_position").toString() : "0";
+ } else if ("EVENT_INDEXER".equals(component)) {
+ sumPositionsEventIndexer = row.get("sum_position") != null ? row.get("sum_position").toString() : "0";
+ sumLatestKnownPositionEventIndexer = row.get("sum_latest_known_position") != null ? row.get("sum_latest_known_position").toString() : "0";
+ }
+ }
+ }
+
+ // Store variables
+ vars.put("sumPositionsEventListener", sumPositionsEventListener);
+ vars.put("sumPositionsEventIndexer", sumPositionsEventIndexer);
+ vars.put("sumLatestKnownPositionEventListener", sumLatestKnownPositionEventListener);
+ vars.put("sumLatestKnownPositionEventIndexer", sumLatestKnownPositionEventIndexer);
+}
+
+
+ false
+
+
+
+ true
+
+
+ prev.setIgnore();
+ groovy
+
+
+
+
+ groovy
+
+
+ true
+ def getLongValue = { varName ->
+ def value = org.apache.jmeter.threads.JMeterContextService.getContext().getVariables().get(varName)
+ if (value == null) {
+ return 0L
+ }
+ try {
+ return Long.valueOf(value.toString())
+ } catch (Exception e) {
+ return 0L
+ }
+}
+
+def eventLogCount = getLongValue("eventLogCount")
+def publishedEventCount = getLongValue("publishedEvents")
+def notLinked = getLongValue("notLinked")
+def sumPositionsEventListener = getLongValue("sumPositionsEventListener")
+def sumPositionsEventIndexer = getLongValue("sumPositionsEventIndexer")
+def sumLatestKnownPositionEventListener = getLongValue("sumLatestKnownPositionEventListener")
+def sumLatestKnownPositionEventIndexer = getLongValue("sumLatestKnownPositionEventIndexer")
+
+if (vars.get("lastMetricsCollectionTime") != null) {
+ def lastMetricsCollectionTime = getLongValue("lastMetricsCollectionTime")
+ def timeDiff = (System.currentTimeMillis() - lastMetricsCollectionTime) / 1000
+ def prevEventLogCount = getLongValue("prevEventLogCount")
+ def prevPublishedEventCount = getLongValue("prevPublishedEventCount")
+
+ if (timeDiff > 0) {
+ def eventLogTps = (eventLogCount - prevEventLogCount) / timeDiff
+ def publishedEventTps = (publishedEventCount - prevPublishedEventCount) / timeDiff
+ log.info("eventLogTps: " + String.format("%.2f", eventLogTps) + ", publishedEventTps: " + String.format("%.2f", publishedEventTps))
+ }
+}
+
+def customMetricsFile = new File(vars.get("resultDir") + "/custom-metrics.csv")
+customMetricsFile.append(System.currentTimeMillis() + "," + eventLogCount + "," + publishedEventCount + "," + notLinked + "," + sumPositionsEventListener + "," + sumLatestKnownPositionEventListener + "," + sumPositionsEventIndexer + "," + sumLatestKnownPositionEventIndexer + "\n")
+
+vars.put("lastMetricsCollectionTime", System.currentTimeMillis().toString())
+println("eventLogCount: " + eventLogCount + ", publishedEventCount: " + publishedEventCount + ", notLinked:" + notLinked)
+println("sumPositionsEventListener: " + sumPositionsEventListener + ", sumLatestKnownPositionEventListener: " + sumLatestKnownPositionEventListener)
+println("sumPositionsEventIndexer: " + sumPositionsEventIndexer + ", sumLatestKnownPositionEventIndexer: " + sumLatestKnownPositionEventIndexer)
+
+
+
+ true
+
+
+ prev.setIgnore();
+ groovy
+
+
+
+ ${metricsIntervalInMs}
+
+
+
+
+ ${__groovy((org.apache.jmeter.threads.JMeterContextService.getThreadCounts().activeThreads == 1 && vars.getIteration() > 1),)}
+ false
+ true
+
+
+
+ 2
+ 0
+ 0
+
+
+
+
+
+
+
diff --git a/hearing-performance-test/src/test/jmeter/user.properties b/hearing-performance-test/src/test/jmeter/user.properties
new file mode 100644
index 000000000..2c307182f
--- /dev/null
+++ b/hearing-performance-test/src/test/jmeter/user.properties
@@ -0,0 +1 @@
+sample_variables=eventLogCount,publishedEventCount,sumPositionsEventListener,sumPositionsEventIndexer,sumLatestKnownPositionEventListener,sumLatestKnownPositionEventIndexer
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 618bc0010..dad6deffd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,10 +37,11 @@
5.7
2.0.0
0.2.0
- 17.104.46
+ 17.104.48
17.0.116
5.2.1.RELEASE
17.0.96
+ 3.8.0
**/uk/gov/moj/cpp/hearing/nows/events/**/*,
@@ -103,6 +104,7 @@
hearing-event-sources
hearing-common
hearing-healthchecks
+ hearing-performance-test