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);