diff --git a/build.gradle b/build.gradle index 58441bc2132..343af77cd03 100644 --- a/build.gradle +++ b/build.gradle @@ -370,7 +370,7 @@ configurations.all { dependencies { - implementation 'com.github.hmcts:civil-commons:1.0.36' + implementation 'com.github.hmcts:civil-commons:1.0.39' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-aop' diff --git a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/CreateSDOCallbackHandler.java b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/CreateSDOCallbackHandler.java index cf3dc0e9baa..ee8ca623266 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/CreateSDOCallbackHandler.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/CreateSDOCallbackHandler.java @@ -705,7 +705,7 @@ private void updateDeductionValue(CaseData caseData, CaseData.CaseDataBuilder updatedData, RequestedCourt preferredCourt) { - List locations = locationRefDataService.getCourtLocationsForDefaultJudgments( + List locations = locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder( callbackParams.getParams().get(BEARER_TOKEN).toString() ); Optional matchingLocation = Optional.ofNullable(preferredCourt) diff --git a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/GenerateDirectionOrderCallbackHandler.java b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/GenerateDirectionOrderCallbackHandler.java index 91e5960c66b..afaf9470d83 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/GenerateDirectionOrderCallbackHandler.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/GenerateDirectionOrderCallbackHandler.java @@ -160,7 +160,7 @@ private CallbackResponse populateFormValues(CallbackParams callbackParams) { String authToken = callbackParams.getParams().get(BEARER_TOKEN).toString(); List locations = (locationRefDataService - .getCourtLocationsForDefaultJudgments(authToken)); + .getHearingCourtLocationsForJudgeFinalOrder(authToken)); caseDataBuilder = populateFields(caseDataBuilder, locations, caseData, authToken); } else { caseDataBuilder = populateFreeFormFields(caseDataBuilder); diff --git a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/CreateSDOCallbackHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/CreateSDOCallbackHandlerTest.java index c94f7ae8b96..bcf321495fa 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/CreateSDOCallbackHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/CreateSDOCallbackHandlerTest.java @@ -152,7 +152,7 @@ public class CreateSDOCallbackHandlerTest extends BaseCallbackHandlerTest { class AboutToStartCallback extends LocationRefSampleDataBuilder { @BeforeEach void setup() { - given(locationRefDataService.getCourtLocationsForDefaultJudgments(any())) + given(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(any())) .willReturn(getSampleCourLocationsRefObject()); when(deadlinesCalculator.plusWorkingDays(LocalDate.now(), 5)) .thenReturn(LocalDate.now().plusDays(5)); @@ -173,7 +173,7 @@ void shouldPopulateLocationListsWithPreselectedCourt() { LocationRefData.builder().epimmsId("00003").courtLocationCode("00003") .siteName("court 3").courtAddress("3 address").postcode("Y03 7RB").build() ); - when(locationRefDataService.getCourtLocationsForDefaultJudgments(anyString())).thenReturn(locations); + when(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(anyString())).thenReturn(locations); when(categoryService.findCategoryByCategoryIdAndServiceId(any(), any(), any())).thenReturn(Optional.of(categorySearchResult)); CaseData caseData = CaseDataBuilder.builder().atStateClaimDraft() @@ -761,7 +761,7 @@ class MidEventDisposalHearingLocationRefDataCallback extends LocationRefSampleDa @Test void shouldPrePopulateDisposalHearingPage() { CaseData caseData = CaseDataBuilder.builder().atStateClaimDraft().build(); - given(locationRefDataService.getCourtLocationsForDefaultJudgments(any())) + given(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(any())) .willReturn(getSampleCourLocationsRefObject()); when(deadlinesCalculator.plusWorkingDays(LocalDate.now(), 5)) .thenReturn(LocalDate.now().plusDays(5)); @@ -794,7 +794,7 @@ void shouldPrePopulateDisposalHearingPageSpec1() { .caseAccessCategory(SPEC_CLAIM) .totalClaimAmount(BigDecimal.valueOf(10000)) .build(); - given(locationRefDataService.getCourtLocationsForDefaultJudgments(any())) + given(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(any())) .willReturn(getSampleCourLocationsRefObject()); when(deadlinesCalculator.plusWorkingDays(LocalDate.now(), 5)) .thenReturn(LocalDate.now().plusDays(5)); @@ -833,7 +833,7 @@ void shouldPrePopulateDisposalHearingPageSpec2() { ) .build()) .build(); - given(locationRefDataService.getCourtLocationsForDefaultJudgments(any())) + given(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(any())) .willReturn(getSampleCourLocationsRefObject()); when(deadlinesCalculator.plusWorkingDays(LocalDate.now(), 5)) .thenReturn(LocalDate.now().plusDays(5)); @@ -878,7 +878,7 @@ void shouldPrePopulateDisposalHearingPageSpec3() { ).build() ).build(); - given(locationRefDataService.getCourtLocationsForDefaultJudgments(any())) + given(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(any())) .willReturn(getSampleCourLocationsRefObject()); when(deadlinesCalculator.plusWorkingDays(LocalDate.now(), 5)) .thenReturn(LocalDate.now().plusDays(5)); @@ -1092,7 +1092,7 @@ void shouldPrePopulateOrderDetailsPages() { .atStateClaimDraft() .totalClaimAmount(BigDecimal.valueOf(15000)) .applicant1DQWithLocation().build(); - given(locationRefDataService.getCourtLocationsForDefaultJudgments(any())) + given(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(any())) .willReturn(getSampleCourLocationsRefObjectToSort()); Category category = Category.builder().categoryKey("HearingChannel").key("INTER").valueEn("In Person").activeFlag("Y").build(); CategorySearchResult categorySearchResult = CategorySearchResult.builder().categories(List.of(category)).build(); @@ -1591,7 +1591,7 @@ void testSDOSortsLocationListThroughOrganisationPartyType() { .individualLastName("Richards") .partyName("Mr. Alex Richards") .build()).build(); - given(locationRefDataService.getCourtLocationsForDefaultJudgments(any())) + given(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(any())) .willReturn(getSampleCourLocationsRefObjectToSort()); CallbackParams params = callbackParamsOf(caseData, ABOUT_TO_START); @@ -1612,7 +1612,7 @@ void testSDOSortsLocationListThroughOrganisationPartyType() { @Test void testSDOSortsLocationListThroughDecideDamagesOrderType() { - given(locationRefDataService.getCourtLocationsForDefaultJudgments(any())) + given(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(any())) .willReturn(getSampleCourLocationsRefObjectToSort()); CaseData caseData = CaseDataBuilder.builder().respondent1DQWithLocation().applicant1DQWithLocation() .setClaimTypeToSpecClaim().atStateClaimDraft() diff --git a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/GenerateDirectionOrderCallbackHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/GenerateDirectionOrderCallbackHandlerTest.java index 9891b5f8586..12e87ce1b4c 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/GenerateDirectionOrderCallbackHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/GenerateDirectionOrderCallbackHandlerTest.java @@ -235,7 +235,7 @@ void shouldPopulateFields_whenIsCalledAfterSdo() { .finalOrderSelection(FinalOrderSelection.ASSISTED_ORDER).build(); List locations = new ArrayList<>(); locations.add(LocationRefData.builder().courtName("Court Name").region("Region").build()); - when(locationRefDataService.getCourtLocationsForDefaultJudgments(any())).thenReturn(locations); + when(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(any())).thenReturn(locations); CallbackParams params = callbackParamsOf(caseData, MID, PAGE_ID); String advancedDate = LocalDate.now().plusDays(14).toString(); when(locationHelper.getHearingLocation(any(), any(), any())).thenReturn(locationRefDataAfterSdo); @@ -324,7 +324,7 @@ void shouldPopulateFields_whenIsCalledAfterSdoDiffSol() { .finalOrderSelection(FinalOrderSelection.ASSISTED_ORDER).build(); List locations = new ArrayList<>(); locations.add(LocationRefData.builder().courtName("Court Name").region("Region").build()); - when(locationRefDataService.getCourtLocationsForDefaultJudgments(any())).thenReturn(locations); + when(locationRefDataService.getHearingCourtLocationsForJudgeFinalOrder(any())).thenReturn(locations); CallbackParams params = callbackParamsOf(caseData, MID, PAGE_ID); String advancedDate = LocalDate.now().plusDays(14).toString(); when(locationHelper.getHearingLocation(any(), any(), any())).thenReturn(locationRefDataAfterSdo);