Skip to content

Commit

Permalink
CIV-15310 - update Hearing list for dashboard notification
Browse files Browse the repository at this point in the history
  • Loading branch information
m-meulendijks-v1 authored and ss-evoco committed Nov 12, 2024
1 parent d3a4632 commit 7a057a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class HearingScheduledClaimantNotificationHandler extends CallbackHandler
private final HearingFeesService hearingFeesService;

@Override
protected Map<String, Callback> callbacks() {
protected Map<String, Callback> callbacks() {
return toggleService.isCaseProgressionEnabled()
? Map.of(callbackKey(ABOUT_TO_SUBMIT), this::configureScenarioForHearingScheduled)
: Map.of(callbackKey(ABOUT_TO_SUBMIT), this::emptyCallbackResponse);
Expand All @@ -80,7 +80,7 @@ private CallbackResponse configureScenarioForHearingScheduled(CallbackParams cal
CaseData caseData = callbackParams.getCaseData();
String authToken = callbackParams.getParams().get(BEARER_TOKEN).toString();
List<LocationRefData> locations = (locationRefDataService
.getCourtLocationsForDefaultJudgments(authToken));
.getHearingCourtLocations(authToken));
LocationRefData locationRefData = fillPreferredLocationData(locations, caseData.getHearingLocation());
if (nonNull(locationRefData)) {
caseData = caseData.toBuilder().hearingLocationCourtName(locationRefData.getSiteName()).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private CallbackResponse configureScenarioForHearingScheduled(CallbackParams cal
CaseData caseData = callbackParams.getCaseData();
String authToken = callbackParams.getParams().get(BEARER_TOKEN).toString();
List<LocationRefData> locations = (locationRefDataService
.getCourtLocationsForDefaultJudgments(authToken));
.getHearingCourtLocations(authToken));
LocationRefData locationRefData = fillPreferredLocationData(locations, caseData.getHearingLocation());
if (nonNull(locationRefData)) {
caseData = caseData.toBuilder().hearingLocationCourtName(locationRefData.getSiteName()).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void createDashboardNotifications() {
locations.add(LocationRefData.builder().siteName("Name").courtAddress("Loc").postcode("1").build());
when(dashboardNotificationsParamsMapper.mapCaseDataToParams(any())).thenReturn(params);
when(featureToggleService.isCaseProgressionEnabled()).thenReturn(true);
when(locationRefDataService.getCourtLocationsForDefaultJudgments(any())).thenReturn(locations);
when(locationRefDataService.getHearingCourtLocations(any())).thenReturn(locations);

DynamicListElement location = DynamicListElement.builder().label("Name - Loc - 1").build();
DynamicList list = DynamicList.builder().value(location).listItems(List.of(location)).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void createDashboardNotifications() {
locations.add(LocationRefData.builder().siteName("Name").courtAddress("Loc").postcode("1").build());
when(dashboardNotificationsParamsMapper.mapCaseDataToParams(any())).thenReturn(params);
when(featureToggleService.isCaseProgressionEnabled()).thenReturn(true);
when(locationRefDataService.getCourtLocationsForDefaultJudgments(any())).thenReturn(locations);
when(locationRefDataService.getHearingCourtLocations(any())).thenReturn(locations);

DynamicListElement location = DynamicListElement.builder().label("Name - Loc - 1").build();
DynamicList list = DynamicList.builder().value(location).listItems(List.of(location)).build();
Expand Down Expand Up @@ -120,7 +120,7 @@ void doNotCreateDashboardNotifications() {
List<LocationRefData> locations = new ArrayList<>();
locations.add(LocationRefData.builder().siteName("Name").courtAddress("Loc").postcode("1").build());
when(featureToggleService.isCaseProgressionEnabled()).thenReturn(true);
when(locationRefDataService.getCourtLocationsForDefaultJudgments(any())).thenReturn(locations);
when(locationRefDataService.getHearingCourtLocations(any())).thenReturn(locations);

DynamicListElement location = DynamicListElement.builder().label("Name - Loc - 1").build();
DynamicList list = DynamicList.builder().value(location).listItems(List.of(location)).build();
Expand Down

0 comments on commit 7a057a1

Please sign in to comment.