Skip to content
Open
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
a13b7ec
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 10, 2026
517385b
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 10, 2026
fdb25ce
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 11, 2026
a54afe2
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 11, 2026
473b3c1
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 11, 2026
0e64dca
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 11, 2026
e330e9f
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 11, 2026
feb61dc
Branch was auto-updated.
github-actions[bot] Feb 13, 2026
ef03f60
Branch was auto-updated.
github-actions[bot] Feb 13, 2026
2be0280
Branch was auto-updated.
github-actions[bot] Feb 13, 2026
e23110f
Branch was auto-updated.
github-actions[bot] Feb 13, 2026
78a9f1b
Branch was auto-updated.
github-actions[bot] Feb 13, 2026
9661e38
Branch was auto-updated.
github-actions[bot] Feb 13, 2026
14336a8
Branch was auto-updated.
github-actions[bot] Feb 13, 2026
a05ddf6
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 13, 2026
b3ab0a6
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 13, 2026
f18a095
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 13, 2026
70c8787
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 13, 2026
5a5486b
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 13, 2026
b9ba838
DTSRD-5695- Add a column in teh court venue table
SabinaHMCTS Feb 13, 2026
50201f4
Update application-integration.yml
SabinaHMCTS Feb 19, 2026
3c9ab02
Update application-integration.yml
SabinaHMCTS Feb 19, 2026
5cf4050
DTSRD-5695- Add a column in the court venue table
SabinaHMCTS Mar 5, 2026
ed34764
DTSRD-5695- Add a column in the court venue table
SabinaHMCTS Mar 5, 2026
8c1fcc8
DTSRD-5695- Add a column in the court venue table
SabinaHMCTS Mar 5, 2026
952e34d
Branch was auto-updated.
github-actions[bot] Mar 9, 2026
6dce340
Branch was auto-updated.
github-actions[bot] Mar 9, 2026
ecd329f
Branch was auto-updated.
github-actions[bot] Mar 10, 2026
29e5dfb
Branch was auto-updated.
github-actions[bot] Mar 12, 2026
6fc783e
Branch was auto-updated.
github-actions[bot] Mar 12, 2026
20ee7e9
Branch was auto-updated.
github-actions[bot] Mar 12, 2026
04bdc72
Branch was auto-updated.
github-actions[bot] Mar 12, 2026
47f9944
Branch was auto-updated.
github-actions[bot] Mar 12, 2026
2fed585
Branch was auto-updated.
github-actions[bot] Mar 12, 2026
1ee84b5
Branch was auto-updated.
github-actions[bot] Mar 13, 2026
da779a4
Branch was auto-updated.
github-actions[bot] Mar 13, 2026
306db00
Branch was auto-updated.
github-actions[bot] Mar 13, 2026
aebec37
Branch was auto-updated.
github-actions[bot] Mar 13, 2026
f5abf42
Branch was auto-updated.
github-actions[bot] Mar 13, 2026
29d89c5
Branch was auto-updated.
github-actions[bot] Mar 13, 2026
e3c0f4f
Branch was auto-updated.
github-actions[bot] Mar 13, 2026
e9411cd
Branch was auto-updated.
github-actions[bot] Mar 24, 2026
ef3d3dc
Branch was auto-updated.
github-actions[bot] Mar 25, 2026
324e981
DTSRD-5695- Add a column in the court venue table
SabinaHMCTS Apr 2, 2026
59f0676
Branch was auto-updated.
github-actions[bot] Apr 13, 2026
466a861
Branch was auto-updated.
github-actions[bot] Apr 21, 2026
11b5035
Branch was auto-updated.
github-actions[bot] Apr 27, 2026
2c64ed2
Branch was auto-updated.
github-actions[bot] May 11, 2026
3aff333
Branch was auto-updated.
github-actions[bot] May 12, 2026
dbc286b
Branch was auto-updated.
github-actions[bot] May 12, 2026
f0dc769
Branch was auto-updated.
github-actions[bot] May 13, 2026
9d42a8e
fixed review comments
May 18, 2026
7339785
fixed review comments
May 18, 2026
f926474
fixed review comments
May 19, 2026
9a11927
fixed review comments
May 19, 2026
862cf4c
Branch was auto-updated.
github-actions[bot] May 19, 2026
be29914
fixed review comments and aligning scripts with location ref api
May 19, 2026
552d50b
fixed review comments and aligning scripts with location ref api
May 20, 2026
769c18c
fixed review comments and aligning scripts with location ref api
May 20, 2026
ed591f3
fixed review comments and aligning scripts with location ref api
May 20, 2026
ea59121
fixed review comments and aligning scripts with location ref api
May 20, 2026
8860fb0
fixed review comments and aligning scripts with location ref api
May 21, 2026
1c5dbaf
fixed review comments and aligning scripts with location ref api
May 21, 2026
5ea4508
fixed review comments and aligning scripts with location ref api
May 21, 2026
dd98f33
fixed review comments and aligning scripts with location ref api
May 21, 2026
617cf2b
fixed review comments and aligning scripts with location ref api
May 21, 2026
2ffef3f
fixed review comments and aligning scripts with location ref api
May 21, 2026
4cc5ae1
fixed review comments and aligning scripts with location ref api
May 21, 2026
dbba5ee
fixed review comments removing incorrect schema name
May 22, 2026
6108cf0
Branch was auto-updated.
github-actions[bot] May 27, 2026
8a60cd4
Branch was auto-updated.
github-actions[bot] Jun 3, 2026
25fbe19
Branch was auto-updated.
github-actions[bot] Jun 3, 2026
d5282a0
Branch was auto-updated.
github-actions[bot] Jun 11, 2026
4752cd1
Branch was auto-updated.
github-actions[bot] Jul 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
import static uk.gov.hmcts.reform.locationrefdata.camel.constants.LrdDataLoadConstants.INVALID_EPIMS_ID;
import static uk.gov.hmcts.reform.locationrefdata.camel.constants.LrdDataLoadConstants.REGION_ID;
import static uk.gov.hmcts.reform.locationrefdata.camel.constants.LrdDataLoadConstants.REGION_ID_NOT_EXISTS;
import static uk.gov.hmcts.reform.locationrefdata.camel.constants.LrdDataLoadConstants.SERVICE_CODE;
import static uk.gov.hmcts.reform.locationrefdata.camel.constants.LrdDataLoadConstants.SERVICE_CODE_NOT_EXISTS;

@TestPropertySource(properties = "spring.config.location=classpath:application-integration.yml")
@CamelSpringBootTest
Expand Down Expand Up @@ -100,6 +102,38 @@ void testTaskletSuccessWelshExternal() throws Exception {
testCourtVenueWelshExternalShortName();
}

@Test
@Sql(scripts = {"/testData/truncate-lrd-court-venue.sql", "/testData/insert-building-location.sql"})
void testTaskletSuccessServiceCode() throws Exception {
Comment thread
mattnayler marked this conversation as resolved.
testCourtVenueServiceCode();
}

private void testCourtVenueServiceCode() throws Exception {
lrdBlobSupport.uploadFile(
UPLOAD_COURT_FILE_NAME,
new FileInputStream(getFile(
"classpath:sourceFiles/courtVenues/court-venue-test-service_code.csv"))
);
jobLauncherTestUtils.launchJob();
//Validate Success Result
validateLrdCourtVenueFile(jdbcTemplate, lrdCourtVenueSelectData, List.of(
CourtVenue.builder().epimmsId("123456").siteName("B Tribunal Hearing Centre")
.courtName("B TRIBUNAL HEARING CENTRE").courtStatus("Open").regionId("7").courtTypeId("17")
.openForPublic("Yes").courtAddress("AB1,48 COURT STREET,LONDON").postcode("AB12 3AB")
.phoneNumber("").closedDate(null).courtLocationCode("").dxAddress("").welshSiteName("")
.welshCourtAddress("").venueName("").isCaseManagementLocation("").isHearingLocation("")
.welshVenueName("testVenue1").isTemporaryLocation("N").isNightingaleCourt("N").locationType("Court")
.parentLocation("366559").welshCourtName("testWelshCourtName").uprn("uprn123")
.venueOuCode("venueOuCode1").mrdBuildingLocationId("mrdBId1")
.mrdVenueId("mrdVenueId1").serviceUrl("serviceUrl1").factUrl("factUrl1")
.mrdDeletedTime("2022-04-01 02:00:03")
.externalShortName("External Short Name")
.welshExternalShortName("Welsh External Short Name").serviceCode("AAA1").build()
), 1);
//Validates Success Audit
validateLrdServiceFileAudit(jdbcTemplate, auditSchedulerQuery, "Success", UPLOAD_COURT_FILE_NAME);
}

private void testCourtVenueInsertion() throws Exception {
lrdBlobSupport.uploadFile(
UPLOAD_COURT_FILE_NAME,
Expand Down Expand Up @@ -192,7 +226,7 @@ private void testCourtVenueWelshExternalShortName() throws Exception {
.mrdVenueId("mrdVenueId1").serviceUrl("serviceUrl1").factUrl("factUrl1")
.mrdDeletedTime("2022-04-01 02:00:03")
.externalShortName("External Short Name")
.welshExternalShortName("Welsh External Short Name").build()
.welshExternalShortName("Welsh External Short Name").serviceCode("AAA1").build()
), 1);
//Validates Success Audit
validateLrdServiceFileAudit(jdbcTemplate, auditSchedulerQuery, "Success", UPLOAD_COURT_FILE_NAME);
Expand Down Expand Up @@ -348,6 +382,40 @@ void testTasklet_NonexistentEpimmsId_PartialSuccess() throws Exception {
COURT_VENUE_TABLE_NAME, quartet);
}

@Test
@Sql(scripts = {"/testData/truncate-lrd-court-venue.sql", "/testData/insert-building-location.sql"})
void testTasklet_NonexistentServiceCode_PartialSuccess() throws Exception {
lrdBlobSupport.uploadFile(
UPLOAD_COURT_FILE_NAME,
new FileInputStream(getFile(
"classpath:sourceFiles/courtVenues/court-venue-test-partial-success-non-existent-service-code.csv"))
);

jobLauncherTestUtils.launchJob();
//Validate Success Result
validateLrdCourtVenueFile(jdbcTemplate, lrdCourtVenueSelectData, List.of(
CourtVenue.builder().epimmsId("123456").siteName("A Tribunal Hearing Centre")
.courtName("A TRIBUNAL HEARING CENTRE").courtStatus("Open").regionId("7").courtTypeId("17")
.openForPublic("Yes").courtAddress("AB1,48 COURT STREET,LONDON").postcode("AB12 3AB")
.phoneNumber("").closedDate(null).courtLocationCode("").dxAddress("").welshSiteName("")
.welshCourtAddress("").venueName("").isCaseManagementLocation("").isHearingLocation("")
.welshVenueName("testVenue1").isTemporaryLocation("N").isNightingaleCourt("N")
.locationType("Court").parentLocation("366559").welshCourtName("testWelshCourtName")
.uprn("uprn123").venueOuCode("venueOuCode1").mrdBuildingLocationId("mrdBId1")
.mrdVenueId("mrdVenueId1").serviceUrl("serviceUrl1").factUrl("factUrl1")
.mrdCreatedTime("2022-04-01 02:00:01").mrdUpdatedTime("2022-04-01 02:00:02")
.mrdDeletedTime("2022-04-01 02:00:03").externalShortName("External Short Name")
.welshExternalShortName("Welsh External Short Name")
.serviceCode("AAA1").build()
), 1);
//Validates Success Audit
validateLrdServiceFileAudit(jdbcTemplate, auditSchedulerQuery, "PartialSuccess", UPLOAD_COURT_FILE_NAME);
Quartet<String, String, String, Long> quartet =
with(SERVICE_CODE, SERVICE_CODE_NOT_EXISTS, "123456", 3L);
validateLrdServiceFileJsrException(jdbcTemplate, orderedExceptionQuery, 3,
COURT_VENUE_TABLE_NAME, quartet);
}

@Test
@Sql(scripts = {"/testData/truncate-lrd-court-venue.sql", "/testData/insert-building-location.sql"})
void testTaskletFailure() throws Exception {
Expand Down
11 changes: 6 additions & 5 deletions src/functionalTest/resources/application-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ route:
sql:INSERT INTO court_venue (epimms_id, site_name, court_name, court_status, court_open_date, region_id, court_type_id, cluster_id, open_for_public,
court_address, postcode, phone_number, closed_date, court_location_code, dx_address, welsh_site_name, welsh_court_address, venue_name, is_case_management_location,
is_hearing_location, welsh_venue_name, is_temporary_location, is_nightingale_court, location_type, parent_location, welsh_court_name, uprn,
venue_ou_code, mrd_building_location_id, mrd_venue_id, service_url, fact_url, mrd_created_time, mrd_updated_time, mrd_deleted_time, external_short_name, welsh_external_short_name, created_time, updated_time)
venue_ou_code, mrd_building_location_id, mrd_venue_id, service_url, fact_url, mrd_created_time, mrd_updated_time, mrd_deleted_time, external_short_name, welsh_external_short_name,service_code, created_time, updated_time)
VALUES (:#epimms_id, :#site_name, :#court_name, :#court_status, TO_DATE(NULLIF(:#court_open_date,''), 'dd/MM/yyyy'), :#region_id, :#court_type_id,
:#cluster_id, :#open_for_public::boolean, :#court_address, :#postcode, :#phone_number, TO_DATE(NULLIF(:#closed_date,''), 'dd/MM/yyyy'),
:#court_location_code, :#dx_address, :#welsh_site_name, :#welsh_court_address, :#venue_name, :#is_case_management_location,
:#is_hearing_location, :#welsh_venue_name, :#is_temporary_location, :#is_nightingale_court, :#location_type, :#parent_location,
:#welsh_court_name, :#uprn, :#venue_ou_code, :#mrd_building_location_id, :#mrd_venue_id, :#service_url, :#fact_url,
:#mrd_created_time, :#mrd_updated_time, :#mrd_deleted_time, :#external_short_name, :#welsh_external_short_name, NOW() AT TIME ZONE 'utc', NOW() AT TIME ZONE 'utc')
ON CONFLICT (epimms_id,court_type_id) do update set epimms_id = :#epimms_id, site_name = :#site_name, court_name = :#court_name,
:#mrd_created_time, :#mrd_updated_time, :#mrd_deleted_time, :#external_short_name, :#welsh_external_short_name,:#service_code, NOW() AT TIME ZONE 'utc', NOW() AT TIME ZONE 'utc')
ON CONFLICT (epimms_id,service_code) do update set epimms_id = :#epimms_id, site_name = :#site_name, court_name = :#court_name,
court_status = :#court_status, court_open_date = TO_DATE(NULLIF(:#court_open_date,''), 'dd/MM/yyyy'),
region_id = :#region_id, court_type_id = :#court_type_id, cluster_id = :#cluster_id, open_for_public = :#open_for_public::boolean, court_address = :#court_address,
postcode = :#postcode, phone_number = :#phone_number, closed_date = TO_DATE(NULLIF(:#closed_date,''), 'dd/MM/yyyy'),
Expand All @@ -109,13 +109,13 @@ route:
welsh_court_name = :#welsh_court_name, uprn = :#uprn, venue_ou_code = :#venue_ou_code, mrd_building_location_id = :#mrd_building_location_id,
mrd_venue_id = :#mrd_venue_id, service_url = :#service_url, fact_url = :#fact_url,
mrd_created_time = :#mrd_created_time, mrd_updated_time = :#mrd_updated_time, mrd_deleted_time = :#mrd_deleted_time,
external_short_name = :#external_short_name, welsh_external_short_name = :#welsh_external_short_name,updated_time = NOW() AT TIME ZONE 'utc'?dataSource=#dataSource
external_short_name = :#external_short_name, welsh_external_short_name = :#welsh_external_short_name, service_code = :#service_code, updated_time = NOW() AT TIME ZONE 'utc'?dataSource=#dataSource
blob-path:
azure-storage-blob://${azure.storage.account-name}/lrd-ref-data?credentials=#credsreg&operation=uploadBlockBlob&blobName=court-venue-test.csv
processor-class: courtVenueProcessor
mapper-class: courtVenueMapper
csv-binder-object: courtVenue
csv-headers-expected: ePIMS_ID,Site_Name,Court_Name,Court_Status,Court_Open_Date,Region_ID,Court_Type_ID,Cluster_ID,Open_For_Public,Court_Address,Postcode,Phone_Number,Closed_Date,Court_Location_Code,Dx_Address,Welsh_Site_Name,Welsh_Court_Address,Venue_Name,Is_Case_Management_Location,Is_Hearing_Location,Welsh_Venue_Name,Is_Temporary_Location,Is_Nightingale_Court,Location_Type,Parent_Location,Welsh_Court_Name,UPRN,Venue_OU_Code,MRD_Building_Location_ID,MRD_Venue_ID,Service_URL,FACT_URL,MRD_Created_Time,MRD_Updated_Time,MRD_Deleted_Time,External_Short_Name,Welsh_External_Short_Name
csv-headers-expected: ePIMS_ID,Site_Name,Court_Name,Court_Status,Court_Open_Date,Region_ID,Court_Type_ID,Cluster_ID,Open_For_Public,Court_Address,Postcode,Phone_Number,Closed_Date,Court_Location_Code,Dx_Address,Welsh_Site_Name,Welsh_Court_Address,Venue_Name,Is_Case_Management_Location,Is_Hearing_Location,Welsh_Venue_Name,Is_Temporary_Location,Is_Nightingale_Court,Location_Type,Parent_Location,Welsh_Court_Name,UPRN,Venue_OU_Code,MRD_Building_Location_ID,MRD_Venue_ID,Service_URL,FACT_URL,MRD_Created_Time,MRD_Updated_Time,MRD_Deleted_Time,External_Short_Name,Welsh_External_Short_Name,ServiceID
header-validation-enabled: true

lrd-building-location-select-query: SELECT * FROM building_location
Expand All @@ -134,6 +134,7 @@ region-query: SELECT region_id FROM region
cluster-query: SELECT cluster_id FROM cluster
epimms-id-query: SELECT epimms_id FROM building_location
court-type-id-query: SELECT court_type_id FROM court_type
service-code-query: SELECT service_code FROM service

truncate-audit: TRUNCATE dataload_schedular_audit

Expand Down
Loading