Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AM-2794 #1895

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

AM-2794 #1895

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5c70279
AM-2794: Create drools rules behind new flag to enforce validation of…
May 17, 2023
f000714
Merge branch 'master' into AM-2794
tomxelliott Jun 6, 2023
c1e0c18
Merge branch 'master' into AM-2794
tomxelliott Jun 12, 2023
7fde3b0
AM-2794: Action dev review comments
Jun 12, 2023
41022e2
AM-2794: Update befta test data files
Jun 12, 2023
baf3895
AM-2794: Update data file for 232.v1_1_rejected
Jun 12, 2023
9d02500
AM-2794: Request roles value not important as rejected status is the …
Jun 12, 2023
4494b48
AM-2794: Ensure role is removed in clean up so doesn't impact other t…
Jun 12, 2023
ceafac9
AM-2794: Revert rejected scenarios
Jun 12, 2023
01d1c56
AM-2794: Add private law specific access denied test
Jun 13, 2023
c2e659f
AM-2794: Add civil judiciary specific access granted role fta test
Jun 13, 2023
e2371a1
AM-2794: Clean up S-231.v1_1 fta test
Jun 13, 2023
d35a421
AM-2794: Update feature flags on F-011 FTAs
Jun 13, 2023
2ffb646
AM-2794: Fix references in post test cleanup role removal
Jun 13, 2023
7c05adc
AM-2794: Add FTA scenarios for remaining features in F-011
Jun 13, 2023
c660a2f
AM-2794: Fix typo in test
Jun 13, 2023
ed25966
AM-2794: Remove redundant flags from FTAs
Jun 15, 2023
cb0d545
AM-2794: Add extra cleanup step to S-231 to ensure all created roles …
Jun 19, 2023
1dc7737
AM-2794: Revert previous change after clarification
Jun 19, 2023
e469c90
AM-2794: Point at new access request file in test
Jun 19, 2023
4d0643f
AM-2794: Update case id being used in test
Jun 19, 2023
9c90405
AM-2834: Plug dates into tests to replace hard coded dates
Jun 23, 2023
47d150d
AM-2834: Resolve issue with ordering of items in F-015 test
Jun 23, 2023
148576f
AM-2834: Add plugged in dates missed on inital pass
Jun 28, 2023
1954862
Merge branch 'master' into AM-2794
tomxelliott Jun 29, 2023
9860bf5
Merge branch 'AM-2794' into AM-2834
tomxelliott Jun 29, 2023
71ef425
Merge branch 'master' into AM-2794
tomxelliott Jun 30, 2023
9b0674f
Merge branch 'AM-2794' into AM-2834
tomxelliott Jun 30, 2023
b94789b
Merge branch 'master' into AM-2794
tomxelliott Jul 6, 2023
a313901
Merge branch 'AM-2794' into AM-2834
tomxelliott Jul 6, 2023
661ebd9
Merge pull request #1918 from hmcts/AM-2834
tomxelliott Jul 6, 2023
cd8843d
Trigger build
Jul 6, 2023
3069fd6
Merge branch 'master' into AM-2794
tomxelliott Jul 12, 2023
cc291aa
Merge branch 'master' into AM-2794
mikebrownccd Jul 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ public Object calculateCustomValue(BackEndFunctionalTestScenarioContext scenario
return new TokenUtils().generateServiceToken(buildCcdSpecificConfig());
case ("generateS2STokenForXui"):
return new TokenUtils().generateServiceToken(buildXuiSpecificConfig());
case ("tomorrow"):
return LocalDate.now().plusDays(1);
case ("today"):
return LocalDate.now();
case ("yesterday"):
return LocalDate.now().minusDays(1);
case ("tomorrow"):
return LocalDate.now().plusDays(1);
case ("nextMonth"):
return LocalDate.now().plusMonths(1);
case ("nextYear"):
return LocalDate.now().plusYears(1);
default:
return super.calculateCustomValue(scenarioContext, key);
}
Expand Down
4 changes: 2 additions & 2 deletions src/functionalTest/resources/features/F-001/S-008.td.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"requestedRoles": [
{
"_extends_": "RequestedRole",
"beginTime" : "2020-01-01T00:00Z",
"endTime" : "2025-01-01T00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z",
"roleType": "CASE",
"grantType": "SPECIFIC",
"attributes": {
Expand Down
4 changes: 2 additions & 2 deletions src/functionalTest/resources/features/F-001/S-009.td.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"requestedRoles": [
{
"_extends_": "RequestedRole",
"beginTime" : "2023-01-01T00:00Z",
"endTime" : "2020-01-01T00:00Z"
"beginTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z",
"endTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions src/functionalTest/resources/features/F-001/S-010.td.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"requestedRoles": [
{
"_extends_": "RequestedRole",
"beginTime" : "2023-01-01T00:00Z",
"endTime" : "2022-01-01T00:00Z"
"beginTime" : "${[scenarioContext][customValues][nextMonth]}T00:00:00Z",
"endTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
},
"notes" : [ {
"userId" : "003352d0-e699-48bc-b6f5-5810411e60ag",
"time" : "2020-01-01T00:00Z",
"time" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"comment" : "Need Access to case number 1234567890123456 for a month"
}, {
"userId" : "52aa3810-af1f-11ea-b3de-0242ac130004",
"time" : "2020-01-02T00:00Z",
"time" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"comment" : "Access granted for 6 months"
} ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
[
{
"userId": "003352d0-e699-48bc-b6f5-5810411e60ag",
"time": "2020-01-01T00:00Z",
"time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"comment": "Need Access to case number 1234567890123456 for a month"
},
{
"userId": "52aa3810-af1f-11ea-b3de-0242ac130004",
"time": "2020-01-02T00:00Z",
"time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"comment": "Access granted for 6 months"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "case-allocator",
"roleCategory": "JUDICIAL",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA"
Expand All @@ -33,7 +33,7 @@
"actorId": "${[scenarioContext][testData][users][befta1][id]}",
"roleName": "leadership-judge",
"roleCategory": "JUDICIAL",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "case-allocator",
"roleCategory": "JUDICIAL",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA"
Expand All @@ -33,7 +33,7 @@
"actorId": "${[scenarioContext][testData][users][befta1][id]}",
"roleName": "senior-judge",
"roleCategory": "JUDICIAL",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "case-allocator",
"roleCategory": "JUDICIAL",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA"
Expand All @@ -33,7 +33,7 @@
"actorId": "${[scenarioContext][testData][users][befta1][id]}",
"roleName": "judge",
"roleCategory": "JUDICIAL",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "case-allocator",
"roleCategory": "JUDICIAL",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA"
Expand All @@ -33,7 +33,7 @@
"actorId": "${[scenarioContext][testData][users][befta1][id]}",
"roleName": "fee-paid-judge",
"roleCategory": "JUDICIAL",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "case-allocator",
"roleCategory": "JUDICIAL",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA"
Expand All @@ -33,7 +33,7 @@
"actorId": "${[scenarioContext][testData][users][befta1][id]}",
"roleName": "case-allocator",
"roleCategory": "JUDICIAL",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"actorId": "${[scenarioContext][testData][users][befta1][id]}",
"roleName": "tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand All @@ -35,7 +35,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand All @@ -47,7 +47,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "case-allocator",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "case-allocator",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand All @@ -34,7 +34,7 @@
"actorId": "${[scenarioContext][testData][users][befta1][id]}",
"roleName": "tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "case-allocator",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand All @@ -34,7 +34,7 @@
"actorId": "${[scenarioContext][testData][users][befta1][id]}",
"roleName": "case-allocator",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "case-allocator",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"actorId": "${[scenarioContext][testData][users][invokingUser][id]}",
"roleName": "case-allocator",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}",
"roleName": "tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand All @@ -35,7 +35,7 @@
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}",
"roleName": "senior-tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}",
"roleName": "tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand All @@ -35,7 +35,7 @@
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}",
"roleName": "senior-tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}",
"roleName": "tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand All @@ -35,7 +35,7 @@
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}",
"roleName": "senior-tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}",
"roleName": "tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand All @@ -35,7 +35,7 @@
"actorId": "${[scenarioContext][testData][request][body][roleRequest][reference]}",
"roleName": "senior-tribunal-caseworker",
"roleCategory": "LEGAL_OPERATIONS",
"beginTime" : "2020-09-01T00:00:00Z",
"beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z",
"attributes":
{
"jurisdiction": "IA",
Expand Down
48 changes: 47 additions & 1 deletion src/functionalTest/resources/features/F-011/F-011.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ Feature: F-011 : Create Specific Role Assignments
And a successful call [to delete role assignments just created above] as in [S-210_DeleteDataForRoleAssignmentsForOrgRoles],
And a successful call [to delete role assignments just created above] as in [S-210_DeleteDataForRoleAssignmentsForRequestedRole].

@S-210.v1_1
@FeatureToggle(RAS:iac_specific_1_1=on)
Scenario: must receive a rejected response when begin date is in the future for create specific access requested role for judiciary
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
And a successful call [to create org role assignments for actors & requester] as in [S-210_Org_Role_Creation],
When a request is prepared with appropriate values,
And the request [contains specific-access-legal-ops case requested role assignment with begin date in the future],
And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service],
Then a negative response is received,
And the response has all other details as expected.
And a successful call [to delete role assignments just created above] as in [DeleteDataForRoleAssignments],
And a successful call [to delete role assignments just created above] as in [S-210_DeleteDataForRoleAssignmentsForOrgRoles],
And a successful call [to delete role assignments just created above] as in [S-210_DeleteDataForRoleAssignmentsForRequestedRole].

@S-212
@FeatureToggle(RAS:iac_specific_1_0=on)
Scenario: must successfully create specific access denied by requester
Expand All @@ -32,7 +47,7 @@ Feature: F-011 : Create Specific Role Assignments
Then a positive response is received,
And the response has all other details as expected.
And a successful call [to delete role assignments just created above] as in [DeleteDataForRoleAssignments],
And a successful call [to delete role assignments just created above] as in [S-212_DeleteDataForRoleAssignmentsForOrgRoles],
And a successful call [to delete role assignments just created above] as in [S-212_DeleteDataForRoleAssignmentsForOrgRoles].

@S-231
@FeatureToggle(RAS:iac_specific_1_0=on)
Expand All @@ -49,6 +64,21 @@ Feature: F-011 : Create Specific Role Assignments
And a successful call [to delete role assignments just created above] as in [DeleteDataForRoleAssignments],
And a successful call [to delete role assignments just created above] as in [S-231_DeleteDataForRoleAssignmentsForOrgRoles].

@S-231.v1_1
@FeatureToggle(RAS:iac_specific_1_1=on)
Scenario: must receive a rejected response when begin date is in the future for specific access granted role for CIVIL judiciary
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
And a successful call [to create org role assignments for actors & requester] as in [S-231_Org_Role_Creation],
And a successful call [to create role assignments for requested role] as in [S-231_v1_Access_Requested],
When a request is prepared with appropriate values,
And the request [contains specific-access-judiciary case granted role assignment with begin date in the future],
And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service],
Then a negative response is received,
And the response has all other details as expected.
And a successful call [to delete role assignments just created above] as in [DeleteDataForRoleAssignments],
And a successful call [to delete role assignments just created above] as in [S-231_DeleteDataForRoleAssignmentsForOrgRoles].

@S-232
@FeatureToggle(RAS:iac_specific_1_0=on)
Scenario: must successfully create specific access denied role for PRIVATELAW admin
Expand All @@ -64,3 +94,19 @@ Feature: F-011 : Create Specific Role Assignments
And a successful call [to delete role assignments just created above] as in [DeleteDataForRoleAssignments],
And a successful call [to delete role assignments just created above] as in [S-232_DeleteDataForRoleAssignmentsForOrgRoles],
And a successful call [to delete role assignments just created above] as in [S-232_DeleteDataForRoleAssignmentsForDeniedRole].

@S-232.v1_1
@FeatureToggle(RAS:iac_specific_1_1=on)
Scenario: must receive a rejected response when begin date is in the future for specific access denied role for PRIVATELAW admin
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
And a successful call [to create org role assignments for actors & requester] as in [S-232_Org_Role_Creation],
And a successful call [to create role assignments for requested role] as in [S-232_Access_Requested],
When a request is prepared with appropriate values,
And the request [contains specific-access-admin case denied role assignment with begin date in the future],
And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service],
Then a negative response is received,
And the response has all other details as expected,
And a successful call [to delete role assignments just created above] as in [DeleteDataForRoleAssignments]
And a successful call [to delete role assignments just created above] as in [S-232_DeleteDataForRoleAssignmentsForOrgRoles],
And a successful call [to delete role assignments just created above] as in [S-232_DeleteDataForRoleAssignmentsForDeniedRole].
Loading