From d90543cac196b4b03246d2c08503c02e1559ec47 Mon Sep 17 00:00:00 2001 From: Nilay Date: Mon, 9 Dec 2024 08:54:00 +0000 Subject: [PATCH 1/2] SSCSCI-1214 (#4124) * exposing endpoint to access port of entry enum from commons from frontend * exposing endpoint to access country of residence enum from commons from frontend * exposing endpoint to access country of residence enum from commons from frontend * exposing endpoint to access country of residence enum from commons from frontend * pointing to new sscs-common release and fixing checkstyle issues * pointing to frontend pr * undoing test update * allowing for iba via github label * fixing and making adding another ingress for iba so no reliance on github label * moving exposed endpoints for country of residence and port of entry to citizen for more security * renamed endpoints * reverting preview sya pointing * Update build.gradle * SSCSCI-1047: New PR pointing at new version of SSCS Commons library * SSCSCI-1128: Setting up manage case create for ibca * SSCSCI-1128: Update definition file for - ibca reference - point of entry NOTE: using dev snapshot of sscs commons * SSCSCI-1128: Alter callback logic and add mid event * SSCSCI-1128: Update port of entry label * SSCSCI-1128: remove logging line * SSCSCI-1128: Update port of entry label for exui tab * SSCSCI-1128: Update to events to allow ibca cases to progress * SSCSCI-1128: Update commons version * SSCSCI-1128: Point at latest commons * SSCSCI-1128: Update functional test to avoid ibc role check * SSCSCI-1128: Fix ibca file name * SSCSCI-1128: Update mid event to ensure validation only happens for ibca cases * SSCSCI-1128: Address issues/comments * SSCSCI-1128: Resolve issues after commons upgrade * SSCSCI-1128: Bring fixed list element codes in line * SSCSCI-1128: Remove method as redundant due to update to address sscs commons * SSCSCI-1128: Add unit tests * SSCSCI-1128: Update tabs and other show conditions for ibca cases * SSCSCI-1128: Turn IBA toggle off * SSCSCI-1128: Pull in changes from SSCSCI-969 PR (https://github.com/hmcts/sscs-tribunals-case-api/pull/4080/files) * SSCSCI-1128: Turn off infected blood toggle * SSCSCI-1128: Updates to show conditions, tabs and callback handlers * SSCSCI-1128: Update entry in ibc roles * SSCSCI-1128: Update case fields brought in line with create case * SSCSCI-1128: Action dev review comments * SSCSCI-1128: Revert enabling of iba toggle * SSCSCI-1128: Reintroduce fields for mainland uk, ibca ref etc * SSCSCI-1128: Point preview bulk scan api at preview instance * SSCSCI-1128: Point to bulk scan pr in event config * SSCSCI-1128: Bring changes in line after change to infectedBloodCompensation in commons * SSCSCI-1128: Update show conditions for identity in update case event * common isIbca function * updating get rpc to take ibc cases into account * allowing autofill of port of entry list on updateToCaseData if port of entry is selected in create case, but code not inputted * dont setup ports of entry if it already exists in case data with a value * removing multi-class imports * pointing back to master and slight changes * fix * fix * re-adding code from rebase * sonar fixes * sonar fixes * slight name change * fixes after master merge * replacing instances of isIba for isIbc * fix star import * Update build.gradle --------- Co-authored-by: Tom Elliott Co-authored-by: Tom Elliott --- build.gradle | 3 +- ...unalsHearingsEventTopicListenerItTest.java | 16 +++- ...alsHearingsEventTopicListenerV2ItTest.java | 16 +++- .../CaseUpdatedAboutToStartHandler.java | 25 ++++-- .../CaseUpdatedAboutToSubmitHandler.java | 35 +++++++-- .../sscs/domain/wrapper/SyaBenefitType.java | 6 ++ .../handlers/RoboticsCallbackHandler.java | 16 +++- .../mapping/HearingsLocationMapping.java | 8 +- .../sscs/service/SubmitAppealServiceBase.java | 13 ++-- .../service/admin/RestoreCasesService2.java | 2 +- ...itYourAppealToCcdCaseDataDeserializer.java | 32 ++++---- ...edCaseUpdatedAboutToSubmitHandlerTest.java | 14 ++-- .../CaseUpdatedAboutToStartHandlerTest.java | 78 +++++++++++++++++-- .../CreateCaseAboutToSubmitHandlerTest.java | 2 +- .../controller/CitizenControllerTest.java | 8 +- .../handlers/RoboticsCallbackHandlerTest.java | 5 +- .../service/BulkPrintServiceTest.java | 2 +- .../mapping/HearingsDetailsMappingTest.java | 4 +- .../AbstractSubmitAppealServiceTest.java | 11 +-- .../hmcts/reform/sscs/util/SscsUtilTest.java | 78 +++++++++---------- 20 files changed, 259 insertions(+), 115 deletions(-) diff --git a/build.gradle b/build.gradle index 84a5aa0db18..46c4c43a70f 100644 --- a/build.gradle +++ b/build.gradle @@ -355,9 +355,10 @@ dependencies { implementation group: 'com.mchange', name: 'c3p0', version: '0.10.1' implementation group: 'org.flywaydb', name: 'flyway-core', version: '9.22.3' - implementation group: 'com.github.hmcts', name: 'sscs-common', version: '5.12.21' + implementation group: 'com.github.hmcts', name: 'sscs-common', version: '5.12.22' implementation group: 'com.github.hmcts', name: 'sscs-pdf-email-common', version: '5.2.21' + implementation group: 'com.azure', name: 'azure-core', version: '1.46.0' implementation group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.15.1' diff --git a/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventTopicListenerItTest.java b/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventTopicListenerItTest.java index 2ea61d51dda..3bb0d19a824 100644 --- a/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventTopicListenerItTest.java +++ b/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventTopicListenerItTest.java @@ -1,6 +1,7 @@ package uk.gov.hmcts.reform.sscs.jms.listener; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.never; @@ -24,7 +25,18 @@ import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.util.ReflectionTestUtils; -import uk.gov.hmcts.reform.sscs.ccd.domain.*; +import uk.gov.hmcts.reform.sscs.ccd.domain.Adjournment; +import uk.gov.hmcts.reform.sscs.ccd.domain.Appeal; +import uk.gov.hmcts.reform.sscs.ccd.domain.Appellant; +import uk.gov.hmcts.reform.sscs.ccd.domain.BenefitCode; +import uk.gov.hmcts.reform.sscs.ccd.domain.HearingOptions; +import uk.gov.hmcts.reform.sscs.ccd.domain.HearingRoute; +import uk.gov.hmcts.reform.sscs.ccd.domain.Issue; +import uk.gov.hmcts.reform.sscs.ccd.domain.Name; +import uk.gov.hmcts.reform.sscs.ccd.domain.RegionalProcessingCenter; +import uk.gov.hmcts.reform.sscs.ccd.domain.SessionCategory; +import uk.gov.hmcts.reform.sscs.ccd.domain.SscsCaseData; +import uk.gov.hmcts.reform.sscs.ccd.domain.SscsCaseDetails; import uk.gov.hmcts.reform.sscs.ccd.service.UpdateCcdCaseService; import uk.gov.hmcts.reform.sscs.exception.GetCaseException; import uk.gov.hmcts.reform.sscs.exception.TribunalsEventProcessingException; @@ -112,7 +124,7 @@ public void testHearingsUpdateCase() throws UpdateCaseException, TribunalsEventP when(refData.getSessionCategoryMaps()).thenReturn(sessionCategoryMaps); when(refData.getHearingDurations()).thenReturn(hearingDurationsService); when(refData.getRegionalProcessingCenterService()).thenReturn(regionalProcessingCenterService); - when(regionalProcessingCenterService.getByPostcode(any())).thenReturn(RegionalProcessingCenter.builder().hearingRoute( + when(regionalProcessingCenterService.getByPostcode(any(), anyBoolean())).thenReturn(RegionalProcessingCenter.builder().hearingRoute( HearingRoute.LIST_ASSIST).build()); when(refData.getVenueService()).thenReturn(venueService); when(venueService.getActiveRegionalEpimsIdsForRpc(any())).thenReturn(List.of(VenueDetails.builder().epimsId("1").build())); diff --git a/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventTopicListenerV2ItTest.java b/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventTopicListenerV2ItTest.java index 76096cb4d97..47c45fe3c5a 100644 --- a/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventTopicListenerV2ItTest.java +++ b/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventTopicListenerV2ItTest.java @@ -1,6 +1,7 @@ package uk.gov.hmcts.reform.sscs.jms.listener; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.never; @@ -24,7 +25,18 @@ import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.util.ReflectionTestUtils; -import uk.gov.hmcts.reform.sscs.ccd.domain.*; +import uk.gov.hmcts.reform.sscs.ccd.domain.Adjournment; +import uk.gov.hmcts.reform.sscs.ccd.domain.Appeal; +import uk.gov.hmcts.reform.sscs.ccd.domain.Appellant; +import uk.gov.hmcts.reform.sscs.ccd.domain.BenefitCode; +import uk.gov.hmcts.reform.sscs.ccd.domain.HearingOptions; +import uk.gov.hmcts.reform.sscs.ccd.domain.HearingRoute; +import uk.gov.hmcts.reform.sscs.ccd.domain.Issue; +import uk.gov.hmcts.reform.sscs.ccd.domain.Name; +import uk.gov.hmcts.reform.sscs.ccd.domain.RegionalProcessingCenter; +import uk.gov.hmcts.reform.sscs.ccd.domain.SessionCategory; +import uk.gov.hmcts.reform.sscs.ccd.domain.SscsCaseData; +import uk.gov.hmcts.reform.sscs.ccd.domain.SscsCaseDetails; import uk.gov.hmcts.reform.sscs.ccd.service.UpdateCcdCaseService; import uk.gov.hmcts.reform.sscs.exception.GetCaseException; import uk.gov.hmcts.reform.sscs.exception.TribunalsEventProcessingException; @@ -109,7 +121,7 @@ public void testHearingsUpdateCaseV2() throws UpdateCaseException, TribunalsEven when(refData.getSessionCategoryMaps()).thenReturn(sessionCategoryMaps); when(refData.getHearingDurations()).thenReturn(hearingDurationsService); when(refData.getRegionalProcessingCenterService()).thenReturn(regionalProcessingCenterService); - when(regionalProcessingCenterService.getByPostcode(any())).thenReturn(RegionalProcessingCenter.builder().hearingRoute( + when(regionalProcessingCenterService.getByPostcode(any(), anyBoolean())).thenReturn(RegionalProcessingCenter.builder().hearingRoute( HearingRoute.LIST_ASSIST).build()); when(refData.getVenueService()).thenReturn(venueService); when(venueService.getActiveRegionalEpimsIdsForRpc(any())).thenReturn(List.of(VenueDetails.builder().epimsId("1").build())); diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToStartHandler.java b/src/main/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToStartHandler.java index c4f357e0504..2e16a5e9405 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToStartHandler.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToStartHandler.java @@ -13,7 +13,13 @@ import uk.gov.hmcts.reform.sscs.ccd.callback.Callback; import uk.gov.hmcts.reform.sscs.ccd.callback.CallbackType; import uk.gov.hmcts.reform.sscs.ccd.callback.PreSubmitCallbackResponse; -import uk.gov.hmcts.reform.sscs.ccd.domain.*; +import uk.gov.hmcts.reform.sscs.ccd.domain.Appeal; +import uk.gov.hmcts.reform.sscs.ccd.domain.BenefitType; +import uk.gov.hmcts.reform.sscs.ccd.domain.DynamicList; +import uk.gov.hmcts.reform.sscs.ccd.domain.DynamicListItem; +import uk.gov.hmcts.reform.sscs.ccd.domain.EventType; +import uk.gov.hmcts.reform.sscs.ccd.domain.HearingOptions; +import uk.gov.hmcts.reform.sscs.ccd.domain.SscsCaseData; import uk.gov.hmcts.reform.sscs.ccd.presubmit.PreSubmitCallbackHandler; import uk.gov.hmcts.reform.sscs.reference.data.model.Language; import uk.gov.hmcts.reform.sscs.reference.data.service.VerbalLanguagesService; @@ -97,15 +103,18 @@ private void setupBenefitSelection(SscsCaseData sscsCaseData) { } private void setupUkPortsOfEntry(SscsCaseData sscsCaseData) { - final DynamicList ukPortOfEntries = SscsUtil.getPortsOfEntry(); - String portOfEntryCode = sscsCaseData.getAppeal().getAppellant().getAddress().getPortOfEntry(); + DynamicList portOfEntryDynamicList = sscsCaseData.getAppeal().getAppellant().getAddress().getUkPortOfEntryList(); + if (portOfEntryDynamicList == null || portOfEntryDynamicList.getValue() == null) { + final DynamicList ukPortOfEntries = SscsUtil.getPortsOfEntry(); + String portOfEntryCode = sscsCaseData.getAppeal().getAppellant().getAddress().getPortOfEntry(); + + if (isNotEmpty(portOfEntryCode)) { + DynamicListItem selectedPortOfEntry = getSelectedDynamicListItem(ukPortOfEntries.getListItems(), portOfEntryCode); + ukPortOfEntries.setValue(selectedPortOfEntry); + } - if (isNotEmpty(portOfEntryCode)) { - DynamicListItem selectedPortOfEntry = getSelectedDynamicListItem(ukPortOfEntries.getListItems(), portOfEntryCode); - ukPortOfEntries.setValue(selectedPortOfEntry); + sscsCaseData.getAppeal().getAppellant().getAddress().setUkPortOfEntryList(ukPortOfEntries); } - - sscsCaseData.getAppeal().getAppellant().getAddress().setUkPortOfEntryList(ukPortOfEntries); } private DynamicListItem getSelectedDynamicListItem(List listItems, String code) { diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToSubmitHandler.java b/src/main/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToSubmitHandler.java index a967e353184..d15c6e96c13 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToSubmitHandler.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToSubmitHandler.java @@ -1,7 +1,8 @@ package uk.gov.hmcts.reform.sscs.ccd.presubmit.caseupdated; -import static java.util.Objects.*; +import static java.util.Objects.isNull; import static java.util.Objects.nonNull; +import static java.util.Objects.requireNonNull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isEmpty; import static org.apache.commons.lang3.StringUtils.isNotBlank; @@ -10,14 +11,18 @@ import static uk.gov.hmcts.reform.sscs.ccd.domain.YesNo.YES; import static uk.gov.hmcts.reform.sscs.ccd.domain.YesNo.isYes; import static uk.gov.hmcts.reform.sscs.helper.SscsHelper.validateHearingOptionsAndExcludeDates; -import static uk.gov.hmcts.reform.sscs.idam.UserRole.*; import static uk.gov.hmcts.reform.sscs.idam.UserRole.SUPER_USER; +import static uk.gov.hmcts.reform.sscs.idam.UserRole.SYSTEM_USER; import static uk.gov.hmcts.reform.sscs.model.AppConstants.IBCA_BENEFIT_CODE; import static uk.gov.hmcts.reform.sscs.util.OtherPartyDataUtil.isConfidential; import static uk.gov.hmcts.reform.sscs.util.SscsUtil.handleBenefitType; import static uk.gov.hmcts.reform.sscs.util.SscsUtil.handleIbcaCase; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.Optional; import java.util.stream.Collectors; import javax.validation.ConstraintValidatorContext; import lombok.extern.slf4j.Slf4j; @@ -27,7 +32,27 @@ import uk.gov.hmcts.reform.sscs.ccd.callback.Callback; import uk.gov.hmcts.reform.sscs.ccd.callback.CallbackType; import uk.gov.hmcts.reform.sscs.ccd.callback.PreSubmitCallbackResponse; -import uk.gov.hmcts.reform.sscs.ccd.domain.*; +import uk.gov.hmcts.reform.sscs.ccd.domain.Address; +import uk.gov.hmcts.reform.sscs.ccd.domain.Appeal; +import uk.gov.hmcts.reform.sscs.ccd.domain.Appellant; +import uk.gov.hmcts.reform.sscs.ccd.domain.Appointee; +import uk.gov.hmcts.reform.sscs.ccd.domain.Benefit; +import uk.gov.hmcts.reform.sscs.ccd.domain.BenefitType; +import uk.gov.hmcts.reform.sscs.ccd.domain.CaseDetails; +import uk.gov.hmcts.reform.sscs.ccd.domain.CaseManagementLocation; +import uk.gov.hmcts.reform.sscs.ccd.domain.DynamicList; +import uk.gov.hmcts.reform.sscs.ccd.domain.DynamicListItem; +import uk.gov.hmcts.reform.sscs.ccd.domain.Entity; +import uk.gov.hmcts.reform.sscs.ccd.domain.EventType; +import uk.gov.hmcts.reform.sscs.ccd.domain.HearingOptions; +import uk.gov.hmcts.reform.sscs.ccd.domain.HearingType; +import uk.gov.hmcts.reform.sscs.ccd.domain.JointParty; +import uk.gov.hmcts.reform.sscs.ccd.domain.MrnDetails; +import uk.gov.hmcts.reform.sscs.ccd.domain.RegionalProcessingCenter; +import uk.gov.hmcts.reform.sscs.ccd.domain.Representative; +import uk.gov.hmcts.reform.sscs.ccd.domain.SscsCaseData; +import uk.gov.hmcts.reform.sscs.ccd.domain.SscsType; +import uk.gov.hmcts.reform.sscs.ccd.domain.YesNo; import uk.gov.hmcts.reform.sscs.ccd.presubmit.AssociatedCaseLinkHelper; import uk.gov.hmcts.reform.sscs.ccd.presubmit.PreSubmitCallbackHandler; import uk.gov.hmcts.reform.sscs.ccd.presubmit.ResponseEventsAboutToSubmit; @@ -141,7 +166,7 @@ public PreSubmitCallbackResponse handle(CallbackType callbackType, || isNotBlank(appellant.getAddress().getPortOfEntry()))) { String postCode = resolvePostCode(sscsCaseData); - RegionalProcessingCenter newRpc = regionalProcessingCenterService.getByPostcode(postCode); + RegionalProcessingCenter newRpc = regionalProcessingCenterService.getByPostcode(postCode, sscsCaseData.isIbcCase()); maybeChangeIsScottish(sscsCaseData.getRegionalProcessingCenter(), newRpc, sscsCaseData); diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/domain/wrapper/SyaBenefitType.java b/src/main/java/uk/gov/hmcts/reform/sscs/domain/wrapper/SyaBenefitType.java index 05ba4023093..2844ad0dd60 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/domain/wrapper/SyaBenefitType.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/domain/wrapper/SyaBenefitType.java @@ -1,5 +1,7 @@ package uk.gov.hmcts.reform.sscs.domain.wrapper; +import uk.gov.hmcts.reform.sscs.ccd.domain.Benefit; + public class SyaBenefitType { private String description; @@ -38,4 +40,8 @@ public String toString() { + ", code='" + code + '\'' + '}'; } + + public boolean isIbc() { + return code.equals(Benefit.INFECTED_BLOOD_COMPENSATION.getShortName()); + } } diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/evidenceshare/callback/handlers/RoboticsCallbackHandler.java b/src/main/java/uk/gov/hmcts/reform/sscs/evidenceshare/callback/handlers/RoboticsCallbackHandler.java index 761a3a7c769..fb565110686 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/evidenceshare/callback/handlers/RoboticsCallbackHandler.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/evidenceshare/callback/handlers/RoboticsCallbackHandler.java @@ -2,7 +2,13 @@ import static java.util.Objects.requireNonNull; import static org.apache.commons.lang3.StringUtils.equalsIgnoreCase; -import static uk.gov.hmcts.reform.sscs.ccd.domain.EventType.*; +import static uk.gov.hmcts.reform.sscs.ccd.domain.EventType.APPEAL_TO_PROCEED; +import static uk.gov.hmcts.reform.sscs.ccd.domain.EventType.CASE_UPDATED; +import static uk.gov.hmcts.reform.sscs.ccd.domain.EventType.DWP_RAISE_EXCEPTION; +import static uk.gov.hmcts.reform.sscs.ccd.domain.EventType.INTERLOC_VALID_APPEAL; +import static uk.gov.hmcts.reform.sscs.ccd.domain.EventType.NOT_LISTABLE; +import static uk.gov.hmcts.reform.sscs.ccd.domain.EventType.RESEND_CASE_TO_GAPS2; +import static uk.gov.hmcts.reform.sscs.ccd.domain.EventType.VALID_APPEAL_CREATED; import java.time.LocalDate; import java.time.LocalDateTime; @@ -15,7 +21,11 @@ import uk.gov.hmcts.reform.sscs.ccd.callback.Callback; import uk.gov.hmcts.reform.sscs.ccd.callback.CallbackType; import uk.gov.hmcts.reform.sscs.ccd.callback.DispatchPriority; -import uk.gov.hmcts.reform.sscs.ccd.domain.*; +import uk.gov.hmcts.reform.sscs.ccd.domain.EventType; +import uk.gov.hmcts.reform.sscs.ccd.domain.HearingRoute; +import uk.gov.hmcts.reform.sscs.ccd.domain.RegionalProcessingCenter; +import uk.gov.hmcts.reform.sscs.ccd.domain.SscsCaseData; +import uk.gov.hmcts.reform.sscs.ccd.domain.SscsCaseDetails; import uk.gov.hmcts.reform.sscs.ccd.service.CcdService; import uk.gov.hmcts.reform.sscs.ccd.service.UpdateCcdCaseService; import uk.gov.hmcts.reform.sscs.evidenceshare.service.RoboticsService; @@ -161,7 +171,7 @@ private void updateRpc(final SscsCaseData sscsCaseData) { // Updating the RPC also done on CASE_UPDATED in tribunals-api. // We should update the case details before sending robotics. if (sscsCaseData.getAppeal().getAppellant() != null && sscsCaseData.getAppeal().getAppellant().getAddress() != null && sscsCaseData.getAppeal().getAppellant().getAddress().getPostcode() != null) { - RegionalProcessingCenter rpc = regionalProcessingCenterService.getByPostcode(sscsCaseData.getAppeal().getAppellant().getAddress().getPostcode()); + RegionalProcessingCenter rpc = regionalProcessingCenterService.getByPostcode(sscsCaseData.getAppeal().getAppellant().getAddress().getPostcode(), sscsCaseData.isIbcCase()); sscsCaseData.setRegionalProcessingCenter(rpc); if (rpc != null) { diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/helper/mapping/HearingsLocationMapping.java b/src/main/java/uk/gov/hmcts/reform/sscs/helper/mapping/HearingsLocationMapping.java index 320dc6635b7..82456f2ad2a 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/helper/mapping/HearingsLocationMapping.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/helper/mapping/HearingsLocationMapping.java @@ -78,7 +78,7 @@ private static List getOverrideLocations(SscsCaseData caseData) private static List getPaperCaseLocations(SscsCaseData caseData, ReferenceDataServiceHolder refData) throws ListingException { if (HearingChannelUtil.isPaperCase(caseData)) { RegionalProcessingCenter rpc = caseData.getRegionalProcessingCenter(); - validatedRpc(rpc, refData); + validatedRpc(rpc, refData, caseData.isIbcCase()); List venueDetailsList = refData .getVenueService() @@ -99,11 +99,11 @@ private static List getPaperCaseLocations(SscsCaseData caseData return Collections.emptyList(); } - private static void validatedRpc(RegionalProcessingCenter regionalProcessingCenter, ReferenceDataServiceHolder refData) throws ListingException { + private static void validatedRpc(RegionalProcessingCenter regionalProcessingCenter, ReferenceDataServiceHolder refData, boolean isIbca) throws ListingException { if (nonNull(regionalProcessingCenter)) { String regionalProcessingCenterPostCode = regionalProcessingCenter.getPostcode(); RegionalProcessingCenterService regionalProcessingCenterService = refData.getRegionalProcessingCenterService(); - RegionalProcessingCenter processingCenterByPostCode = regionalProcessingCenterService.getByPostcode(regionalProcessingCenterPostCode); + RegionalProcessingCenter processingCenterByPostCode = regionalProcessingCenterService.getByPostcode(regionalProcessingCenterPostCode, isIbca); log.info("rpc by postcode {}", processingCenterByPostCode); @@ -124,7 +124,7 @@ private static List getAdjournedLocations(SscsCaseData caseData VenueService venueService = refData.getVenueService(); if (PAPER.equals(adjournment.getTypeOfNextHearing())) { RegionalProcessingCenter rpc = caseData.getRegionalProcessingCenter(); - validatedRpc(rpc, refData); + validatedRpc(rpc, refData, caseData.isIbcCase()); List paperVenues = venueService.getActiveRegionalEpimsIdsForRpc(rpc.getEpimsId()); diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/service/SubmitAppealServiceBase.java b/src/main/java/uk/gov/hmcts/reform/sscs/service/SubmitAppealServiceBase.java index 2fae8ef7816..052f10c7d06 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/service/SubmitAppealServiceBase.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/service/SubmitAppealServiceBase.java @@ -24,7 +24,6 @@ import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; import uk.gov.hmcts.reform.sscs.ccd.domain.Appeal; -import uk.gov.hmcts.reform.sscs.ccd.domain.Benefit; import uk.gov.hmcts.reform.sscs.ccd.domain.CaseLink; import uk.gov.hmcts.reform.sscs.ccd.domain.CaseLinkDetails; import uk.gov.hmcts.reform.sscs.ccd.domain.CaseManagementLocation; @@ -150,9 +149,9 @@ public Long submitAppeal(SyaCaseWrapper appeal, String userToken) { } SscsCaseData convertAppealToSscsCaseData(SyaCaseWrapper appeal) { - boolean isIba = appeal.getBenefitType().getCode().equals(Benefit.INFECTED_BLOOD_COMPENSATION.getShortName()); - String postCode = resolvePostCode(appeal, isIba); - RegionalProcessingCenter rpc = regionalProcessingCenterService.getByPostcode(isIba ? postCode : getFirstHalfOfPostcode(postCode)); + boolean isIbc = appeal.getBenefitType().isIbc(); + String postCode = resolvePostCode(appeal, isIbc); + RegionalProcessingCenter rpc = regionalProcessingCenterService.getByPostcode(isIbc ? postCode : getFirstHalfOfPostcode(postCode), isIbc); SscsCaseData sscsCaseData = rpc == null ? convertSyaToCcdCaseDataV1(appeal, caseAccessManagementFeature) @@ -177,7 +176,7 @@ SscsCaseData convertAppealToSscsCaseData(SyaCaseWrapper appeal) { } log.info("{} - setting venue name to {}", - isIba + isIbc ? sscsCaseData.getAppeal().getAppellant().getIdentity().getIbcaReference() : maskNino(sscsCaseData.getAppeal().getAppellant().getIdentity().getNino()), sscsCaseData.getProcessingVenue()); @@ -308,9 +307,9 @@ private void associateCase(IdamTokens idamTokens, } } - private String resolvePostCode(SyaCaseWrapper appeal, boolean isIba) { + private String resolvePostCode(SyaCaseWrapper appeal, boolean isIbc) { Boolean inMainlandUk = appeal.getContactDetails().getInMainlandUk(); - if (isIba && inMainlandUk != null && inMainlandUk.equals(Boolean.FALSE)) { + if (isIbc && inMainlandUk != null && inMainlandUk.equals(Boolean.FALSE)) { return appeal.getAppellant().getContactDetails().getPortOfEntry(); } else if (Boolean.TRUE.equals(appeal.getIsAppointee())) { return Optional.ofNullable(appeal.getAppointee()) diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/service/admin/RestoreCasesService2.java b/src/main/java/uk/gov/hmcts/reform/sscs/service/admin/RestoreCasesService2.java index 45c6b18e4c1..35a63249756 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/service/admin/RestoreCasesService2.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/service/admin/RestoreCasesService2.java @@ -159,7 +159,7 @@ private void restoreData(SscsCaseDetails sscsCaseDetails) { String postCode = sscsCaseData.getAppeal().getAppellant().getAddress().getPostcode(); String firstHalfOfPostcode = getFirstHalfOfPostcode(postCode); - RegionalProcessingCenter rpc = regionalProcessingCenterService.getByPostcode(firstHalfOfPostcode); + RegionalProcessingCenter rpc = regionalProcessingCenterService.getByPostcode(firstHalfOfPostcode, sscsCaseData.isIbcCase()); if (rpc != null) { sscsCaseData.setRegion(rpc.getName()); diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/transform/deserialize/SubmitYourAppealToCcdCaseDataDeserializer.java b/src/main/java/uk/gov/hmcts/reform/sscs/transform/deserialize/SubmitYourAppealToCcdCaseDataDeserializer.java index 60fd4aa6707..d674919b75d 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/transform/deserialize/SubmitYourAppealToCcdCaseDataDeserializer.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/transform/deserialize/SubmitYourAppealToCcdCaseDataDeserializer.java @@ -186,10 +186,10 @@ private static Subscriptions getSubscriptions(SyaCaseWrapper syaCaseWrapper) { } private static Appeal getAppeal(SyaCaseWrapper syaCaseWrapper) { - boolean isIba = syaCaseWrapper.getBenefitType().getCode().equals(Benefit.INFECTED_BLOOD_COMPENSATION.getShortName()); - MrnDetails mrnDetails = getMrnDetails(syaCaseWrapper, isIba); + boolean isIbc = syaCaseWrapper.getBenefitType().isIbc(); + MrnDetails mrnDetails = getMrnDetails(syaCaseWrapper, isIbc); - Appellant appellant = getAppellant(syaCaseWrapper, isIba); + Appellant appellant = getAppellant(syaCaseWrapper, isIbc); BenefitType benefitType = BenefitType.builder() .code(syaCaseWrapper.getBenefitType().getCode()) @@ -200,7 +200,7 @@ private static Appeal getAppeal(SyaCaseWrapper syaCaseWrapper) { AppealReasons appealReasons = getReasonsForAppealing(syaCaseWrapper.getReasonsForAppealing()); - Representative representative = getRepresentative(syaCaseWrapper, isIba); + Representative representative = getRepresentative(syaCaseWrapper, isIbc); HearingSubtype hearingSubtype = getHearingSubType(syaCaseWrapper.getSyaHearingOptions()); @@ -226,11 +226,11 @@ private static String getHearingType(HearingOptions hearingOptions) { HearingType.PAPER.getValue(); } - private static MrnDetails getMrnDetails(SyaCaseWrapper syaCaseWrapper, boolean isIba) { + private static MrnDetails getMrnDetails(SyaCaseWrapper syaCaseWrapper, boolean isIbc) { MrnDetails.MrnDetailsBuilder builder = MrnDetails.builder() .mrnDate(getMrnDate(syaCaseWrapper)) .mrnLateReason(getReasonForBeingLate(syaCaseWrapper)); - if (!isIba) { + if (!isIbc) { builder .dwpIssuingOffice(getDwpIssuingOffice(syaCaseWrapper)) .mrnMissingReason(getReasonForNoMrn(syaCaseWrapper)); @@ -286,12 +286,12 @@ private static String getMrnDate(SyaCaseWrapper syaCaseWrapper) { null; } - private static Address handleAddress(SyaContactDetails contactDetails, boolean isIba, String party) { + private static Address handleAddress(SyaContactDetails contactDetails, boolean isIbc, String party) { Address.AddressBuilder addressBuilder = Address.builder() .line1(contactDetails.getAddressLine1()) .line2(contactDetails.getAddressLine2()) .town(contactDetails.getTownCity()); - if (isIba && contactDetails.getInMainlandUk() != null) { + if (isIbc && contactDetails.getInMainlandUk() != null) { YesNo inMainlandUkYesNo = contactDetails.getInMainlandUk().equals(Boolean.TRUE) ? YesNo.YES : YesNo.NO; addressBuilder.inMainlandUk(inMainlandUkYesNo); if (inMainlandUkYesNo.equals(YesNo.NO)) { @@ -315,7 +315,7 @@ private static Address handleAddress(SyaContactDetails contactDetails, boolean i return addressBuilder.build(); } - private static Appellant getAppellant(SyaCaseWrapper syaCaseWrapper, boolean isIba) { + private static Appellant getAppellant(SyaCaseWrapper syaCaseWrapper, boolean isIbc) { SyaAppellant syaAppellant = syaCaseWrapper.getAppellant(); @@ -323,7 +323,7 @@ private static Appellant getAppellant(SyaCaseWrapper syaCaseWrapper, boolean isI Address address = null; Contact contact; if (null != contactDetails) { - address = handleAddress(contactDetails, isIba, "appellant"); + address = handleAddress(contactDetails, isIbc, "appellant"); contact = Contact.builder() .email(contactDetails.getEmailAddress()) .mobile(getPhoneNumberWithOutSpaces(contactDetails.getPhoneNumber())) @@ -331,7 +331,7 @@ private static Appellant getAppellant(SyaCaseWrapper syaCaseWrapper, boolean isI } else { contact = Contact.builder().build(); } - Identity identity = buildAppellantIdentity(syaAppellant, isIba); + Identity identity = buildAppellantIdentity(syaAppellant, isIbc); String isAppointee = buildAppellantIsAppointee(syaCaseWrapper); @@ -366,18 +366,18 @@ private static Appellant getAppellant(SyaCaseWrapper syaCaseWrapper, boolean isI .isAppointee(isAppointee) .appointee(appointee) .isAddressSameAsAppointee(useSameAddress); - if (syaAppellant != null && syaAppellant.getIbcRole() != null && isIba) { + if (syaAppellant != null && syaAppellant.getIbcRole() != null && isIbc) { builder.ibcRole(syaAppellant.getIbcRole()); } return builder.build(); } - private static Identity buildAppellantIdentity(SyaAppellant syaAppellant, boolean isIba) { + private static Identity buildAppellantIdentity(SyaAppellant syaAppellant, boolean isIbc) { Identity identity = Identity.builder().build(); if (null != syaAppellant) { Identity.IdentityBuilder builder = identity.toBuilder() .dob(syaAppellant.getDob() == null ? null : syaAppellant.getDob().toString()); - if (isIba) { + if (isIbc) { builder.ibcaReference(syaAppellant.getIbcaReference()); } else { builder.nino(syaAppellant.getNino()); @@ -720,7 +720,7 @@ private static String getNotificationSmsNumber(SyaSmsNotify smsNotify, SyaContac : contactDetails.getPhoneNumber(); } - private static Representative getRepresentative(SyaCaseWrapper syaCaseWrapper, boolean isIba) { + private static Representative getRepresentative(SyaCaseWrapper syaCaseWrapper, boolean isIbc) { if (syaCaseWrapper.getHasRepresentative() != null) { if (syaCaseWrapper.getHasRepresentative()) { @@ -742,7 +742,7 @@ private static Representative getRepresentative(SyaCaseWrapper syaCaseWrapper, b .build(); SyaContactDetails contactDetails = syaRepresentative.getContactDetails(); - Address address = handleAddress(contactDetails, isIba, "representative"); + Address address = handleAddress(contactDetails, isIbc, "representative"); Contact contact = Contact.builder() .email(syaRepresentative.getContactDetails().getEmailAddress()) diff --git a/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/AbstractedCaseUpdatedAboutToSubmitHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/AbstractedCaseUpdatedAboutToSubmitHandlerTest.java index 988fa10ffe4..9be649d3e73 100644 --- a/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/AbstractedCaseUpdatedAboutToSubmitHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/AbstractedCaseUpdatedAboutToSubmitHandlerTest.java @@ -617,7 +617,7 @@ void givenACaseUpdatedEventWithEmptyJointPartyDetails_thenProvideAnError() { @Test void givenAnAppealWithPostcode_updateRpc() { - when(regionalProcessingCenterService.getByPostcode("CM120NS")).thenReturn(RegionalProcessingCenter.builder().name("Region1").address1("Line1").build()); + when(regionalProcessingCenterService.getByPostcode(eq("CM120NS"), anyBoolean())).thenReturn(RegionalProcessingCenter.builder().name("Region1").address1("Line1").build()); PreSubmitCallbackResponse response = handler.handle(ABOUT_TO_SUBMIT, callback, USER_AUTHORISATION); @@ -706,7 +706,7 @@ void givenChangeInNullRpcChangeIsScottish(String newRpcName, String expected) { @ParameterizedTest @CsvSource({"Birmingham,No", "Glasgow,Yes"}) void givenAnAppealWithPostcode_updateRpcToScottish(String newRpcName, String expectedIsScottish) { - when(regionalProcessingCenterService.getByPostcode("CM120NS")).thenReturn(RegionalProcessingCenter.builder().name(newRpcName).build()); + when(regionalProcessingCenterService.getByPostcode(eq("CM120NS"), anyBoolean())).thenReturn(RegionalProcessingCenter.builder().name(newRpcName).build()); PreSubmitCallbackResponse response = handler.handle(ABOUT_TO_SUBMIT, callback, USER_AUTHORISATION); @@ -718,7 +718,7 @@ void givenAnAppealWithPostcode_updateRpcToScottish(String newRpcName, String exp void givenAnAppealWithNewAppellantPostcodeAndNoAppointee_thenUpdateProcessingVenue() { callback.getCaseDetails().getCaseData().getAppeal().getAppellant().setIsAppointee("No"); - when(regionalProcessingCenterService.getByPostcode("AB12 00B")).thenReturn( + when(regionalProcessingCenterService.getByPostcode(eq("AB12 00B"), anyBoolean())).thenReturn( RegionalProcessingCenter.builder() .name("rpcName") .postcode("rpcPostcode") @@ -744,7 +744,7 @@ void givenAnAppealWithNewAppellantPostcodeAndNoAppointee_thenUpdateProcessingVen @Test void givenAnAppealWithNewAppointeePostcode_thenUpdateProcessingVenueWithAppointeeVenue() { - when(regionalProcessingCenterService.getByPostcode("AB12 00B")).thenReturn( + when(regionalProcessingCenterService.getByPostcode(eq("AB12 00B"), anyBoolean())).thenReturn( RegionalProcessingCenter.builder() .name("rpcName") .postcode("rpcPostcode") @@ -797,7 +797,7 @@ void givenAnAppealWithNullOrEmptyPostcode_thenDoNotUpdateProcessingVenue(String @NullSource @ValueSource(strings = {"", " "}) void givenAnAppealWithNewAppointeeButEmptyPostcode_thenUpdateProcessingVenueWithAppellantVenue(String postCode) { - when(regionalProcessingCenterService.getByPostcode("AB12 00B")).thenReturn( + when(regionalProcessingCenterService.getByPostcode(eq("AB12 00B"), anyBoolean())).thenReturn( RegionalProcessingCenter.builder() .name("rpcName") .postcode("rpcPostcode") @@ -841,7 +841,7 @@ void givenAnAppealWithNewAppointee_thenUpdateRpcWithAppointeeVenue() { .address(Address.builder().line1("Line 1").line2("Line 2").postcode("APP EEE").build()) .build()); - when(regionalProcessingCenterService.getByPostcode("APP EEE")).thenReturn(RegionalProcessingCenter.builder() + when(regionalProcessingCenterService.getByPostcode(eq("APP EEE"), anyBoolean())).thenReturn(RegionalProcessingCenter.builder() .name("AppointeeVenue") .address1("Line1") .build()); @@ -861,7 +861,7 @@ void givenAnAppealWithNoAppointee_thenUpdateRpcWithAppellantVenue() { .address(Address.builder().line1("Line 1").line2("Line 2").postcode("APP_EEE").build()) .build()); - when(regionalProcessingCenterService.getByPostcode("AB1200B")).thenReturn(RegionalProcessingCenter.builder() + when(regionalProcessingCenterService.getByPostcode(eq("AB1200B"), anyBoolean())).thenReturn(RegionalProcessingCenter.builder() .name("AppellantVenue") .address1("Line1") .build()); diff --git a/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToStartHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToStartHandlerTest.java index 7053d313f52..bd9ba6b1466 100644 --- a/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToStartHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/caseupdated/CaseUpdatedAboutToStartHandlerTest.java @@ -21,8 +21,9 @@ import uk.gov.hmcts.reform.sscs.reference.data.model.Language; import uk.gov.hmcts.reform.sscs.reference.data.service.VerbalLanguagesService; import uk.gov.hmcts.reform.sscs.util.DynamicListLanguageUtil; +import uk.gov.hmcts.reform.sscs.util.SscsUtil; -public class CaseUpdatedAboutToStartHandlerTest { +class CaseUpdatedAboutToStartHandlerTest { private static final String USER_AUTHORISATION = "Bearer token"; private SscsCaseData sscsCaseData; @@ -78,7 +79,7 @@ void givenBenefitType_shouldHaveCorrectBenefitSelectionWithInfectedBloodCompensa assertThat(benefitSelection).isNotNull(); assertThat(benefitSelection.getValue()).isNotNull(); assertThat(benefitSelection.getValue().getCode()).isEqualTo("002"); - assertThat(benefitSelection.getListItems().size()).isEqualTo(34); + assertThat(benefitSelection.getListItems()).hasSize(34); } @Test @@ -91,11 +92,76 @@ void givenBenefitType_shouldHaveCorrectBenefitSelectionWithInfectedBloodCompensa assertThat(benefitSelection).isNotNull(); assertThat(benefitSelection.getValue()).isNotNull(); assertThat(benefitSelection.getValue().getCode()).isEqualTo("002"); - assertThat(benefitSelection.getListItems().size()).isEqualTo(35); + assertThat(benefitSelection.getListItems()).hasSize(35); } @Test - public void givenThatOriginalLanguageFieldIsEmpty_thenSetDynamicListInitialValueToNull() { + void givenPortOfEntryValueNotNull_shouldNotSetListUp() { + DynamicList ukPortOfEntries = SscsUtil.getPortsOfEntry(); + ukPortOfEntries.setValue(new DynamicListItem("GBSTTRT00", "Althorpe")); + sscsCaseData.getAppeal().getAppellant().getAddress().setUkPortOfEntryList(ukPortOfEntries); + var result = handler.handle(ABOUT_TO_START, callback, USER_AUTHORISATION); + var portOfEntryList = result.getData().getAppeal().getAppellant().getAddress().getUkPortOfEntryList(); + var portOfEntry = result.getData().getAppeal().getAppellant().getAddress().getUkPortOfEntry(); + var portOfEntryCode = result.getData().getAppeal().getAppellant().getAddress().getPortOfEntry(); + + assertThat(portOfEntry).isNull(); + assertThat(portOfEntryCode).isNull(); + assertThat(portOfEntryList).isNotNull(); + assertThat(portOfEntryList.getValue().getCode()).isEqualTo("GBSTTRT00"); + assertThat(portOfEntryList.getValue().getLabel()).isEqualTo("Althorpe"); + assertThat(portOfEntryList.getListItems()).hasSameSizeAs(ukPortOfEntries.getListItems()); + } + + @Test + void givenPortOfEntryValueNull_shouldSetListUpWithNullValue() { + DynamicList ukPortOfEntries = SscsUtil.getPortsOfEntry(); + sscsCaseData.getAppeal().getAppellant().getAddress().setUkPortOfEntryList(ukPortOfEntries); + var result = handler.handle(ABOUT_TO_START, callback, USER_AUTHORISATION); + var portOfEntryList = result.getData().getAppeal().getAppellant().getAddress().getUkPortOfEntryList(); + var portOfEntry = result.getData().getAppeal().getAppellant().getAddress().getUkPortOfEntry(); + var portOfEntryCode = result.getData().getAppeal().getAppellant().getAddress().getPortOfEntry(); + + assertThat(portOfEntry).isNull(); + assertThat(portOfEntryCode).isNull(); + assertThat(portOfEntryList).isNotNull(); + assertThat(portOfEntryList.getValue()).isNull(); + assertThat(portOfEntryList.getListItems()).hasSize(UkPortOfEntry.values().length); + } + + @Test + void givenPortOfEntryCode_shouldSetListUpWithValueFromCode() { + sscsCaseData.getAppeal().getAppellant().getAddress().setPortOfEntry("GBSTTRT00"); + var result = handler.handle(ABOUT_TO_START, callback, USER_AUTHORISATION); + var portOfEntryList = result.getData().getAppeal().getAppellant().getAddress().getUkPortOfEntryList(); + var portOfEntry = result.getData().getAppeal().getAppellant().getAddress().getUkPortOfEntry(); + var portOfEntryCode = result.getData().getAppeal().getAppellant().getAddress().getPortOfEntry(); + + assertThat(portOfEntry.getLocationCode()).isEqualTo("GBSTTRT00"); + assertThat(portOfEntry.getLabel()).isEqualTo("Althorpe"); + assertThat(portOfEntryCode).isEqualTo("GBSTTRT00"); + assertThat(portOfEntryList).isNotNull(); + assertThat(portOfEntryList.getValue().getCode()).isEqualTo("GBSTTRT00"); + assertThat(portOfEntryList.getValue().getLabel()).isEqualTo("Althorpe"); + assertThat(portOfEntryList.getListItems()).hasSize(UkPortOfEntry.values().length); + } + + @Test + void givenNoPortOfEntryCode_shouldSetListUpWithNullValue() { + var result = handler.handle(ABOUT_TO_START, callback, USER_AUTHORISATION); + var portOfEntryList = result.getData().getAppeal().getAppellant().getAddress().getUkPortOfEntryList(); + var portOfEntry = result.getData().getAppeal().getAppellant().getAddress().getUkPortOfEntry(); + var portOfEntryCode = result.getData().getAppeal().getAppellant().getAddress().getPortOfEntry(); + + assertThat(portOfEntry).isNull(); + assertThat(portOfEntryCode).isNull(); + assertThat(portOfEntryList).isNotNull(); + assertThat(portOfEntryList.getValue()).isNull(); + assertThat(portOfEntryList.getListItems()).hasSize(UkPortOfEntry.values().length); + } + + @Test + void givenThatOriginalLanguageFieldIsEmpty_thenSetDynamicListInitialValueToNull() { sscsCaseData = CaseDataUtils.buildCaseData(); sscsCaseData.getAppeal().getHearingOptions().setLanguages(null); @@ -114,7 +180,7 @@ public void givenThatOriginalLanguageFieldIsEmpty_thenSetDynamicListInitialValue } @Test - public void givenThatOriginalLanguageFieldIsNonEmpty_thenSetDynamicListInitialValue() { + void givenThatOriginalLanguageFieldIsNonEmpty_thenSetDynamicListInitialValue() { sscsCaseData = CaseDataUtils.buildCaseData(); sscsCaseData.getAppeal().getHearingOptions().setLanguages("Welsh"); @@ -135,7 +201,7 @@ public void givenThatOriginalLanguageFieldIsNonEmpty_thenSetDynamicListInitialVa } @Test - public void givenThatOriginalLanguageFieldIsNonEmptyandInvalid_thenSetDynamicListInitialValue() { + void givenThatOriginalLanguageFieldIsNonEmptyandInvalid_thenSetDynamicListInitialValue() { sscsCaseData = CaseDataUtils.buildCaseData(); sscsCaseData.getAppeal().getHearingOptions().setLanguages("Wales"); diff --git a/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/createcase/CreateCaseAboutToSubmitHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/createcase/CreateCaseAboutToSubmitHandlerTest.java index 161e36f8a35..bc67c8eb505 100644 --- a/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/createcase/CreateCaseAboutToSubmitHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/sscs/ccd/presubmit/createcase/CreateCaseAboutToSubmitHandlerTest.java @@ -153,7 +153,7 @@ void shouldCallPdfServiceWhenIbca() throws CcdException { @Test - void isIbaFalseIfNullBenefitType() throws CcdException { + void isIbcFalseIfNullBenefitType() throws CcdException { when(caseDetails.getCaseData()).thenReturn(mockedCaseData); when(mockedCaseData.getCaseCreated()).thenReturn(""); when(mockedCaseData.getCcdCaseId()).thenReturn("1021"); diff --git a/src/test/java/uk/gov/hmcts/reform/sscs/controller/CitizenControllerTest.java b/src/test/java/uk/gov/hmcts/reform/sscs/controller/CitizenControllerTest.java index 013c9e10129..7174140b689 100644 --- a/src/test/java/uk/gov/hmcts/reform/sscs/controller/CitizenControllerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/sscs/controller/CitizenControllerTest.java @@ -161,10 +161,10 @@ public void shouldReturnAllPortOfEntriesWithExpectedFields() { assertFalse(result.isEmpty(), "The result should not be empty"); Map aberdeenEntry = Map.of( - "label", "Aberdeen", "trafficType", "Sea traffic", - "locationCode", "GB000434" - ); + "locationCode", "GBSTABD00", + "label", "Aberdeen" + ); assertTrue(result.contains(aberdeenEntry), "The result should contain the entry for Aberdeen"); @@ -198,7 +198,7 @@ public void shouldReturnAllCountriesOfResidenceWithExpectedFields() { Map jordanEntry = Map.of( "label", "Jordan", - "officialName", "The Hashemite Kingdom of Jordan" + "officialName", "Jordan" ); assertTrue(result.contains(jordanEntry), "The result should contain the entry for Jordan"); diff --git a/src/test/java/uk/gov/hmcts/reform/sscs/evidenceshare/callback/handlers/RoboticsCallbackHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/sscs/evidenceshare/callback/handlers/RoboticsCallbackHandlerTest.java index df6b8122ae0..dcb754c5ede 100644 --- a/src/test/java/uk/gov/hmcts/reform/sscs/evidenceshare/callback/handlers/RoboticsCallbackHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/sscs/evidenceshare/callback/handlers/RoboticsCallbackHandlerTest.java @@ -3,6 +3,7 @@ import static org.junit.Assert.*; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.Mockito.*; import static uk.gov.hmcts.reform.sscs.ccd.callback.CallbackType.SUBMITTED; import static uk.gov.hmcts.reform.sscs.ccd.domain.EventType.CASE_UPDATED; @@ -130,7 +131,7 @@ public void givenARoboticsRequestAndCreatedInGapsMatchesState_thenSendCaseToRobo Appeal appeal = Mockito.mock(Appeal.class); when(appeal.getAppellant()).thenReturn(Appellant.builder().address(Address.builder().postcode("PC1 1AA").build()).build()); caseDetails.getCaseData().setAppeal(appeal); - when(regionalProcessingCenterService.getByPostcode(any())).thenReturn(RegionalProcessingCenter.builder().name("MyRPC").build()); + when(regionalProcessingCenterService.getByPostcode(any(), anyBoolean())).thenReturn(RegionalProcessingCenter.builder().name("MyRPC").build()); Callback callback = new Callback<>(caseDetails, Optional.empty(), eventType, false); handler.handle(SUBMITTED, callback); @@ -264,7 +265,7 @@ public void givenARoboticsRequestFromDwpRaiseExceptionAndStateIsWithDwp_thenSend Appeal appeal = Mockito.mock(Appeal.class); when(appeal.getAppellant()).thenReturn(Appellant.builder().address(Address.builder().postcode("PC1 1AA").build()).build()); caseDetails.getCaseData().setAppeal(appeal); - when(regionalProcessingCenterService.getByPostcode(any())).thenReturn(RegionalProcessingCenter.builder().name("MyRPC").build()); + when(regionalProcessingCenterService.getByPostcode(any(), anyBoolean())).thenReturn(RegionalProcessingCenter.builder().name("MyRPC").build()); Callback callback = new Callback<>(caseDetails, Optional.empty(), EventType.DWP_RAISE_EXCEPTION, false); diff --git a/src/test/java/uk/gov/hmcts/reform/sscs/evidenceshare/service/BulkPrintServiceTest.java b/src/test/java/uk/gov/hmcts/reform/sscs/evidenceshare/service/BulkPrintServiceTest.java index 31ddd46c17e..858ac0620c0 100644 --- a/src/test/java/uk/gov/hmcts/reform/sscs/evidenceshare/service/BulkPrintServiceTest.java +++ b/src/test/java/uk/gov/hmcts/reform/sscs/evidenceshare/service/BulkPrintServiceTest.java @@ -273,7 +273,7 @@ public void shouldSendToBulkPrint_additionalDataInternationalFlagTrue() { .appeal(Appeal.builder().appellant( Appellant.builder() .name(Name.builder().firstName("Appellant").lastName("LastName").build()) - .address(Address.builder().line1("line1").postcode("PH17-26").country("Australia").portOfEntry(UkPortOfEntry.LONDON_GATEWAY_PORT.getLabel()).inMainlandUk(NO).build()) + .address(Address.builder().line1("line1").postcode("PH17-26").country("Australia").portOfEntry(UkPortOfEntry.LONDON_LUTON_AIRPORT.getLabel()).inMainlandUk(NO).build()) .build()) .build()) .build(); diff --git a/src/test/java/uk/gov/hmcts/reform/sscs/helper/mapping/HearingsDetailsMappingTest.java b/src/test/java/uk/gov/hmcts/reform/sscs/helper/mapping/HearingsDetailsMappingTest.java index 307ca57355b..3a4d17d96a3 100644 --- a/src/test/java/uk/gov/hmcts/reform/sscs/helper/mapping/HearingsDetailsMappingTest.java +++ b/src/test/java/uk/gov/hmcts/reform/sscs/helper/mapping/HearingsDetailsMappingTest.java @@ -10,6 +10,8 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.anyBoolean; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.BDDMockito.given; import static uk.gov.hmcts.reform.sscs.ccd.domain.AdjournCaseNextHearingVenue.SAME_VENUE; import static uk.gov.hmcts.reform.sscs.ccd.domain.AdjournCaseNextHearingVenue.SOMEWHERE_ELSE; @@ -328,7 +330,7 @@ void getRegionalHearingLocations_shouldReturnCorrespondingEpimsIdsForVenuesWithS given(venueService.getActiveRegionalEpimsIdsForRpc(caseData.getRegionalProcessingCenter().getEpimsId())) .willReturn(EPIMS_ID_LIST); given(refData.getVenueService()).willReturn(venueService); - given(regionalProcessingCenterService.getByPostcode("LS1 2ED")).willReturn(rpc); + given(regionalProcessingCenterService.getByPostcode(eq("LS1 2ED"), anyBoolean())).willReturn(rpc); List result = HearingsLocationMapping.getHearingLocations(caseData, refData); diff --git a/src/test/java/uk/gov/hmcts/reform/sscs/service/AbstractSubmitAppealServiceTest.java b/src/test/java/uk/gov/hmcts/reform/sscs/service/AbstractSubmitAppealServiceTest.java index 81cf9a668c6..4589086af4a 100644 --- a/src/test/java/uk/gov/hmcts/reform/sscs/service/AbstractSubmitAppealServiceTest.java +++ b/src/test/java/uk/gov/hmcts/reform/sscs/service/AbstractSubmitAppealServiceTest.java @@ -7,6 +7,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyMap; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; @@ -742,7 +743,7 @@ public void shouldThrowExceptionOnGetDraftsWhenCitizenRoleNotPresent() { @Parameters(method = "generateDifferentRpcScenarios") public void givenAppellantPostCode_shouldSetRegionAndRpcCorrectly(String expectedRpc, String appellantPostCode) throws JsonProcessingException { RegionalProcessingCenter rpc = getRpcObjectForGivenJsonRpc(expectedRpc); - when(regionalProcessingCenterService.getByPostcode(RegionalProcessingCenterService.getFirstHalfOfPostcode(appellantPostCode))) + when(regionalProcessingCenterService.getByPostcode(eq(RegionalProcessingCenterService.getFirstHalfOfPostcode(appellantPostCode)), anyBoolean())) .thenReturn(getRpcObjectForGivenJsonRpc(expectedRpc)); when(airLookupService.lookupAirVenueNameByPostCode(eq(appellantPostCode), any())).thenReturn(rpc.getCity()); when(venueService.getEpimsIdForVenue(rpc.getCity())).thenReturn("1234"); @@ -768,7 +769,7 @@ public void givenAppellantPostCode_shouldSetRegionAndRpcCorrectly(String expecte @Parameters(method = "generateDifferentRpcScenariosIba") public void givenAppellantPostCode_shouldSetRegionAndRpcCorrectlyIba(String expectedRpc, String appellantLocationCode) throws JsonProcessingException { RegionalProcessingCenter rpc = getRpcObjectForGivenJsonRpc(expectedRpc); - when(regionalProcessingCenterService.getByPostcode(appellantLocationCode)) + when(regionalProcessingCenterService.getByPostcode(appellantLocationCode, true)) .thenReturn(getRpcObjectForGivenJsonRpc(expectedRpc)); when(airLookupService.lookupAirVenueNameByPostCode(eq(appellantLocationCode), any())).thenReturn(rpc.getCity()); when(venueService.getEpimsIdForVenue(rpc.getCity())).thenReturn("1234"); @@ -792,7 +793,7 @@ public void givenAppellantPostCode_shouldSetRegionAndRpcCorrectlyIba(String expe @Test public void givenAppointeePostCode_shouldSetRegionAndRpcToAppointee() throws JsonProcessingException { - when(regionalProcessingCenterService.getByPostcode("B1")).thenReturn(getRpcObjectForGivenJsonRpc(BIRMINGHAM_RPC)); + when(regionalProcessingCenterService.getByPostcode(eq("B1"), anyBoolean())).thenReturn(getRpcObjectForGivenJsonRpc(BIRMINGHAM_RPC)); when(airLookupService.lookupAirVenueNameByPostCode(eq("B1 1AA"), any())).thenReturn("Birmingham"); when(venueService.getEpimsIdForVenue("Birmingham")).thenReturn("1234"); @@ -823,7 +824,7 @@ public void givenAppointeeWithNoPostCode_shouldSetRegionAndRpcToNull(@Nullable S @Test public void givenAppointeeWithNoContactData_shouldSetRegionAndRpcToAppellant() throws JsonProcessingException { - when(regionalProcessingCenterService.getByPostcode("TN32")).thenReturn(getRpcObjectForGivenJsonRpc(BRADFORD_RPC)); + when(regionalProcessingCenterService.getByPostcode(eq("TN32"), anyBoolean())).thenReturn(getRpcObjectForGivenJsonRpc(BRADFORD_RPC)); when(airLookupService.lookupAirVenueNameByPostCode(eq("TN32 6PL"), any())).thenReturn("Bradford"); when(venueService.getEpimsIdForVenue("Bradford")).thenReturn("1234"); when(refDataService.getCourtVenueRefDataByEpimsId("1234")).thenReturn(CourtVenue.builder().courtStatus("Open").regionId("1").build()); @@ -1079,7 +1080,7 @@ public void getMatchedCases() { }) public void shouldSetProcessingVenueBasedOnBenefitTypeAndPostCode(String benefitCode, String postcode, String expectedVenue, String appellantOrAppointee, String epimsId, String regionId) { String firstHalfOfPostcode = RegionalProcessingCenterService.getFirstHalfOfPostcode(postcode); - when(regionalProcessingCenterService.getByPostcode(firstHalfOfPostcode)).thenReturn( + when(regionalProcessingCenterService.getByPostcode(eq(firstHalfOfPostcode), anyBoolean())).thenReturn( RegionalProcessingCenter.builder() .name("rpcName") .postcode("rpcPostcode") diff --git a/src/test/java/uk/gov/hmcts/reform/sscs/util/SscsUtilTest.java b/src/test/java/uk/gov/hmcts/reform/sscs/util/SscsUtilTest.java index c77a5ba0bb6..fd93924e194 100644 --- a/src/test/java/uk/gov/hmcts/reform/sscs/util/SscsUtilTest.java +++ b/src/test/java/uk/gov/hmcts/reform/sscs/util/SscsUtilTest.java @@ -230,7 +230,7 @@ void givenPostHearingsFlagIsFalseAndCorrectionInProgress_shouldReturnFinalDecisi @Test void givenPostHearingsEnabledFalse_clearPostHearingsFieldClearsDocumentFields_butDoesNotAlterPostHearing() { postHearing.setRequestType(PostHearingRequestType.SET_ASIDE); - SscsCaseData caseData = SscsCaseData.builder() + SscsCaseData sscsCaseData = SscsCaseData.builder() .postHearing(postHearing) .documentGeneration(DocumentGeneration.builder() .generateNotice(YesNo.YES) @@ -240,17 +240,17 @@ void givenPostHearingsEnabledFalse_clearPostHearingsFieldClearsDocumentFields_bu .build()) .build(); - SscsUtil.clearPostHearingFields(caseData, false); + SscsUtil.clearPostHearingFields(sscsCaseData, false); - assertThat(caseData.getPostHearing().getRequestType()).isNotNull(); - assertThat(caseData.getDocumentGeneration().getGenerateNotice()).isNull(); - assertThat(caseData.getDocumentStaging().getDateAdded()).isNull(); + assertThat(sscsCaseData.getPostHearing().getRequestType()).isNotNull(); + assertThat(sscsCaseData.getDocumentGeneration().getGenerateNotice()).isNull(); + assertThat(sscsCaseData.getDocumentStaging().getDateAdded()).isNull(); } @Test void givenPostHearingsEnabledTrue_clearPostHearingsFieldClearsDocumentFields_andClearsPostHearing() { postHearing.setRequestType(PostHearingRequestType.SET_ASIDE); - SscsCaseData caseData = SscsCaseData.builder() + SscsCaseData sscsCaseData = SscsCaseData.builder() .postHearing(postHearing) .documentGeneration(DocumentGeneration.builder() .generateNotice(YesNo.YES) @@ -260,16 +260,16 @@ void givenPostHearingsEnabledTrue_clearPostHearingsFieldClearsDocumentFields_and .build()) .build(); - SscsUtil.clearPostHearingFields(caseData, true); + SscsUtil.clearPostHearingFields(sscsCaseData, true); - assertThat(caseData.getPostHearing().getRequestType()).isNull(); - assertThat(caseData.getDocumentGeneration().getGenerateNotice()).isNull(); - assertThat(caseData.getDocumentStaging().getDateAdded()).isNull(); + assertThat(sscsCaseData.getPostHearing().getRequestType()).isNull(); + assertThat(sscsCaseData.getDocumentGeneration().getGenerateNotice()).isNull(); + assertThat(sscsCaseData.getDocumentStaging().getDateAdded()).isNull(); } @Test void givenPostponement_thenClearPostponementFieldsOn() { - SscsCaseData caseData = SscsCaseData.builder() + SscsCaseData sscsCaseData = SscsCaseData.builder() .postponement(Postponement.builder() .postponementEvent(READY_TO_LIST) .unprocessedPostponement(YesNo.YES) @@ -280,39 +280,39 @@ void givenPostponement_thenClearPostponementFieldsOn() { .build()) .build(); - clearPostponementTransientFields(caseData); - assertNull(caseData.getPostponement().getPostponementEvent()); - assertNull(caseData.getPostponement().getUnprocessedPostponement()); - assertNull(caseData.getPostponementRequest().getUnprocessedPostponementRequest()); - assertNull(caseData.getPostponementRequest().getActionPostponementRequestSelected()); + clearPostponementTransientFields(sscsCaseData); + assertNull(sscsCaseData.getPostponement().getPostponementEvent()); + assertNull(sscsCaseData.getPostponement().getUnprocessedPostponement()); + assertNull(sscsCaseData.getPostponementRequest().getUnprocessedPostponementRequest()); + assertNull(sscsCaseData.getPostponementRequest().getActionPostponementRequestSelected()); } @Test void givenCorrectIssueAndBenefitCode_dontAddErrorToResponse() { - SscsCaseData caseData = SscsCaseData.builder().benefitCode("002").issueCode("DD").build(); - PreSubmitCallbackResponse response = new PreSubmitCallbackResponse<>(caseData); - validateBenefitIssueCode(caseData, response, categoryMapService); + SscsCaseData sscsCaseData = SscsCaseData.builder().benefitCode("002").issueCode("DD").build(); + PreSubmitCallbackResponse response = new PreSubmitCallbackResponse<>(sscsCaseData); + validateBenefitIssueCode(sscsCaseData, response, categoryMapService); assertThat(response.getErrors()).isEmpty(); } @Test void givenWrongIssueAndBenefitCode_addErrorToResponse() { - SscsCaseData caseData = SscsCaseData.builder().benefitCode("002").issueCode("XA").build(); - PreSubmitCallbackResponse response = new PreSubmitCallbackResponse<>(caseData); - validateBenefitIssueCode(caseData, response, categoryMapService); + SscsCaseData sscsCaseData = SscsCaseData.builder().benefitCode("002").issueCode("XA").build(); + PreSubmitCallbackResponse response = new PreSubmitCallbackResponse<>(sscsCaseData); + validateBenefitIssueCode(sscsCaseData, response, categoryMapService); - assertThat(response.getErrors().size()).isEqualTo(1); + assertThat(response.getErrors()).hasSize(1); assertThat(response.getErrors()).contains(INVALID_BENEFIT_ISSUE_CODE); } @Test void givenLegacyBenefitCode_addErrorToResponse() { - SscsCaseData caseData = SscsCaseData.builder().benefitCode("032").issueCode("CR").build(); - PreSubmitCallbackResponse response = new PreSubmitCallbackResponse<>(caseData); - validateBenefitIssueCode(caseData, response, categoryMapService); + SscsCaseData sscsCaseData = SscsCaseData.builder().benefitCode("032").issueCode("CR").build(); + PreSubmitCallbackResponse response = new PreSubmitCallbackResponse<>(sscsCaseData); + validateBenefitIssueCode(sscsCaseData, response, categoryMapService); - assertThat(response.getErrors().size()).isEqualTo(1); + assertThat(response.getErrors()).hasSize(1); assertThat(response.getErrors()).contains(BENEFIT_CODE_NOT_IN_USE); } @@ -512,7 +512,7 @@ void shouldReturnPortsOfEntry() { final DynamicList portsOfEntry = getPortsOfEntry(); assertThat(portsOfEntry.getValue()).isNull(); - assertThat(portsOfEntry.getListItems()).hasSize(90); + assertThat(portsOfEntry.getListItems()).hasSize(269); } @@ -533,7 +533,7 @@ void shouldReturnNullPortOfEntryFromInvalidCode() { @Test void shouldPopulateIbcaFieldsOnHandleIbcaCase() { - final SscsCaseData caseData = SscsCaseData.builder() + final SscsCaseData sscsCaseData = SscsCaseData.builder() .appeal(Appeal.builder() .mrnDetails(MrnDetails.builder().build()) .hearingOptions(HearingOptions.builder().build()) @@ -542,11 +542,11 @@ void shouldPopulateIbcaFieldsOnHandleIbcaCase() { .regionalProcessingCenter(RegionalProcessingCenter.builder().build()) .build(); - handleIbcaCase(caseData); + handleIbcaCase(sscsCaseData); - assertThat(caseData.getAppeal().getHearingOptions().getHearingRoute()).isEqualTo(LIST_ASSIST); - assertThat(caseData.getAppeal().getMrnDetails().getDwpIssuingOffice()).isEqualTo("IBCA"); - assertThat(caseData.getRegionalProcessingCenter().getHearingRoute()).isEqualTo(LIST_ASSIST); + assertThat(sscsCaseData.getAppeal().getHearingOptions().getHearingRoute()).isEqualTo(LIST_ASSIST); + assertThat(sscsCaseData.getAppeal().getMrnDetails().getDwpIssuingOffice()).isEqualTo("IBCA"); + assertThat(sscsCaseData.getRegionalProcessingCenter().getHearingRoute()).isEqualTo(LIST_ASSIST); } @Test @@ -569,15 +569,15 @@ void shouldGenerateUniqueIbcaId() { @Test void shouldReturnTrueWhenIsIbcaCase() { - final SscsCaseData caseData = SscsCaseData.builder() + final SscsCaseData sscsCaseData = SscsCaseData.builder() .benefitCode("093") .appeal(Appeal.builder() .benefitType(BenefitType.builder() .descriptionSelection( new DynamicList( new DynamicListItem( - "infectedBloodAppeal", - "infectedBloodAppeal" + "infectedBloodCompensation", + "infectedBloodCompensation" ), emptyList() ) @@ -587,12 +587,12 @@ void shouldReturnTrueWhenIsIbcaCase() { .build() ) .build(); - assertTrue(caseData.isIbcCase()); + assertTrue(sscsCaseData.isIbcCase()); } @Test void shouldReturnFalseWhenNotIbcaCase() { - final SscsCaseData caseData = SscsCaseData.builder() + final SscsCaseData sscsCaseData = SscsCaseData.builder() .benefitCode("037") .appeal(Appeal.builder() .benefitType(BenefitType.builder() @@ -610,6 +610,6 @@ void shouldReturnFalseWhenNotIbcaCase() { .build() ) .build(); - assertFalse(caseData.isIbcCase()); + assertFalse(sscsCaseData.isIbcCase()); } } From 81cd360b1989e53570e3cb1d6eb1d8921485f37c Mon Sep 17 00:00:00 2001 From: Nilay Date: Mon, 9 Dec 2024 09:03:38 +0000 Subject: [PATCH 2/2] updating suppressions (#4214) --- config/owasp/suppressions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/owasp/suppressions.xml b/config/owasp/suppressions.xml index 16a2e3ee08e..de36862bfee 100644 --- a/config/owasp/suppressions.xml +++ b/config/owasp/suppressions.xml @@ -1,6 +1,6 @@ - + CVE-2023-39017 CVE-2024-38820