From d172fce2cc98c4cec64532f4ba68c297cfc4f3a3 Mon Sep 17 00:00:00 2001 From: ThomasKKC <99262639+ThomasKKC@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:00:47 +0100 Subject: [PATCH] RIA-Task Fix Sonar scan issue out of country circumstances field (#961) --- .../domain/service/AppealSubmissionDocFieldMapper.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/AppealSubmissionDocFieldMapper.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/AppealSubmissionDocFieldMapper.java index 4683527ea..8f239b949 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/AppealSubmissionDocFieldMapper.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/AppealSubmissionDocFieldMapper.java @@ -187,7 +187,7 @@ private static void addAppealOocFields(AsylumCase asylumCase, Map maybeOutOfCountryCircumstances = asylumCase.read(OOC_APPEAL_ADMIN_J, OutOfCountryCircumstances.class); if (maybeOutOfCountryCircumstances.isPresent() && isInternalCase(asylumCase) && !isAppellantInUk(asylumCase)) { - populateOutOfCircumstancesInternalCase(fieldValues, maybeOutOfCountryCircumstances); + populateOutOfCircumstancesInternalCase(fieldValues, maybeOutOfCountryCircumstances.get()); } else if (maybeOutOfCountryDecisionType.isPresent()) { fieldValues.put(OUT_OF_COUNTRY_DECISION_TYPE_TITLE, "Out of country decision type"); @@ -214,8 +214,7 @@ private static void addAppealOocFields(AsylumCase asylumCase, Map fieldValues, Optional maybeOutOfCountryCircumstances) { - OutOfCountryCircumstances outOfCountryCircumstances = maybeOutOfCountryCircumstances.get(); + private static void populateOutOfCircumstancesInternalCase(Map fieldValues, OutOfCountryCircumstances outOfCountryCircumstances) { if (outOfCountryCircumstances.equals(ENTRY_CLEARANCE_DECISION)) { fieldValues.put(OUT_OF_COUNTRY_DECISION_TYPE_TITLE, CIRCUMSTANCES_OF_THE_APPELLANT_S_OUT_OF_COUNTRY_APPEAL_TITLE); fieldValues.put(OUT_OF_COUNTRY_DECISION_TYPE_TEXT, THE_APPELLANT_IS_APPEALING_AN_ENTRY_CLEARANCE_DECISION);