From 040d9f8a83a801661a31ee392185a8313ea3fbe1 Mon Sep 17 00:00:00 2001 From: AmritSidhu Date: Tue, 12 Nov 2024 13:56:05 +0000 Subject: [PATCH] PYIC-7651: Update journeyMap with new exit page We should display this page if we receive an access-denied error code from DCMAW and the user is an international address user --- api-tests/features/p2-web-journey.feature | 25 +++++++++++++++- .../journey-maps/new-p2-identity.yaml | 29 +++++++++++++++++-- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/api-tests/features/p2-web-journey.feature b/api-tests/features/p2-web-journey.feature index 66b525598e..2edbca0052 100644 --- a/api-tests/features/p2-web-journey.feature +++ b/api-tests/features/p2-web-journey.feature @@ -46,7 +46,30 @@ Feature: P2 Web document journey When I start a new 'medium-confidence' journey Then I get a 'live-in-uk' page response When I submit a 'end' event - Then I get a 'identify-device' page response + Then I get a 'dcmaw' CRI response + + Scenario Outline: International address user sends a next event on exit page from DCMAW + Given I activate the 'internationalAddress' feature set + When I start a new 'medium-confidence' journey + Then I get a 'live-in-uk' page response + When I submit a 'end' event + Then I get a 'dcmaw' CRI response + When I call the CRI stub and get an 'access_denied' OAuth error + Then I get a 'non-uk-no-app' page response + When I submit a 'next' event + Then I get a 'dcmaw' CRI response + + Scenario Outline: International address user sends an end event on exit page from DCMAW + Given I activate the 'internationalAddress' feature set + When I start a new 'medium-confidence' journey + Then I get a 'live-in-uk' page response + When I submit a 'end' event + Then I get a 'dcmaw' CRI response + When I call the CRI stub and get an 'access_denied' OAuth error + Then I get a 'non-uk-no-app' page response + When I submit a 'end' event + Then I get an OAuth response + When I use the OAuth response to get my identity Scenario Outline: Successful P2 identity via Web using - DWP KBV Given I activate the 'dwpKbvTest' feature set diff --git a/lambdas/process-journey-event/src/main/resources/statemachine/journey-maps/new-p2-identity.yaml b/lambdas/process-journey-event/src/main/resources/statemachine/journey-maps/new-p2-identity.yaml index f07ca70179..b391a70a77 100644 --- a/lambdas/process-journey-event/src/main/resources/statemachine/journey-maps/new-p2-identity.yaml +++ b/lambdas/process-journey-event/src/main/resources/statemachine/journey-maps/new-p2-identity.yaml @@ -806,7 +806,19 @@ states: end: targetState: RETURN_TO_RP - # Live in uk journey + # International Address journey + APP_DOC_CHECK_INTERNATIONAL_ADDRESS: + nestedJourney: APP_DOC_CHECK + exitEvents: + next: + targetState: POST_APP_DOC_CHECK_SUCCESS_PAGE + incomplete: + targetState: NON_UK_NO_APP_PAGE + incomplete-invalid-dl: + targetState: NON_UK_NO_APP_PAGE + alternate-doc-invalid-dl: + targetState: NON_UK_NO_APP_PAGE + LIVE_IN_UK_PAGE: response: type: page @@ -815,5 +827,16 @@ states: next: targetState: IDENTITY_START_PAGE end: - targetState: STRATEGIC_APP_TRIAGE - targetEntryEvent: appTriage + targetState: APP_DOC_CHECK_INTERNATIONAL_ADDRESS + targetEntryEvent: next + + NON_UK_NO_APP_PAGE: + response: + type: page + pageId: non-uk-no-app + events: + next: + targetState: APP_DOC_CHECK_INTERNATIONAL_ADDRESS + targetEntryEvent: next + end: + targetState: RETURN_TO_RP