Skip to content

Commit

Permalink
PYIC-7701: Use single coi check for update name journeys (#2714)
Browse files Browse the repository at this point in the history
  • Loading branch information
thebauSoftwire authored Nov 20, 2024
2 parents 1e78811 + a25de84 commit c647dae
Show file tree
Hide file tree
Showing 12 changed files with 202 additions and 761 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ Feature: Repeat fraud check failures
Then I get a 'pyi-no-match' page response

Scenario: Failed COI check
When I submit 'kenneth-changed-family-name-driving-permit-valid' details to the CRI stub
When I submit 'alice-passport-valid' details to the CRI stub
Then I get a 'page-dcmaw-success' page response with context 'coiNoAddress'
When I submit a 'next' event
Then I get a 'fraud' CRI response
When I submit 'kenneth-changed-family-name-score-2' details to the CRI stub
When I submit 'alice-score-2' details to the CRI stub
Then I get a 'sorry-could-not-confirm-details' page response with context 'existingIdentityInvalid'
When I submit a 'returnToRp' event
Then I get an OAuth response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@ Feature: Repeat fraud check journeys
Then I get a 'dcmaw' CRI response
When I submit 'kenneth-changed-family-name-driving-permit-valid' details to the CRI stub
Then I get a 'page-dcmaw-success' page response with context 'coiNoAddress'
When I submit a 'next' event
Then I get a 'fraud' CRI response
When I submit 'kenneth-changed-family-name-score-2' details to the CRI stub
Then I get a 'page-ipv-success' page response
When I submit a 'next' event
Then I get an OAuth response
When I use the OAuth response to get my identity
Then I get a 'P2' identity
And my identity 'GivenName' is 'Kenneth'
And my identity 'FamilyName' is 'Smith'

Scenario: Fraud 6 Months Expiry + Address Update
# Repeat fraud check with update address
Expand Down Expand Up @@ -105,18 +95,6 @@ Feature: Repeat fraud check journeys
Then I get a 'dcmaw' CRI response
When I submit 'kenneth-changed-given-name-driving-permit-valid' details to the CRI stub
Then I get a 'page-dcmaw-success' page response with context 'coiAddress'
When I submit a 'next' event
Then I get a 'address' CRI response
When I submit 'kenneth-changed' details to the CRI stub
Then I get a 'fraud' CRI response
When I submit 'kenneth-changed-given-name-score-2' details to the CRI stub
Then I get a 'page-ipv-success' page response
When I submit a 'next' event
Then I get an OAuth response
When I use the OAuth response to get my identity
Then I get a 'P2' identity
And my identity 'GivenName' is 'Ken'
And my address 'streetName' is 'King Road'

Scenario: Unsupported Changes
# Repeat fraud check with various unsupported events and back navigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,52 +12,29 @@ Feature: Identity reuse update details
When I submit a 'update-details' event
Then I get a 'update-details' page response

Scenario: Given Name Change Failure
When I submit a 'given-names-only' event
Scenario Outline: Successful name change - <selected-name-change> name change but user updates <actual-name-change> name instead
When I submit a '<selected-name-change>' event
Then I get a 'page-update-name' page response
When I submit a 'update-name' event
Then I get a 'dcmaw' CRI response
When I submit 'kenneth-changed-family-name-driving-permit-valid' details to the CRI stub
Then I get a 'page-dcmaw-success' page response with context 'coiNoAddress'
When I submit a 'next' event
Then I get a 'fraud' CRI response
When I submit 'kenneth-changed-family-name-score-2' details to the CRI stub
Then I get a 'sorry-could-not-confirm-details' page response with context 'existingIdentityValid'
And an 'IPV_USER_DETAILS_UPDATE_END' audit event was recorded [local only]

Scenario: Given Name Change
When I submit a 'given-names-only' event
Then I get a 'page-update-name' page response
When I submit a 'update-name' event
Then I get a 'dcmaw' CRI response
When I submit 'kenneth-changed-given-name-driving-permit-valid' details to the CRI stub
When I submit '<details>' details to the CRI stub
Then I get a 'page-dcmaw-success' page response with context 'coiNoAddress'
When I submit a 'next' event
Then I get a 'fraud' CRI response
When I submit 'kenneth-changed-given-name-score-2' details to the CRI stub
When I submit '<fraud-details>' details to the CRI stub
Then I get a 'page-ipv-success' page response
When I submit a 'next' event
Then I get an OAuth response
When I use the OAuth response to get my identity
Then I get a 'P2' identity
And my identity 'GivenName' is 'Ken'
And my identity 'GivenName' is '<expected-given-name>'
And my identity 'FamilyName' is '<expected-family-name>'
And an 'IPV_USER_DETAILS_UPDATE_END' audit event was recorded [local only]

Scenario: Family Name Change
When I submit a 'family-name-only' event
Then I get a 'page-update-name' page response
When I submit a 'update-name' event
Then I get a 'dcmaw' CRI response
When I submit 'kenneth-changed-family-name-driving-permit-valid' details to the CRI stub
Then I get a 'page-dcmaw-success' page response with context 'coiNoAddress'
When I submit a 'next' event
Then I get a 'fraud' CRI response
When I submit 'kenneth-changed-family-name-score-2' details to the CRI stub
Then I get a 'page-ipv-success' page response
When I submit a 'next' event
Then I get an OAuth response
When I use the OAuth response to get my identity
Then I get a 'P2' identity
And my identity 'FamilyName' is 'Smith'
Examples:
| selected-name-change | actual-name-change | details | fraud-details | expected-given-name | expected-family-name |
| given-names-only | family | kenneth-changed-family-name-driving-permit-valid | kenneth-changed-family-name-score-2 | Kenneth | Smith |
| family-name-only | given | kenneth-changed-given-name-driving-permit-valid | kenneth-changed-given-name-score-2 | Ken | Decerqueira |

Scenario: Address Change
When I submit a 'address-only' event
Expand Down Expand Up @@ -99,18 +76,6 @@ Feature: Identity reuse update details
Then I get a 'dcmaw' CRI response
When I submit 'kenneth-changed-given-name-driving-permit-valid' details to the CRI stub
Then I get a 'page-dcmaw-success' page response with context 'coiAddress'
When I submit a 'next' event
Then I get a 'address' CRI response
When I submit 'kenneth-changed' details to the CRI stub
Then I get a 'fraud' CRI response
When I submit 'kenneth-changed-given-name-score-2' details to the CRI stub
Then I get a 'page-ipv-success' page response
When I submit a 'next' event
Then I get an OAuth response
When I use the OAuth response to get my identity
Then I get a 'P2' identity
And my identity 'GivenName' is 'Ken'
And my address 'streetName' is 'King Road'

Scenario: Unsupported Changes
When I submit a 'dob' event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,8 @@ public Map<String, Object> handleRequest(ProcessRequest request, Context context
var combinedCredentials = Stream.concat(oldVcs.stream(), sessionVcs.stream()).toList();
var successfulCheck =
switch (checkType) {
case GIVEN_NAMES_AND_DOB -> userIdentityService
.areGivenNamesAndDobCorrelated(combinedCredentials);
case FAMILY_NAME_AND_DOB -> userIdentityService
.areFamilyNameAndDobCorrelatedForCoiCheck(combinedCredentials);
case GIVEN_OR_FAMILY_NAME_AND_DOB -> userIdentityService
.areNamesAndDobCorrelated(combinedCredentials);
case FULL_NAME_AND_DOB -> userIdentityService.areVcsCorrelated(
combinedCredentials);
};
Expand Down
Loading

0 comments on commit c647dae

Please sign in to comment.