From 5c7027901c4af3c503e208dc0dc20d9d9dd307cd Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Wed, 17 May 2023 15:42:22 +0100 Subject: [PATCH 01/23] AM-2794: Create drools rules behind new flag to enforce validation of beginTime to be either null or in the past --- .../domain/model/enums/FeatureFlagEnum.java | 1 + ...V2_6__iac_specific_access_1_1_flag_add.sql | 6 + .../civil/common/civil-specific-access.drl | 71 ++ .../core/specific-access-global.drl | 424 ++++++---- .../iac/common/iac-specific-access.drl | 63 ++ .../drools/SpecificAccessDroolsTest.java | 762 +++++++++++++++++- 6 files changed, 1154 insertions(+), 173 deletions(-) create mode 100644 src/main/resources/db/migration/V2_6__iac_specific_access_1_1_flag_add.sql diff --git a/src/main/java/uk/gov/hmcts/reform/roleassignment/domain/model/enums/FeatureFlagEnum.java b/src/main/java/uk/gov/hmcts/reform/roleassignment/domain/model/enums/FeatureFlagEnum.java index 608cd076e9..5b3ad41bfa 100644 --- a/src/main/java/uk/gov/hmcts/reform/roleassignment/domain/model/enums/FeatureFlagEnum.java +++ b/src/main/java/uk/gov/hmcts/reform/roleassignment/domain/model/enums/FeatureFlagEnum.java @@ -5,6 +5,7 @@ public enum FeatureFlagEnum { IAC_JRD_1_0("iac_jrd_1_0"), CCD_BYPASS_1_0("ccd_bypass_1_0"), IAC_SPECIFIC_1_0("iac_specific_1_0"), + IAC_SPECIFIC_1_1("iac_specific_1_1"), IAC_CHALLENGED_1_0("iac_challenged_1_0"), WA_BYPASS_1_0("wa_bypass_1_0"), SSCS_WA_1_0("sscs_wa_1_0"); diff --git a/src/main/resources/db/migration/V2_6__iac_specific_access_1_1_flag_add.sql b/src/main/resources/db/migration/V2_6__iac_specific_access_1_1_flag_add.sql new file mode 100644 index 0000000000..70e3f7afb5 --- /dev/null +++ b/src/main/resources/db/migration/V2_6__iac_specific_access_1_1_flag_add.sql @@ -0,0 +1,6 @@ +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('iac_specific_1_1', 'pr', 'iac', 'true'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('iac_specific_1_1', 'aat', 'iac', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('iac_specific_1_1', 'demo', 'iac', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('iac_specific_1_1', 'perftest', 'iac', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('iac_specific_1_1', 'ithc', 'iac', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('iac_specific_1_1', 'prod', 'iac', 'false'); diff --git a/src/main/resources/validationrules/civil/common/civil-specific-access.drl b/src/main/resources/validationrules/civil/common/civil-specific-access.drl index 146dec2e5f..31eeda91e9 100644 --- a/src/main/resources/validationrules/civil/common/civil-specific-access.drl +++ b/src/main/resources/validationrules/civil/common/civil-specific-access.drl @@ -85,3 +85,74 @@ then update($ra); logMsg("Rule : civil_create_specific_access_case_role"); end; + + +/* + * All services: "specific-access-" case creation and leadership-judge as a assigner + * Added for CR:AM2794 + */ + +rule "civil_create_specific_access_case_role_v11" +when + $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + $rq: Request( + // The assigner must be the current user. + assignerId == authenticatedUserId, + process == "specific-access", + reference != null) + $ra: RoleAssignment( + // Users cannot approve their own requests. + actorId != $rq.assignerId, + status == Status.CREATE_REQUESTED, + roleType == RoleType.CASE, + // Any of the specific-access-xxx roles, but with the right role category. + // TBC if the syntax below works - if not we will need 4 rules. + (roleName == "specific-access-admin" && roleCategory == RoleCategory.ADMIN) || + (roleName == "specific-access-judiciary" && roleCategory == RoleCategory.JUDICIAL) || + (roleName == "specific-access-legal-ops" && roleCategory == RoleCategory.LEGAL_OPERATIONS) || + (roleName == "specific-access-ctsc" && roleCategory == RoleCategory.CTSC), + grantType == GrantType.SPECIFIC, + notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ + attributes["caseId"] != null && $caseId : attributes["caseId"].asText(), + // Only applies to CIVIL. + attributes["jurisdiction"] == null || attributes["jurisdiction"].asText() == "CIVIL", + beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) + $c: Case( + id == $caseId, + jurisdiction == "CIVIL") + $e: ExistingRoleAssignment( + // The assigner must have an organisational role ... + actorId == $rq.assignerId, + roleType == RoleType.ORGANISATION, + // ... which is one of the service approver roles ... + // ... and it is approving a request from the right kind of user ... + (roleName in ("nbc-team-leader", "hearing-centre-team-leader", "ctsc-team-leader") && $ra.roleName == "specific-access-admin") || + (roleName == "leadership-judge" && $ra.roleName == "specific-access-judiciary") || + (roleName == "senior-tribunal-caseworker" && $ra.roleName == "specific-access-legal-ops")|| + (roleName == "ctsc-team-leader" && $ra.roleName == "specific-access-ctsc"), + // ... and the role category should match the category of the role being created ... + roleCategory == $ra.roleCategory, + // ... with the usual constraints ... + grantType == GrantType.STANDARD, + classification.isAtLeast($c.securityClassification), + endTime == null || endTime.isAfter(ZonedDateTime.now()), + beginTime == null || !beginTime.isAfter(ZonedDateTime.now()), + // ... within the service ... + attributes["jurisdiction"] != null && attributes["jurisdiction"].asText() == "CIVIL", + // ... restricted by case type, region, location and managed roles / categories, if specified ... + attributes["caseType"] == null || attributes["caseType"].asText() == $c.caseTypeId, + attributes["region"] == null || attributes["region"].asText() == $c.getRegion(), + attributes["baseLocation"] == null || attributes["baseLocation"].asText() == $c.getBaseLocation(), + attributes["managedRoleCategory"] == null || ValidationUtil.csvContains($ra.roleCategory.toString(), attributes["managedRoleCategory"].asText()), + attributes["managedRole"] == null || ValidationUtil.csvContains($ra.roleName, attributes["managedRole"].asText())) +then + // We copy the authorisations to allow the case config to require an authorisation + // for (particularly judicial) role mappings + $ra.setAuthorisations($e.getAuthorisations()); + $ra.setAttribute("jurisdiction", "CIVIL"); + $ra.setAttribute("caseType", $c.getCaseTypeId()); + $ra.setStatus(Status.CREATE_APPROVED); + $ra.log("Stage 1 approved : civil_create_specific_access_case_role_v11"); + update($ra); + logMsg("Rule : civil_create_specific_access_case_role_v11"); +end; diff --git a/src/main/resources/validationrules/core/specific-access-global.drl b/src/main/resources/validationrules/core/specific-access-global.drl index 5cb24caf62..be9c5875a8 100644 --- a/src/main/resources/validationrules/core/specific-access-global.drl +++ b/src/main/resources/validationrules/core/specific-access-global.drl @@ -23,151 +23,228 @@ import java.time.temporal.ChronoUnit; */ - /* - * All services: "specific-access-requested" case roles self creation user - */ - rule "create_specific_access_requested_case_role_for_self" - when - $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) - $rq: Request( - // The assigner must be the current user. - assignerId == authenticatedUserId, - process == "specific-access", - reference != null) - $ra: RoleAssignment( - actorId == $rq.authenticatedUserId, - status == Status.CREATE_REQUESTED, - roleType == RoleType.CASE, - roleName == "specific-access-requested", - readOnly == true, - notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ - attributes["caseId"] != null && $caseId : attributes["caseId"].asText()) - $c: Case( - id == $caseId) - Request(reference == $caseId + "/" + $ra.attributes["requestedRole"].asText() + "/" + $ra.actorId) - $e: ExistingRoleAssignment( - actorId == $ra.actorId, - roleType == RoleType.ORGANISATION, - roleCategory == $ra.roleCategory, - grantType in (GrantType.STANDARD, GrantType.BASIC), - endTime == null || endTime.isAfter(ZonedDateTime.now()), - beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) - then - $ra.setAttribute("jurisdiction", $c.getJurisdiction()); - $ra.setAttribute("caseType", $c.getCaseTypeId()); - $ra.setStatus(Status.CREATE_APPROVED); - $ra.log("Stage 1 approved : create_specific_access_requested_case_role_for_self"); - update($ra); - logMsg("Rule : create_specific_access_requested_case_role_for_self"); - end; +/* + * All services: "specific-access-requested" case roles self creation user + */ +rule "create_specific_access_requested_case_role_for_self" +when + $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + $rq: Request( + // The assigner must be the current user. + assignerId == authenticatedUserId, + process == "specific-access", + reference != null) + $ra: RoleAssignment( + actorId == $rq.authenticatedUserId, + status == Status.CREATE_REQUESTED, + roleType == RoleType.CASE, + roleName == "specific-access-requested", + readOnly == true, + notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ + attributes["caseId"] != null && $caseId : attributes["caseId"].asText()) + $c: Case( + id == $caseId) + Request(reference == $caseId + "/" + $ra.attributes["requestedRole"].asText() + "/" + $ra.actorId) + $e: ExistingRoleAssignment( + actorId == $ra.actorId, + roleType == RoleType.ORGANISATION, + roleCategory == $ra.roleCategory, + grantType in (GrantType.STANDARD, GrantType.BASIC), + endTime == null || endTime.isAfter(ZonedDateTime.now()), + beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) +then + $ra.setAttribute("jurisdiction", $c.getJurisdiction()); + $ra.setAttribute("caseType", $c.getCaseTypeId()); + $ra.setStatus(Status.CREATE_APPROVED); + $ra.log("Stage 1 approved : create_specific_access_requested_case_role_for_self"); + update($ra); + logMsg("Rule : create_specific_access_requested_case_role_for_self"); +end; + +/* + * All services: "specific-access-requested" case roles self creation user. added for CR:AM2794 + */ +rule "create_specific_access_requested_case_role_for_self_v11" +when + $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + $rq: Request( + // The assigner must be the current user. + assignerId == authenticatedUserId, + process == "specific-access", + reference != null) + $ra: RoleAssignment( + actorId == $rq.authenticatedUserId, + status == Status.CREATE_REQUESTED, + roleType == RoleType.CASE, + roleName == "specific-access-requested", + readOnly == true, + notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ + attributes["caseId"] != null && $caseId : attributes["caseId"].asText(), + beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) + $c: Case( + id == $caseId) + Request(reference == $caseId + "/" + $ra.attributes["requestedRole"].asText() + "/" + $ra.actorId) + $e: ExistingRoleAssignment( + actorId == $ra.actorId, + roleType == RoleType.ORGANISATION, + roleCategory == $ra.roleCategory, + grantType in (GrantType.STANDARD, GrantType.BASIC), + endTime == null || endTime.isAfter(ZonedDateTime.now()), + beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) +then + $ra.setAttribute("jurisdiction", $c.getJurisdiction()); + $ra.setAttribute("caseType", $c.getCaseTypeId()); + $ra.setStatus(Status.CREATE_APPROVED); + $ra.log("Stage 1 approved : create_specific_access_requested_case_role_for_self_v11"); + update($ra); + logMsg("Rule : create_specific_access_requested_case_role_for_self_v11"); +end; + +/* + * All services: "specific-access-denied" case roles self creation user + */ +rule "create_specific_access_denied_case_role_for_self" +when + $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + $rq: Request( + // The assigner must be the current user. + assignerId == authenticatedUserId, + process == "specific-access") + $ra: RoleAssignment( + actorId == $rq.authenticatedUserId, + status == Status.CREATE_REQUESTED, + roleType == RoleType.CASE, + roleName == "specific-access-denied", + readOnly == true, + notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ + attributes["caseId"] != null && $caseId : attributes["caseId"].asText()) + $c: Case(id == $caseId) + Request(reference == $caseId + "/" + $ra.attributes["requestedRole"].asText() + "/" + $ra.actorId) +then + $ra.setAttribute("jurisdiction", $c.getJurisdiction()); + $ra.setAttribute("caseType", $c.getCaseTypeId()); + $ra.setStatus(Status.CREATE_APPROVED); + $ra.log("Stage 1 approved : create_specific_access_denied_case_role_for_self"); + update($ra); + logMsg("Rule : create_specific_access_denied_case_role_for_self"); +end; /* - * All services: "specific-access-denied" case roles self creation user - */ - rule "create_specific_access_denied_case_role_for_self" - when - $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) - $rq: Request( - // The assigner must be the current user. - assignerId == authenticatedUserId, - process == "specific-access") - $ra: RoleAssignment( - actorId == $rq.authenticatedUserId, - status == Status.CREATE_REQUESTED, - roleType == RoleType.CASE, - roleName == "specific-access-denied", - readOnly == true, - notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ - attributes["caseId"] != null && $caseId : attributes["caseId"].asText()) - $c: Case(id == $caseId) - Request(reference == $caseId + "/" + $ra.attributes["requestedRole"].asText() + "/" + $ra.actorId) - then - $ra.setAttribute("jurisdiction", $c.getJurisdiction()); - $ra.setAttribute("caseType", $c.getCaseTypeId()); - $ra.setStatus(Status.CREATE_APPROVED); - $ra.log("Stage 1 approved : create_specific_access_denied_case_role_for_self"); - update($ra); - logMsg("Rule : create_specific_access_denied_case_role_for_self"); - end; + * All services: "specific-access" case roles self deletion + */ +rule "delete_specific_access_request_of_case_role_for_self" +when + $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + $rq: Request( + // The assignee and the assigner must be the current user. + assignerId == authenticatedUserId) + $ra: RoleAssignment( + actorId == $rq.authenticatedUserId, + status == Status.DELETE_REQUESTED, + roleType == RoleType.CASE, + roleName in ("specific-access-requested", "specific-access-granted", "specific-access-denied")) +then + $ra.setStatus(Status.DELETE_APPROVED); + $ra.log("Stage 1 approved : delete_specific_access_request_of_case_role_for_self"); + update($ra); + logMsg("Rule : delete_specific_access_request_of_case_role_for_self"); +end; - /* - * All services: "specific-access" case roles self deletion - */ - rule "delete_specific_access_request_of_case_role_for_self" - when - $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) - $rq: Request( - // The assignee and the assigner must be the current user. - assignerId == authenticatedUserId) - $ra: RoleAssignment( - actorId == $rq.authenticatedUserId, - status == Status.DELETE_REQUESTED, - roleType == RoleType.CASE, - roleName in ("specific-access-requested", "specific-access-granted", "specific-access-denied")) - then - $ra.setStatus(Status.DELETE_APPROVED); - $ra.log("Stage 1 approved : delete_specific_access_request_of_case_role_for_self"); - update($ra); - logMsg("Rule : delete_specific_access_request_of_case_role_for_self"); - end; +/* + * All services: "specific-access" case approval or denied roles + */ +rule "create_specific_access_granted_or_denied_case_role" +when + $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + $rq: Request( + clientId == "xui_webapp", + process == "specific-access", + reference != null) + $ra: RoleAssignment( + status == Status.CREATE_REQUESTED, + roleType == RoleType.CASE, + roleName in ("specific-access-granted", "specific-access-denied"), + readOnly == true, + endTime != null, + notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ + attributes["caseId"] != null && $caseId : attributes["caseId"].asText()) + $c: Case( + id == $caseId) + Request(reference == $caseId + "/" + $ra.attributes["requestedRole"].asText() + "/" + $ra.actorId) + $e: ExistingRoleAssignment( + actorId == $ra.actorId, + roleType == RoleType.CASE, + roleName == "specific-access-requested", + roleCategory == $ra.roleCategory, + attributes["requestedRole"] != null && $ra.attributes["requestedRole"] != null && + attributes["requestedRole"].asText() == $ra.attributes["requestedRole"].asText()) +then + $ra.setAttribute("jurisdiction", $c.getJurisdiction()); + $ra.setAttribute("caseType", $c.getCaseTypeId()); + $ra.setStatus(Status.CREATE_APPROVED); + $ra.log("Stage 1 approved : create_specific_access_granted_or_denied_case_role"); + update($ra); + logMsg("Rule : create_specific_access_granted_or_denied_case_role"); +end; - /* - * All services: "specific-access" case approval or denied roles - */ - rule "create_specific_access_granted_or_denied_case_role" - when - $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) - $rq: Request( - clientId == "xui_webapp", - process == "specific-access", - reference != null) - $ra: RoleAssignment( - status == Status.CREATE_REQUESTED, - roleType == RoleType.CASE, - roleName in ("specific-access-granted", "specific-access-denied"), - readOnly == true, - endTime != null, - notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ - attributes["caseId"] != null && $caseId : attributes["caseId"].asText()) - $c: Case( - id == $caseId) - Request(reference == $caseId + "/" + $ra.attributes["requestedRole"].asText() + "/" + $ra.actorId) - $e: ExistingRoleAssignment( - actorId == $ra.actorId, - roleType == RoleType.CASE, - roleName == "specific-access-requested", - roleCategory == $ra.roleCategory, - attributes["requestedRole"] != null && $ra.attributes["requestedRole"] != null && - attributes["requestedRole"].asText() == $ra.attributes["requestedRole"].asText()) - then - $ra.setAttribute("jurisdiction", $c.getJurisdiction()); - $ra.setAttribute("caseType", $c.getCaseTypeId()); - $ra.setStatus(Status.CREATE_APPROVED); - $ra.log("Stage 1 approved : create_specific_access_granted_or_denied_case_role"); - update($ra); - logMsg("Rule : create_specific_access_granted_or_denied_case_role"); - end; +/* + * All services: "specific-access" case approval or denied roles. added for CR:AM2794 + */ +rule "create_specific_access_granted_or_denied_case_role_v11" +when + $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + $rq: Request( + clientId == "xui_webapp", + process == "specific-access", + reference != null) + $ra: RoleAssignment( + status == Status.CREATE_REQUESTED, + roleType == RoleType.CASE, + roleName in ("specific-access-granted", "specific-access-denied"), + readOnly == true, + endTime != null, + notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ + attributes["caseId"] != null && $caseId : attributes["caseId"].asText(), + beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) + $c: Case( + id == $caseId) + Request(reference == $caseId + "/" + $ra.attributes["requestedRole"].asText() + "/" + $ra.actorId) + $e: ExistingRoleAssignment( + actorId == $ra.actorId, + roleType == RoleType.CASE, + roleName == "specific-access-requested", + roleCategory == $ra.roleCategory, + attributes["requestedRole"] != null && $ra.attributes["requestedRole"] != null && + attributes["requestedRole"].asText() == $ra.attributes["requestedRole"].asText()) +then + $ra.setAttribute("jurisdiction", $c.getJurisdiction()); + $ra.setAttribute("caseType", $c.getCaseTypeId()); + $ra.setStatus(Status.CREATE_APPROVED); + $ra.log("Stage 1 approved : create_specific_access_granted_or_denied_case_role_v11"); + update($ra); + logMsg("Rule : create_specific_access_granted_or_denied_case_role_v11"); +end; - /* - * All services: "specific-access-requested" case role deletion - */ - rule "delete_specific_access_granted_or_denied_case_role" - when - $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) - $rq: Request( - clientId == "xui_webapp", - process == "specific-access", - reference != null) - $ra: RoleAssignment( - status == Status.DELETE_REQUESTED, - roleType == RoleType.CASE, - roleName == "specific-access-requested") - then - $ra.setStatus(Status.DELETE_APPROVED); - $ra.log("Stage 1 approved : delete_specific_access_granted_or_denied_case_role"); - update($ra); - logMsg("Rule : delete_specific_access_granted_or_denied_case_role"); - end; +/* + * All services: "specific-access-requested" case role deletion + */ +rule "delete_specific_access_granted_or_denied_case_role" +when + $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + $rq: Request( + clientId == "xui_webapp", + process == "specific-access", + reference != null) + $ra: RoleAssignment( + status == Status.DELETE_REQUESTED, + roleType == RoleType.CASE, + roleName == "specific-access-requested") +then + $ra.setStatus(Status.DELETE_APPROVED); + $ra.log("Stage 1 approved : delete_specific_access_granted_or_denied_case_role"); + update($ra); + logMsg("Rule : delete_specific_access_granted_or_denied_case_role"); +end; /* * All services: "specific-access-" case creation and specific_access_approver as a assigner @@ -233,3 +310,70 @@ then update($ra); logMsg("Rule : specific_access_approver_create_specific_access_case_role"); end; + +/* + * All services: "specific-access-" case creation and specific_access_approver as a assigner + * Added for CR:AM2794 + */ + +rule "specific_access_approver_create_specific_access_case_role_v11" +when + $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + $rq: Request( + // The assigner must be the current user. + assignerId == authenticatedUserId, + process == "specific-access", + reference != null) + $ra: RoleAssignment( + // Users cannot approve their own requests. + actorId != $rq.assignerId, + status == Status.CREATE_REQUESTED, + roleType == RoleType.CASE, + // TBC if the syntax below works. + (roleName == "specific-access-admin" && roleCategory == RoleCategory.ADMIN) || + (roleName == "specific-access-judiciary" && roleCategory == RoleCategory.JUDICIAL) || + (roleName == "specific-access-legal-ops" && roleCategory == RoleCategory.LEGAL_OPERATIONS) || + (roleName == "specific-access-ctsc" && roleCategory == RoleCategory.CTSC), + grantType == GrantType.SPECIFIC, + notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ + attributes["caseId"] != null && $caseId : attributes["caseId"].asText(), + // Add all the jurisdiction Ids of the on-boarded services + // Do we really need to constrain the jurisdiction here? + attributes["jurisdiction"] != null && $jurisdiction : attributes["jurisdiction"].asText() && attributes["jurisdiction"].asText() in ("IA","SSCS","CIVIL","PRIVATELAW","PUBLICLAW"), + beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) + $c: Case( + id == $caseId, + jurisdiction == $jurisdiction) + $e: ExistingRoleAssignment( + // The assigner must have an organisational role ... + actorId == $rq.assignerId, + roleType == RoleType.ORGANISATION, + // ... with name specific-access-approver-xxx, and correct for the requested role ... + (roleName == "specific-access-approver-admin" && $ra.roleName == "specific-access-admin") || + (roleName == "specific-access-approver-judiciary" && $ra.roleName == "specific-access-judiciary") || + (roleName == "specific-access-approver-legal-ops" && $ra.roleName == "specific-access-legal-ops") || + (roleName == "specific-access-approver-ctsc" && $ra.roleName == "specific-access-ctsc"), + // ... with all the usual constraints ... + grantType == GrantType.STANDARD, + classification.isAtLeast($c.securityClassification), + endTime == null || endTime.isAfter(ZonedDateTime.now()), + beginTime == null || !beginTime.isAfter(ZonedDateTime.now()), + // ... in the jurisdiction of the requested role assignment (and the case) ... + attributes["jurisdiction"] != null && attributes["jurisdiction"].asText() == $jurisdiction, + // ... with all of the optional attributes matching if specified ... + attributes["caseType"] == null || attributes["caseType"].asText() == $c.caseTypeId, + attributes["region"] == null || attributes["region"].asText() == $c.getRegion(), + attributes["baseLocation"] == null || attributes["baseLocation"].asText() == $c.getBaseLocation(), + attributes["managedRoleCategory"] == null || ValidationUtil.csvContains($ra.roleCategory.toString(), attributes["managedRoleCategory"].asText()), + attributes["managedRole"] == null || ValidationUtil.csvContains($ra.roleName, attributes["managedRole"].asText())) +then + // We copy the authorisations to allow the case config to require an authorisation + // for (particularly judicial) role mappings + $ra.setAuthorisations($e.getAuthorisations()); + $ra.setAttribute("jurisdiction", $jurisdiction); + $ra.setAttribute("caseType", $c.getCaseTypeId()); + $ra.setStatus(Status.CREATE_APPROVED); + $ra.log("Stage 1 approved : specific_access_approver_create_specific_access_case_role_v11"); + update($ra); + logMsg("Rule : specific_access_approver_create_specific_access_case_role_v11"); +end; diff --git a/src/main/resources/validationrules/iac/common/iac-specific-access.drl b/src/main/resources/validationrules/iac/common/iac-specific-access.drl index 30b93553d9..7c040a1888 100644 --- a/src/main/resources/validationrules/iac/common/iac-specific-access.drl +++ b/src/main/resources/validationrules/iac/common/iac-specific-access.drl @@ -77,3 +77,66 @@ then update($ra); logMsg("Rule : iac_create_specific_access_case_role"); end; + + +/* + * All services: "specific-access-" case creation and leadership-judge as a assigner + * Added for CR:AM2794 + */ + +rule "iac_create_specific_access_case_role_v11" +when + $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + $rq: Request( + // The assigner must be the current user. + assignerId == authenticatedUserId, + process == "specific-access", + reference != null) + $ra: RoleAssignment( + // Users cannot approve their own requests. + actorId != $rq.assignerId, + status == Status.CREATE_REQUESTED, + roleType == RoleType.CASE, + // For IAC, all roles can be approved by the same set of approver roles. + roleName in ("specific-access-admin", "specific-access-judiciary", "specific-access-legal-ops", "specific-access-ctsc"), + roleCategory in (RoleCategory.ADMIN, RoleCategory.JUDICIAL, RoleCategory.LEGAL_OPERATIONS, RoleCategory.CTSC), + grantType == GrantType.SPECIFIC, + notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ + attributes["caseId"] != null && $caseId : attributes["caseId"].asText(), + // Only applies to IAC + attributes["jurisdiction"] == null || attributes["jurisdiction"].asText() == "IA", + beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) + $c: Case( + id == $caseId, + jurisdiction == "IA") + $e: ExistingRoleAssignment( + // The assigner must have an organisational role ... + actorId == $rq.assignerId, + roleType == RoleType.ORGANISATION, + // ... which is any of the IAC roles that can approve specific access requests ... + roleName == "leadership-judge", + // ... with the usual constraints ... + grantType == GrantType.STANDARD, + classification.isAtLeast($c.securityClassification), + endTime == null || endTime.isAfter(ZonedDateTime.now()), + beginTime == null || !beginTime.isAfter(ZonedDateTime.now()), + // ... within the service. + attributes["jurisdiction"] != null && attributes["jurisdiction"].asText() == "IA", + // All the following should be null currently for IAC. + // The rules are left in place to support any changes service may make to how they use roles in the future. + attributes["caseType"] == null || attributes["caseType"].asText() == $c.caseTypeId, + attributes["region"] == null || attributes["region"].asText() == $c.getRegion(), + attributes["baseLocation"] == null || attributes["baseLocation"].asText() == $c.getBaseLocation(), + attributes["managedRoleCategory"] == null || ValidationUtil.csvContains($ra.roleCategory.toString(), attributes["managedRoleCategory"].asText()), + attributes["managedRole"] == null || ValidationUtil.csvContains($ra.roleName, attributes["managedRole"].asText())) +then + // We copy the authorisations to allow the case config to require an authorisation + // for (particularly judicial) role mappings + $ra.setAuthorisations($e.getAuthorisations()); + $ra.setAttribute("jurisdiction", "IA"); + $ra.setAttribute("caseType", $c.getCaseTypeId()); + $ra.setStatus(Status.CREATE_APPROVED); + $ra.log("Stage 1 approved : iac_create_specific_access_case_role_v11"); + update($ra); + logMsg("Rule : iac_create_specific_access_case_role_v11"); +end; diff --git a/src/test/java/uk/gov/hmcts/reform/roleassignment/domain/service/drools/SpecificAccessDroolsTest.java b/src/test/java/uk/gov/hmcts/reform/roleassignment/domain/service/drools/SpecificAccessDroolsTest.java index 3e9c548c49..7ff1061368 100644 --- a/src/test/java/uk/gov/hmcts/reform/roleassignment/domain/service/drools/SpecificAccessDroolsTest.java +++ b/src/test/java/uk/gov/hmcts/reform/roleassignment/domain/service/drools/SpecificAccessDroolsTest.java @@ -97,6 +97,222 @@ void shouldCreate_SpecificAccessRequested(String jurisdiction, String roleName, }); } + @ParameterizedTest + @CsvSource({ + "CIVIL,specific-access-judiciary,JUDICIAL,STANDARD", + "CIVIL,specific-access-admin,ADMIN,STANDARD", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS,STANDARD", + "CIVIL,specific-access-ctsc,CTSC,STANDARD", + "CIVIL,specific-access-judiciary,JUDICIAL,BASIC", + "CIVIL,specific-access-admin,ADMIN,BASIC", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS,BASIC", + "PRIVATELAW,specific-access-judiciary,JUDICIAL,STANDARD", + "PRIVATELAW,specific-access-admin,ADMIN,STANDARD", + "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS,STANDARD", + "PUBLICLAW,specific-access-judiciary,JUDICIAL,STANDARD", + "PUBLICLAW,specific-access-admin,ADMIN,STANDARD", + "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS,STANDARD", + "PUBLICLAW,specific-access-ctsc,CTSC,STANDARD" + }) + void shouldCreate_SpecificAccessRequestedBeginTimeNullV11(String jurisdiction, + String roleName, + String roleCategory, + String orgGrantType) { + Case caseDetails = caseMap.get(jurisdiction); + HashMap roleAssignmentAttributes = new HashMap<>(); + roleAssignmentAttributes.put("caseId", convertValueJsonNode(caseDetails.getId())); + roleAssignmentAttributes.put("requestedRole", convertValueJsonNode(roleName)); + + assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccess( + "specific-access", + "specific-access-requested", + RoleCategory.valueOf(roleCategory), + RoleType.CASE, + roleAssignmentAttributes, + Classification.RESTRICTED, + GrantType.BASIC, + Status.CREATE_REQUESTED, + "anyClient", + true, + "Access required for reasons", + ACTORID, + roleAssignmentAttributes.get("caseId").asText() + "/" + + roleAssignmentAttributes.get("requestedRole").asText() + "/" + ACTORID + ) + .build(); + + FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(featureFlag); + + HashMap existingAttributes = new HashMap<>(); + existingAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); + existingAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + + executeDroolRules(List.of(TestDataBuilder + .buildExistingRoleForDrools( + ACTORID, + "judge", + RoleCategory.valueOf(roleCategory), + existingAttributes, + Classification.PRIVATE, + GrantType.valueOf(orgGrantType), + RoleType.ORGANISATION + ))); + + assignmentRequest.getRequestedRoles().forEach(roleAssignment -> { + Assertions.assertEquals(Status.APPROVED, roleAssignment.getStatus()); + Assertions.assertEquals(jurisdiction, roleAssignment.getAttributes().get("jurisdiction").asText()); + Assertions.assertEquals(caseDetails.getCaseTypeId(), + roleAssignment.getAttributes().get("caseType").asText()); + }); + } + + @ParameterizedTest + @CsvSource({ + "CIVIL,specific-access-judiciary,JUDICIAL,STANDARD", + "CIVIL,specific-access-admin,ADMIN,STANDARD", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS,STANDARD", + "CIVIL,specific-access-ctsc,CTSC,STANDARD", + "CIVIL,specific-access-judiciary,JUDICIAL,BASIC", + "CIVIL,specific-access-admin,ADMIN,BASIC", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS,BASIC", + "PRIVATELAW,specific-access-judiciary,JUDICIAL,STANDARD", + "PRIVATELAW,specific-access-admin,ADMIN,STANDARD", + "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS,STANDARD", + "PUBLICLAW,specific-access-judiciary,JUDICIAL,STANDARD", + "PUBLICLAW,specific-access-admin,ADMIN,STANDARD", + "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS,STANDARD", + "PUBLICLAW,specific-access-ctsc,CTSC,STANDARD" + }) + void shouldCreate_SpecificAccessRequestedBeginTimeInThePastV11(String jurisdiction, + String roleName, + String roleCategory, + String orgGrantType) { + Case caseDetails = caseMap.get(jurisdiction); + HashMap roleAssignmentAttributes = new HashMap<>(); + roleAssignmentAttributes.put("caseId", convertValueJsonNode(caseDetails.getId())); + roleAssignmentAttributes.put("requestedRole", convertValueJsonNode(roleName)); + + assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccess( + "specific-access", + "specific-access-requested", + RoleCategory.valueOf(roleCategory), + RoleType.CASE, + roleAssignmentAttributes, + Classification.RESTRICTED, + GrantType.BASIC, + Status.CREATE_REQUESTED, + "anyClient", + true, + "Access required for reasons", + ACTORID, + roleAssignmentAttributes.get("caseId").asText() + "/" + + roleAssignmentAttributes.get("requestedRole").asText() + "/" + ACTORID + ) + .build(); + + assignmentRequest.getRequestedRoles() + .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().minusDays(1L))); + + FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(featureFlag); + + HashMap existingAttributes = new HashMap<>(); + existingAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); + existingAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + + executeDroolRules(List.of(TestDataBuilder + .buildExistingRoleForDrools( + ACTORID, + "judge", + RoleCategory.valueOf(roleCategory), + existingAttributes, + Classification.PRIVATE, + GrantType.valueOf(orgGrantType), + RoleType.ORGANISATION + ))); + + assignmentRequest.getRequestedRoles().forEach(roleAssignment -> { + Assertions.assertEquals(Status.APPROVED, roleAssignment.getStatus()); + Assertions.assertEquals(jurisdiction, roleAssignment.getAttributes().get("jurisdiction").asText()); + Assertions.assertEquals(caseDetails.getCaseTypeId(), + roleAssignment.getAttributes().get("caseType").asText()); + }); + } + + @ParameterizedTest + @CsvSource({ + "CIVIL,specific-access-judiciary,JUDICIAL,STANDARD", + "CIVIL,specific-access-admin,ADMIN,STANDARD", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS,STANDARD", + "CIVIL,specific-access-ctsc,CTSC,STANDARD", + "CIVIL,specific-access-judiciary,JUDICIAL,BASIC", + "CIVIL,specific-access-admin,ADMIN,BASIC", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS,BASIC", + "PRIVATELAW,specific-access-judiciary,JUDICIAL,STANDARD", + "PRIVATELAW,specific-access-admin,ADMIN,STANDARD", + "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS,STANDARD", + "PUBLICLAW,specific-access-judiciary,JUDICIAL,STANDARD", + "PUBLICLAW,specific-access-admin,ADMIN,STANDARD", + "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS,STANDARD", + "PUBLICLAW,specific-access-ctsc,CTSC,STANDARD" + }) + void shouldReject_SpecificAccessRequestedBeginTimeInTheFutureV11(String jurisdiction, + String roleName, + String roleCategory, + String orgGrantType) { + Case caseDetails = caseMap.get(jurisdiction); + HashMap roleAssignmentAttributes = new HashMap<>(); + roleAssignmentAttributes.put("caseId", convertValueJsonNode(caseDetails.getId())); + roleAssignmentAttributes.put("requestedRole", convertValueJsonNode(roleName)); + + assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccess( + "specific-access", + "specific-access-requested", + RoleCategory.valueOf(roleCategory), + RoleType.CASE, + roleAssignmentAttributes, + Classification.RESTRICTED, + GrantType.BASIC, + Status.CREATE_REQUESTED, + "anyClient", + true, + "Access required for reasons", + ACTORID, + roleAssignmentAttributes.get("caseId").asText() + "/" + + roleAssignmentAttributes.get("requestedRole").asText() + "/" + ACTORID + ) + .build(); + + assignmentRequest.getRequestedRoles() + .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().plusHours(1L))); + + FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(featureFlag); + + HashMap existingAttributes = new HashMap<>(); + existingAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); + existingAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + + executeDroolRules(List.of(TestDataBuilder + .buildExistingRoleForDrools( + ACTORID, + "judge", + RoleCategory.valueOf(roleCategory), + existingAttributes, + Classification.PRIVATE, + GrantType.valueOf(orgGrantType), + RoleType.ORGANISATION + ))); + + assignmentRequest.getRequestedRoles().forEach(roleAssignment -> { + Assertions.assertEquals(Status.REJECTED, roleAssignment.getStatus()); + }); + } + @ParameterizedTest @CsvSource({ "CIVIL,specific-access-judiciary,JUDICIAL", @@ -234,44 +450,45 @@ void shouldGrantAccessFor_SpecificAccess_CaseAllocator(String caseJurisdiction, @ParameterizedTest @CsvSource({ - "IA,specific-access-judiciary,JUDICIAL", - "IA,specific-access-admin,ADMIN", - "IA,specific-access-legal-ops,LEGAL_OPERATIONS", - "SSCS,specific-access-judiciary,JUDICIAL", - "SSCS,specific-access-admin,ADMIN", - "SSCS,specific-access-legal-ops,LEGAL_OPERATIONS", - "CIVIL,specific-access-judiciary,JUDICIAL", - "CIVIL,specific-access-admin,ADMIN", - "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS", - "CIVIL,specific-access-ctsc,CTSC", - "PRIVATELAW,specific-access-judiciary,JUDICIAL", - "PRIVATELAW,specific-access-admin,ADMIN", - "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS", - "PUBLICLAW,specific-access-judiciary,JUDICIAL", - "PUBLICLAW,specific-access-admin,ADMIN", - "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS" + "IA,specific-access-judiciary,JUDICIAL,leadership-judge", + "IA,specific-access-admin,ADMIN,leadership-judge", + "IA,specific-access-ctsc,CTSC,leadership-judge", + "IA,specific-access-legal-ops,LEGAL_OPERATIONS,leadership-judge", + "CIVIL,specific-access-judiciary,JUDICIAL,leadership-judge", + "CIVIL,specific-access-admin,ADMIN,nbc-team-leader", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS,senior-tribunal-caseworker", + "CIVIL,specific-access-ctsc,CTSC,ctsc-team-leader", + "PRIVATELAW,specific-access-judiciary,JUDICIAL,specific-access-approver-judiciary", + "PRIVATELAW,specific-access-admin,ADMIN,specific-access-approver-admin", + "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS,specific-access-approver-legal-ops", + "PRIVATELAW,specific-access-ctsc,CTSC,specific-access-approver-ctsc", + "PUBLICLAW,specific-access-judiciary,JUDICIAL,specific-access-approver-judiciary", + "PUBLICLAW,specific-access-admin,ADMIN,specific-access-approver-admin", + "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS,specific-access-approver-legal-ops", + "PUBLICLAW,specific-access-ctsc,CTSC,specific-access-approver-ctsc" }) - void shouldGrantAccessFor_SpecificAccessGranted_XuiClient(String jurisdiction, String roleName, - String roleCategory) { + void shouldGrantAccessFor_SpecificAccess_CaseAllocatorBeginTimeNullV11(String caseJurisdiction, + String roleName, + String roleCategory, + String approver) { - Case caseDetails = caseMap.get(jurisdiction); + Case caseDetails = caseMap.get(caseJurisdiction); HashMap roleAssignmentAttributes = new HashMap<>(); roleAssignmentAttributes.put("caseId", convertValueJsonNode(caseDetails.getId())); - roleAssignmentAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); - roleAssignmentAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); roleAssignmentAttributes.put("requestedRole", convertValueJsonNode(roleName)); + roleAssignmentAttributes.put("jurisdiction", convertValueJsonNode(caseJurisdiction)); - assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccess( + assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccessGrant( "specific-access", - "specific-access-granted", + roleName, RoleCategory.valueOf(roleCategory), RoleType.CASE, roleAssignmentAttributes, - Classification.PRIVATE, - GrantType.BASIC, + Classification.RESTRICTED, + GrantType.SPECIFIC, Status.CREATE_REQUESTED, "xui_webapp", - true, + false, "Access required for reasons", ACTORID, roleAssignmentAttributes.get("caseId").asText() + "/" @@ -279,15 +496,419 @@ void shouldGrantAccessFor_SpecificAccessGranted_XuiClient(String jurisdiction, S ) .build(); - FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) - .status(true).build(); - featureFlags.add(featureFlag); + featureFlags.add(FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build()); HashMap existingAttributes = new HashMap<>(); - existingAttributes.put("jurisdiction", convertValueJsonNode(caseDetails.getJurisdiction())); - existingAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); - existingAttributes.put("requestedRole", convertValueJsonNode(roleName)); - + existingAttributes.put("jurisdiction", convertValueJsonNode(caseJurisdiction)); + existingAttributes.put("caseType", convertValueJsonNode(caseDetails.getCaseTypeId())); + existingAttributes.put("managedRoleCategory", convertValueJsonNode(roleCategory)); + existingAttributes.put("managedRole", convertValueJsonNode(roleName)); + if (!"IA".equals(caseJurisdiction)) { + existingAttributes.put("baseLocation", convertValueJsonNode("20262")); + existingAttributes.put("region", convertValueJsonNode("1")); + } + + executeDroolRules(List.of(TestDataBuilder + .buildExistingRoleForDrools( + TestDataBuilder.CASE_ALLOCATOR_ID, + approver, + RoleCategory.valueOf(roleCategory), + existingAttributes, + Classification.PRIVATE, + GrantType.STANDARD, + RoleType.ORGANISATION + ))); + + assignmentRequest.getRequestedRoles().forEach(roleAssignment -> { + Assertions.assertEquals(Status.APPROVED, roleAssignment.getStatus()); + Assertions.assertEquals(caseJurisdiction, roleAssignment.getAttributes().get("jurisdiction").asText()); + Assertions.assertEquals(caseDetails.getCaseTypeId(), + roleAssignment.getAttributes().get("caseType").asText()); + Assertions.assertEquals( + List.of("CCD", "ExUI", "SSIC", "RefData"), + roleAssignment.getAuthorisations() + ); + }); + } + + @ParameterizedTest + @CsvSource({ + "IA,specific-access-judiciary,JUDICIAL,leadership-judge", + "IA,specific-access-admin,ADMIN,leadership-judge", + "IA,specific-access-ctsc,CTSC,leadership-judge", + "IA,specific-access-legal-ops,LEGAL_OPERATIONS,leadership-judge", + "CIVIL,specific-access-judiciary,JUDICIAL,leadership-judge", + "CIVIL,specific-access-admin,ADMIN,nbc-team-leader", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS,senior-tribunal-caseworker", + "CIVIL,specific-access-ctsc,CTSC,ctsc-team-leader", + "PRIVATELAW,specific-access-judiciary,JUDICIAL,specific-access-approver-judiciary", + "PRIVATELAW,specific-access-admin,ADMIN,specific-access-approver-admin", + "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS,specific-access-approver-legal-ops", + "PRIVATELAW,specific-access-ctsc,CTSC,specific-access-approver-ctsc", + "PUBLICLAW,specific-access-judiciary,JUDICIAL,specific-access-approver-judiciary", + "PUBLICLAW,specific-access-admin,ADMIN,specific-access-approver-admin", + "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS,specific-access-approver-legal-ops", + "PUBLICLAW,specific-access-ctsc,CTSC,specific-access-approver-ctsc" + }) + void shouldGrantAccessFor_SpecificAccess_CaseAllocatorBeginTimeInThePastV11(String caseJurisdiction, + String roleName, + String roleCategory, + String approver) { + + Case caseDetails = caseMap.get(caseJurisdiction); + HashMap roleAssignmentAttributes = new HashMap<>(); + roleAssignmentAttributes.put("caseId", convertValueJsonNode(caseDetails.getId())); + roleAssignmentAttributes.put("requestedRole", convertValueJsonNode(roleName)); + roleAssignmentAttributes.put("jurisdiction", convertValueJsonNode(caseJurisdiction)); + + assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccessGrant( + "specific-access", + roleName, + RoleCategory.valueOf(roleCategory), + RoleType.CASE, + roleAssignmentAttributes, + Classification.RESTRICTED, + GrantType.SPECIFIC, + Status.CREATE_REQUESTED, + "xui_webapp", + false, + "Access required for reasons", + ACTORID, + roleAssignmentAttributes.get("caseId").asText() + "/" + + roleAssignmentAttributes.get("requestedRole").asText() + "/" + ACTORID + ) + .build(); + + assignmentRequest.getRequestedRoles() + .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().minusDays(1L))); + + featureFlags.add(FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build()); + + HashMap existingAttributes = new HashMap<>(); + existingAttributes.put("jurisdiction", convertValueJsonNode(caseJurisdiction)); + existingAttributes.put("caseType", convertValueJsonNode(caseDetails.getCaseTypeId())); + existingAttributes.put("managedRoleCategory", convertValueJsonNode(roleCategory)); + existingAttributes.put("managedRole", convertValueJsonNode(roleName)); + if (!"IA".equals(caseJurisdiction)) { + existingAttributes.put("baseLocation", convertValueJsonNode("20262")); + existingAttributes.put("region", convertValueJsonNode("1")); + } + + executeDroolRules(List.of(TestDataBuilder + .buildExistingRoleForDrools( + TestDataBuilder.CASE_ALLOCATOR_ID, + approver, + RoleCategory.valueOf(roleCategory), + existingAttributes, + Classification.PRIVATE, + GrantType.STANDARD, + RoleType.ORGANISATION + ))); + + assignmentRequest.getRequestedRoles().forEach(roleAssignment -> { + Assertions.assertEquals(Status.APPROVED, roleAssignment.getStatus()); + Assertions.assertEquals(caseJurisdiction, roleAssignment.getAttributes().get("jurisdiction").asText()); + Assertions.assertEquals(caseDetails.getCaseTypeId(), + roleAssignment.getAttributes().get("caseType").asText()); + Assertions.assertEquals( + List.of("CCD", "ExUI", "SSIC", "RefData"), + roleAssignment.getAuthorisations() + ); + }); + } + + @ParameterizedTest + @CsvSource({ + "IA,specific-access-judiciary,JUDICIAL,leadership-judge", + "IA,specific-access-admin,ADMIN,leadership-judge", + "IA,specific-access-ctsc,CTSC,leadership-judge", + "IA,specific-access-legal-ops,LEGAL_OPERATIONS,leadership-judge", + "CIVIL,specific-access-judiciary,JUDICIAL,leadership-judge", + "CIVIL,specific-access-admin,ADMIN,nbc-team-leader", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS,senior-tribunal-caseworker", + "CIVIL,specific-access-ctsc,CTSC,ctsc-team-leader", + "PRIVATELAW,specific-access-judiciary,JUDICIAL,specific-access-approver-judiciary", + "PRIVATELAW,specific-access-admin,ADMIN,specific-access-approver-admin", + "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS,specific-access-approver-legal-ops", + "PRIVATELAW,specific-access-ctsc,CTSC,specific-access-approver-ctsc", + "PUBLICLAW,specific-access-judiciary,JUDICIAL,specific-access-approver-judiciary", + "PUBLICLAW,specific-access-admin,ADMIN,specific-access-approver-admin", + "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS,specific-access-approver-legal-ops", + "PUBLICLAW,specific-access-ctsc,CTSC,specific-access-approver-ctsc" + }) + void shouldRejectAccessFor_SpecificAccess_CaseAllocatorBeginTimeInTheFutureV11(String caseJurisdiction, + String roleName, + String roleCategory, + String approver) { + + Case caseDetails = caseMap.get(caseJurisdiction); + HashMap roleAssignmentAttributes = new HashMap<>(); + roleAssignmentAttributes.put("caseId", convertValueJsonNode(caseDetails.getId())); + roleAssignmentAttributes.put("requestedRole", convertValueJsonNode(roleName)); + roleAssignmentAttributes.put("jurisdiction", convertValueJsonNode(caseJurisdiction)); + + assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccessGrant( + "specific-access", + roleName, + RoleCategory.valueOf(roleCategory), + RoleType.CASE, + roleAssignmentAttributes, + Classification.RESTRICTED, + GrantType.SPECIFIC, + Status.CREATE_REQUESTED, + "xui_webapp", + false, + "Access required for reasons", + ACTORID, + roleAssignmentAttributes.get("caseId").asText() + "/" + + roleAssignmentAttributes.get("requestedRole").asText() + "/" + ACTORID + ) + .build(); + + assignmentRequest.getRequestedRoles() + .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().plusDays(1L))); + + featureFlags.add(FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build()); + + HashMap existingAttributes = new HashMap<>(); + existingAttributes.put("jurisdiction", convertValueJsonNode(caseJurisdiction)); + existingAttributes.put("caseType", convertValueJsonNode(caseDetails.getCaseTypeId())); + existingAttributes.put("managedRoleCategory", convertValueJsonNode(roleCategory)); + existingAttributes.put("managedRole", convertValueJsonNode(roleName)); + if (!"IA".equals(caseJurisdiction)) { + existingAttributes.put("baseLocation", convertValueJsonNode("20262")); + existingAttributes.put("region", convertValueJsonNode("1")); + } + + executeDroolRules(List.of(TestDataBuilder + .buildExistingRoleForDrools( + TestDataBuilder.CASE_ALLOCATOR_ID, + approver, + RoleCategory.valueOf(roleCategory), + existingAttributes, + Classification.PRIVATE, + GrantType.STANDARD, + RoleType.ORGANISATION + ))); + + assignmentRequest.getRequestedRoles() + .forEach(roleAssignment -> Assertions.assertEquals(Status.REJECTED, roleAssignment.getStatus())); + } + + @ParameterizedTest + @CsvSource({ + "IA,specific-access-judiciary,JUDICIAL", + "IA,specific-access-admin,ADMIN", + "IA,specific-access-legal-ops,LEGAL_OPERATIONS", + "SSCS,specific-access-judiciary,JUDICIAL", + "SSCS,specific-access-admin,ADMIN", + "SSCS,specific-access-legal-ops,LEGAL_OPERATIONS", + "CIVIL,specific-access-judiciary,JUDICIAL", + "CIVIL,specific-access-admin,ADMIN", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS", + "CIVIL,specific-access-ctsc,CTSC", + "PRIVATELAW,specific-access-judiciary,JUDICIAL", + "PRIVATELAW,specific-access-admin,ADMIN", + "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS", + "PUBLICLAW,specific-access-judiciary,JUDICIAL", + "PUBLICLAW,specific-access-admin,ADMIN", + "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS" + }) + void shouldGrantAccessFor_SpecificAccessGranted_XuiClient(String jurisdiction, String roleName, + String roleCategory) { + + Case caseDetails = caseMap.get(jurisdiction); + HashMap roleAssignmentAttributes = new HashMap<>(); + roleAssignmentAttributes.put("caseId", convertValueJsonNode(caseDetails.getId())); + roleAssignmentAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); + roleAssignmentAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + roleAssignmentAttributes.put("requestedRole", convertValueJsonNode(roleName)); + + assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccess( + "specific-access", + "specific-access-granted", + RoleCategory.valueOf(roleCategory), + RoleType.CASE, + roleAssignmentAttributes, + Classification.PRIVATE, + GrantType.BASIC, + Status.CREATE_REQUESTED, + "xui_webapp", + true, + "Access required for reasons", + ACTORID, + roleAssignmentAttributes.get("caseId").asText() + "/" + + roleAssignmentAttributes.get("requestedRole").asText() + "/" + ACTORID + ) + .build(); + + FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + .status(true).build(); + featureFlags.add(featureFlag); + + HashMap existingAttributes = new HashMap<>(); + existingAttributes.put("jurisdiction", convertValueJsonNode(caseDetails.getJurisdiction())); + existingAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + existingAttributes.put("requestedRole", convertValueJsonNode(roleName)); + + executeDroolRules(List.of(TestDataBuilder + .buildExistingRoleForDrools( + "4772dc44-268f-4d0c-8f83-f0fb662aac84", + "specific-access-requested", + RoleCategory.valueOf(roleCategory), + existingAttributes, + Classification.PRIVATE, + GrantType.BASIC, + RoleType.CASE + ))); + + assignmentRequest.getRequestedRoles().forEach(roleAssignment -> { + Assertions.assertEquals(Status.APPROVED, roleAssignment.getStatus()); + Assertions.assertEquals(jurisdiction, roleAssignment.getAttributes().get("jurisdiction").asText()); + Assertions.assertEquals(caseDetails.getCaseTypeId(), + roleAssignment.getAttributes().get("caseType").asText()); + }); + } + + @ParameterizedTest + @CsvSource({ + "IA,specific-access-judiciary,JUDICIAL", + "IA,specific-access-admin,ADMIN", + "IA,specific-access-legal-ops,LEGAL_OPERATIONS", + "SSCS,specific-access-judiciary,JUDICIAL", + "SSCS,specific-access-admin,ADMIN", + "SSCS,specific-access-legal-ops,LEGAL_OPERATIONS", + "CIVIL,specific-access-judiciary,JUDICIAL", + "CIVIL,specific-access-admin,ADMIN", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS", + "CIVIL,specific-access-ctsc,CTSC", + "PRIVATELAW,specific-access-judiciary,JUDICIAL", + "PRIVATELAW,specific-access-admin,ADMIN", + "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS", + "PUBLICLAW,specific-access-judiciary,JUDICIAL", + "PUBLICLAW,specific-access-admin,ADMIN", + "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS" + }) + void shouldGrantAccessFor_SpecificAccessGranted_XuiClientBeginTimeNullV11(String jurisdiction, + String roleName, + String roleCategory) { + + Case caseDetails = caseMap.get(jurisdiction); + HashMap roleAssignmentAttributes = new HashMap<>(); + roleAssignmentAttributes.put("caseId", convertValueJsonNode(caseDetails.getId())); + roleAssignmentAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); + roleAssignmentAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + roleAssignmentAttributes.put("requestedRole", convertValueJsonNode(roleName)); + + assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccess( + "specific-access", + "specific-access-granted", + RoleCategory.valueOf(roleCategory), + RoleType.CASE, + roleAssignmentAttributes, + Classification.PRIVATE, + GrantType.BASIC, + Status.CREATE_REQUESTED, + "xui_webapp", + true, + "Access required for reasons", + ACTORID, + roleAssignmentAttributes.get("caseId").asText() + "/" + + roleAssignmentAttributes.get("requestedRole").asText() + "/" + ACTORID + ) + .build(); + + FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(featureFlag); + + HashMap existingAttributes = new HashMap<>(); + existingAttributes.put("jurisdiction", convertValueJsonNode(caseDetails.getJurisdiction())); + existingAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + existingAttributes.put("requestedRole", convertValueJsonNode(roleName)); + + executeDroolRules(List.of(TestDataBuilder + .buildExistingRoleForDrools( + "4772dc44-268f-4d0c-8f83-f0fb662aac84", + "specific-access-requested", + RoleCategory.valueOf(roleCategory), + existingAttributes, + Classification.PRIVATE, + GrantType.BASIC, + RoleType.CASE + ))); + + assignmentRequest.getRequestedRoles().forEach(roleAssignment -> { + Assertions.assertEquals(Status.APPROVED, roleAssignment.getStatus()); + Assertions.assertEquals(jurisdiction, roleAssignment.getAttributes().get("jurisdiction").asText()); + Assertions.assertEquals(caseDetails.getCaseTypeId(), + roleAssignment.getAttributes().get("caseType").asText()); + }); + } + + @ParameterizedTest + @CsvSource({ + "IA,specific-access-judiciary,JUDICIAL", + "IA,specific-access-admin,ADMIN", + "IA,specific-access-legal-ops,LEGAL_OPERATIONS", + "SSCS,specific-access-judiciary,JUDICIAL", + "SSCS,specific-access-admin,ADMIN", + "SSCS,specific-access-legal-ops,LEGAL_OPERATIONS", + "CIVIL,specific-access-judiciary,JUDICIAL", + "CIVIL,specific-access-admin,ADMIN", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS", + "CIVIL,specific-access-ctsc,CTSC", + "PRIVATELAW,specific-access-judiciary,JUDICIAL", + "PRIVATELAW,specific-access-admin,ADMIN", + "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS", + "PUBLICLAW,specific-access-judiciary,JUDICIAL", + "PUBLICLAW,specific-access-admin,ADMIN", + "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS" + }) + void shouldGrantAccessFor_SpecificAccessGranted_XuiClientBeginTimeInPastV11(String jurisdiction, + String roleName, + String roleCategory) { + + Case caseDetails = caseMap.get(jurisdiction); + HashMap roleAssignmentAttributes = new HashMap<>(); + roleAssignmentAttributes.put("caseId", convertValueJsonNode(caseDetails.getId())); + roleAssignmentAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); + roleAssignmentAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + roleAssignmentAttributes.put("requestedRole", convertValueJsonNode(roleName)); + + assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccess( + "specific-access", + "specific-access-granted", + RoleCategory.valueOf(roleCategory), + RoleType.CASE, + roleAssignmentAttributes, + Classification.PRIVATE, + GrantType.BASIC, + Status.CREATE_REQUESTED, + "xui_webapp", + true, + "Access required for reasons", + ACTORID, + roleAssignmentAttributes.get("caseId").asText() + "/" + + roleAssignmentAttributes.get("requestedRole").asText() + "/" + ACTORID + ) + .build(); + + assignmentRequest.getRequestedRoles() + .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().minusDays(1L))); + + FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(featureFlag); + + HashMap existingAttributes = new HashMap<>(); + existingAttributes.put("jurisdiction", convertValueJsonNode(caseDetails.getJurisdiction())); + existingAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + existingAttributes.put("requestedRole", convertValueJsonNode(roleName)); + executeDroolRules(List.of(TestDataBuilder .buildExistingRoleForDrools( "4772dc44-268f-4d0c-8f83-f0fb662aac84", @@ -307,6 +928,81 @@ void shouldGrantAccessFor_SpecificAccessGranted_XuiClient(String jurisdiction, S }); } + @ParameterizedTest + @CsvSource({ + "IA,specific-access-judiciary,JUDICIAL", + "IA,specific-access-admin,ADMIN", + "IA,specific-access-legal-ops,LEGAL_OPERATIONS", + "SSCS,specific-access-judiciary,JUDICIAL", + "SSCS,specific-access-admin,ADMIN", + "SSCS,specific-access-legal-ops,LEGAL_OPERATIONS", + "CIVIL,specific-access-judiciary,JUDICIAL", + "CIVIL,specific-access-admin,ADMIN", + "CIVIL,specific-access-legal-ops,LEGAL_OPERATIONS", + "CIVIL,specific-access-ctsc,CTSC", + "PRIVATELAW,specific-access-judiciary,JUDICIAL", + "PRIVATELAW,specific-access-admin,ADMIN", + "PRIVATELAW,specific-access-legal-ops,LEGAL_OPERATIONS", + "PUBLICLAW,specific-access-judiciary,JUDICIAL", + "PUBLICLAW,specific-access-admin,ADMIN", + "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS" + }) + void shouldRejectAccessFor_SpecificAccessGranted_XuiClientBeginTimeInFutureV11(String jurisdiction, + String roleName, + String roleCategory) { + + Case caseDetails = caseMap.get(jurisdiction); + HashMap roleAssignmentAttributes = new HashMap<>(); + roleAssignmentAttributes.put("caseId", convertValueJsonNode(caseDetails.getId())); + roleAssignmentAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); + roleAssignmentAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + roleAssignmentAttributes.put("requestedRole", convertValueJsonNode(roleName)); + + assignmentRequest = TestDataBuilder.buildAssignmentRequestSpecialAccess( + "specific-access", + "specific-access-granted", + RoleCategory.valueOf(roleCategory), + RoleType.CASE, + roleAssignmentAttributes, + Classification.PRIVATE, + GrantType.BASIC, + Status.CREATE_REQUESTED, + "xui_webapp", + true, + "Access required for reasons", + ACTORID, + roleAssignmentAttributes.get("caseId").asText() + "/" + + roleAssignmentAttributes.get("requestedRole").asText() + "/" + ACTORID + ) + .build(); + + assignmentRequest.getRequestedRoles() + .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().plusDays(1L))); + + FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(featureFlag); + + HashMap existingAttributes = new HashMap<>(); + existingAttributes.put("jurisdiction", convertValueJsonNode(caseDetails.getJurisdiction())); + existingAttributes.put("caseTypeId", convertValueJsonNode(caseDetails.getCaseTypeId())); + existingAttributes.put("requestedRole", convertValueJsonNode(roleName)); + + executeDroolRules(List.of(TestDataBuilder + .buildExistingRoleForDrools( + "4772dc44-268f-4d0c-8f83-f0fb662aac84", + "specific-access-requested", + RoleCategory.valueOf(roleCategory), + existingAttributes, + Classification.PRIVATE, + GrantType.BASIC, + RoleType.CASE + ))); + + assignmentRequest.getRequestedRoles() + .forEach(roleAssignment -> Assertions.assertEquals(Status.REJECTED, roleAssignment.getStatus())); + } + @ParameterizedTest @CsvSource({ "CIVIL,specific-access-judiciary,JUDICIAL", From 7fde3b0f3abf1b15a30725f48971754b105782f9 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 12 Jun 2023 15:01:32 +0100 Subject: [PATCH 02/23] AM-2794: Action dev review comments --- .../resources/features/F-011/F-011.feature | 86 ++++++++++++++++-- .../F-011/S-232.v1_1_rejected.td.json | 69 ++++++++++++++ .../civil/common/civil-specific-access.drl | 4 +- .../core/specific-access-global.drl | 14 ++- .../iac/common/iac-specific-access.drl | 4 +- .../drools/SpecificAccessDroolsTest.java | 90 ++++++++++++++----- 6 files changed, 233 insertions(+), 34 deletions(-) create mode 100644 src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index 00a56a9c6d..73c6ecefdf 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -5,7 +5,22 @@ Feature: F-011 : Create Specific Role Assignments Given an appropriate test context as detailed in the test data source @S-210 - @FeatureToggle(RAS:iac_specific_1_0=on) + @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) + Scenario: must successfully 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], + And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service], + 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-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 successfully 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], @@ -20,7 +35,22 @@ Feature: F-011 : Create Specific Role Assignments 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) + @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) + Scenario: must successfully create specific access denied by requester + 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-212_Org_Role_Creation], + And a successful call [to create role assignments for requested role] as in [S-212_Access_Requested], + When a request is prepared with appropriate values, + And the request [contains specific-access-judiciary case denied role assignment], + And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service], + 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]. + + @S-212.v1_1 + @FeatureToggle(RAS:iac_specific_1_1=on) Scenario: must successfully create specific access denied by requester Given a user with [an active IDAM profile with full permissions], And a user [Befta1 - who is the actor for requested role], @@ -32,10 +62,25 @@ 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) + @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) + Scenario: must successfully create 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_Access_Requested], + When a request is prepared with appropriate values, + And the request [contains specific-access-judiciary case granted role assignment], + And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service], + 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-231_DeleteDataForRoleAssignmentsForOrgRoles]. + + @S-231.v1_1 + @FeatureToggle(RAS:iac_specific_1_1=on) Scenario: must successfully create 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], @@ -50,7 +95,7 @@ Feature: F-011 : Create Specific Role Assignments 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) + @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) Scenario: must successfully create 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], @@ -64,3 +109,34 @@ 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 successfully create 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], + And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service], + 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-232_DeleteDataForRoleAssignmentsForOrgRoles], + And a successful call [to delete role assignments just created above] as in [S-232_DeleteDataForRoleAssignmentsForDeniedRole]. + + @S-232.v1_1_rejection + @FeatureToggle(RAS:iac_specific_1_1=on) + Scenario: must receive a Reject 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]. diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json new file mode 100644 index 0000000000..dfedcdc273 --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json @@ -0,0 +1,69 @@ +{ + "title": "must receive a Reject response when begin date is in the future for specific access denied role for PRIVATELAW admin", + "_guid_": "S-232.v1_1_rejection", + "_extends_": "F-011_Test_Data_Base", + "specs": [ + "Befta1 - who is the actor for requested role", + "contains specific-access-admin case denied role assignment with begin date in the future" + ], + + "request": { + "headers": { + "ServiceAuthorization": "${[scenarioContext][customValues][generateS2STokenForXui]}" + }, + "body": { + "roleRequest": { + "assignerId": "${[scenarioContext][testData][users][invokingUser][id]}", + "reference": "1607103938250138/specific-access-admin/${[scenarioContext][testData][users][invokingUser][id]}", + "process" : "specific-access", + "replaceExisting" : true + }, + "requestedRoles": [ + { + "_extends_": "RequestedRole", + "roleType" : "CASE", + "grantType" : "BASIC", + "classification" : "RESTRICTED", + "attributes": { + "caseId": "1607103938250138", + "requestedRole":"specific-access-admin" + }, + "roleName": "specific-access-requested", + "roleCategory": "ADMIN", + "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", + "beginTime": "2025-12-01T00:00Z", + "endTime" : "2026-03-02T00:00Z", + "readOnly": true, + "notes" : [{ + "userId": "${[scenarioContext][testData][users][invokingUser][id]}", + "time": "2022-01-01T00:00Z", + "comment": "Need Access to case number 1607103938250138 for a month" + }] + } + ] + } + }, + + "expectedResponse": { + "responseCode": 422, + "responseMessage": "Unprocessable Entity", + "headers": { + "Content-Length": "[[ANYTHING_PRESENT]]", + "Content-Type": "application/json" + }, + "body": { + "roleAssignmentResponse": { + "roleRequest": { + "_extends_": "ResponseRoleRequest", + "status": "REJECTED" + }, + "requestedRoles": [ + { + "_extends_": "ResponseRequestedRole", + "status": "REJECTED" + } + ] + } + } + } +} diff --git a/src/main/resources/validationrules/civil/common/civil-specific-access.drl b/src/main/resources/validationrules/civil/common/civil-specific-access.drl index 31eeda91e9..e5b57fecaa 100644 --- a/src/main/resources/validationrules/civil/common/civil-specific-access.drl +++ b/src/main/resources/validationrules/civil/common/civil-specific-access.drl @@ -20,11 +20,13 @@ import java.time.temporal.ChronoUnit; /* * All services: "specific-access-" case creation and leadership-judge as a assigner + * TODO: rule to be retired as part of AM-2824 once IAC_SPECIFIC_1_1 enabled in prod */ rule "civil_create_specific_access_case_role" when $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + $f1 : FeatureFlag(!status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) $rq: Request( // The assigner must be the current user. assignerId == authenticatedUserId, @@ -89,7 +91,6 @@ end; /* * All services: "specific-access-" case creation and leadership-judge as a assigner - * Added for CR:AM2794 */ rule "civil_create_specific_access_case_role_v11" @@ -116,6 +117,7 @@ when attributes["caseId"] != null && $caseId : attributes["caseId"].asText(), // Only applies to CIVIL. attributes["jurisdiction"] == null || attributes["jurisdiction"].asText() == "CIVIL", + // extra check added for CR:AM2794 to ensure no future specific access requests beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) $c: Case( id == $caseId, diff --git a/src/main/resources/validationrules/core/specific-access-global.drl b/src/main/resources/validationrules/core/specific-access-global.drl index be9c5875a8..1281cc5295 100644 --- a/src/main/resources/validationrules/core/specific-access-global.drl +++ b/src/main/resources/validationrules/core/specific-access-global.drl @@ -25,10 +25,12 @@ import java.time.temporal.ChronoUnit; /* * All services: "specific-access-requested" case roles self creation user + * TODO: rule to be retired as part of AM-2824 once IAC_SPECIFIC_1_1 enabled in prod */ rule "create_specific_access_requested_case_role_for_self" when $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + $f1 : FeatureFlag(!status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) $rq: Request( // The assigner must be the current user. assignerId == authenticatedUserId, @@ -62,7 +64,7 @@ then end; /* - * All services: "specific-access-requested" case roles self creation user. added for CR:AM2794 + * All services: "specific-access-requested" case roles self creation user */ rule "create_specific_access_requested_case_role_for_self_v11" when @@ -80,6 +82,7 @@ when readOnly == true, notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ attributes["caseId"] != null && $caseId : attributes["caseId"].asText(), + // extra check added for CR:AM2794 to ensure no future specific access requests beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) $c: Case( id == $caseId) @@ -152,10 +155,12 @@ end; /* * All services: "specific-access" case approval or denied roles + * TODO: rule to be retired as part of AM-2824 once IAC_SPECIFIC_1_1 enabled in prod */ rule "create_specific_access_granted_or_denied_case_role" when $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + $f1 : FeatureFlag(!status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) $rq: Request( clientId == "xui_webapp", process == "specific-access", @@ -188,7 +193,7 @@ then end; /* - * All services: "specific-access" case approval or denied roles. added for CR:AM2794 + * All services: "specific-access" case approval or denied roles */ rule "create_specific_access_granted_or_denied_case_role_v11" when @@ -205,6 +210,7 @@ when endTime != null, notes != null && notes.size > 0 && notes.toString().length() > 5, /* Make sure there is at least one note with content in it */ attributes["caseId"] != null && $caseId : attributes["caseId"].asText(), + // extra check added for CR:AM2794 to ensure no future specific access requests beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) $c: Case( id == $caseId) @@ -248,11 +254,13 @@ end; /* * All services: "specific-access-" case creation and specific_access_approver as a assigner + * TODO: rule to be retired as part of AM-2824 once IAC_SPECIFIC_1_1 enabled in prod */ rule "specific_access_approver_create_specific_access_case_role" when $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + $f1 : FeatureFlag(!status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) $rq: Request( // The assigner must be the current user. assignerId == authenticatedUserId, @@ -313,7 +321,6 @@ end; /* * All services: "specific-access-" case creation and specific_access_approver as a assigner - * Added for CR:AM2794 */ rule "specific_access_approver_create_specific_access_case_role_v11" @@ -340,6 +347,7 @@ when // Add all the jurisdiction Ids of the on-boarded services // Do we really need to constrain the jurisdiction here? attributes["jurisdiction"] != null && $jurisdiction : attributes["jurisdiction"].asText() && attributes["jurisdiction"].asText() in ("IA","SSCS","CIVIL","PRIVATELAW","PUBLICLAW"), + // extra check added for CR:AM2794 to ensure no future specific access requests beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) $c: Case( id == $caseId, diff --git a/src/main/resources/validationrules/iac/common/iac-specific-access.drl b/src/main/resources/validationrules/iac/common/iac-specific-access.drl index 7c040a1888..bcde0e7782 100644 --- a/src/main/resources/validationrules/iac/common/iac-specific-access.drl +++ b/src/main/resources/validationrules/iac/common/iac-specific-access.drl @@ -20,11 +20,13 @@ import java.time.temporal.ChronoUnit; /* * All services: "specific-access-" case creation and leadership-judge as a assigner + * TODO: rule to be retired as part of AM-2824 once IAC_SPECIFIC_1_1 enabled in prod */ rule "iac_create_specific_access_case_role" when $f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + $f1 : FeatureFlag(!status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) $rq: Request( // The assigner must be the current user. assignerId == authenticatedUserId, @@ -81,7 +83,6 @@ end; /* * All services: "specific-access-" case creation and leadership-judge as a assigner - * Added for CR:AM2794 */ rule "iac_create_specific_access_case_role_v11" @@ -105,6 +106,7 @@ when attributes["caseId"] != null && $caseId : attributes["caseId"].asText(), // Only applies to IAC attributes["jurisdiction"] == null || attributes["jurisdiction"].asText() == "IA", + // extra check added for CR:AM2794 to ensure no future specific access requests beginTime == null || !beginTime.isAfter(ZonedDateTime.now())) $c: Case( id == $caseId, diff --git a/src/test/java/uk/gov/hmcts/reform/roleassignment/domain/service/drools/SpecificAccessDroolsTest.java b/src/test/java/uk/gov/hmcts/reform/roleassignment/domain/service/drools/SpecificAccessDroolsTest.java index 7ff1061368..22dbb182d7 100644 --- a/src/test/java/uk/gov/hmcts/reform/roleassignment/domain/service/drools/SpecificAccessDroolsTest.java +++ b/src/test/java/uk/gov/hmcts/reform/roleassignment/domain/service/drools/SpecificAccessDroolsTest.java @@ -45,6 +45,7 @@ class SpecificAccessDroolsTest extends DroolBase { "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS,STANDARD", "PUBLICLAW,specific-access-ctsc,CTSC,STANDARD" }) + // TODO: test to be retired as part of AM-2824 once IAC_SPECIFIC_1_1 enabled in prod void shouldCreate_SpecificAccessRequested(String jurisdiction, String roleName, String roleCategory, String orgGrantType) { Case caseDetails = caseMap.get(jurisdiction); @@ -70,9 +71,12 @@ void shouldCreate_SpecificAccessRequested(String jurisdiction, String roleName, ) .build(); - FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) .status(true).build(); - featureFlags.add(featureFlag); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(false).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); @@ -141,9 +145,12 @@ void shouldCreate_SpecificAccessRequestedBeginTimeNullV11(String jurisdiction, ) .build(); - FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) .status(true).build(); - featureFlags.add(featureFlag); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); @@ -215,9 +222,12 @@ void shouldCreate_SpecificAccessRequestedBeginTimeInThePastV11(String jurisdicti assignmentRequest.getRequestedRoles() .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().minusDays(1L))); - FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) .status(true).build(); - featureFlags.add(featureFlag); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); @@ -289,9 +299,12 @@ void shouldReject_SpecificAccessRequestedBeginTimeInTheFutureV11(String jurisdic assignmentRequest.getRequestedRoles() .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().plusHours(1L))); - FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) .status(true).build(); - featureFlags.add(featureFlag); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(jurisdiction)); @@ -385,6 +398,7 @@ void shouldCreate_SpecificAccessDenied(String jurisdiction, String roleName, Str "PUBLICLAW,specific-access-legal-ops,LEGAL_OPERATIONS,specific-access-approver-legal-ops", "PUBLICLAW,specific-access-ctsc,CTSC,specific-access-approver-ctsc" }) + // TODO: test to be retired as part of AM-2824 once IAC_SPECIFIC_1_1 enabled in prod void shouldGrantAccessFor_SpecificAccess_CaseAllocator(String caseJurisdiction, String roleName, String roleCategory, String approver) { @@ -412,8 +426,12 @@ void shouldGrantAccessFor_SpecificAccess_CaseAllocator(String caseJurisdiction, ) .build(); - featureFlags.add(FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) - .status(true).build()); + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(false).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(caseJurisdiction)); @@ -496,8 +514,12 @@ void shouldGrantAccessFor_SpecificAccess_CaseAllocatorBeginTimeNullV11(String ca ) .build(); - featureFlags.add(FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) - .status(true).build()); + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(caseJurisdiction)); @@ -583,8 +605,12 @@ void shouldGrantAccessFor_SpecificAccess_CaseAllocatorBeginTimeInThePastV11(Stri assignmentRequest.getRequestedRoles() .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().minusDays(1L))); - featureFlags.add(FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) - .status(true).build()); + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(caseJurisdiction)); @@ -670,8 +696,12 @@ void shouldRejectAccessFor_SpecificAccess_CaseAllocatorBeginTimeInTheFutureV11(S assignmentRequest.getRequestedRoles() .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().plusDays(1L))); - featureFlags.add(FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) - .status(true).build()); + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(caseJurisdiction)); @@ -745,9 +775,12 @@ void shouldGrantAccessFor_SpecificAccessGranted_XuiClient(String jurisdiction, S ) .build(); - FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) .status(true).build(); - featureFlags.add(featureFlag); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(caseDetails.getJurisdiction())); @@ -821,9 +854,12 @@ void shouldGrantAccessFor_SpecificAccessGranted_XuiClientBeginTimeNullV11(String ) .build(); - FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) .status(true).build(); - featureFlags.add(featureFlag); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(caseDetails.getJurisdiction())); @@ -900,9 +936,12 @@ void shouldGrantAccessFor_SpecificAccessGranted_XuiClientBeginTimeInPastV11(Stri assignmentRequest.getRequestedRoles() .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().minusDays(1L))); - FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) .status(true).build(); - featureFlags.add(featureFlag); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(caseDetails.getJurisdiction())); @@ -979,9 +1018,12 @@ void shouldRejectAccessFor_SpecificAccessGranted_XuiClientBeginTimeInFutureV11(S assignmentRequest.getRequestedRoles() .forEach(roleAssignment -> roleAssignment.setBeginTime(ZonedDateTime.now().plusDays(1L))); - FeatureFlag featureFlag = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + FeatureFlag iacSpecific10 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue()) .status(true).build(); - featureFlags.add(featureFlag); + featureFlags.add(iacSpecific10); + FeatureFlag iacSpecific11 = FeatureFlag.builder().flagName(FeatureFlagEnum.IAC_SPECIFIC_1_1.getValue()) + .status(true).build(); + featureFlags.add(iacSpecific11); HashMap existingAttributes = new HashMap<>(); existingAttributes.put("jurisdiction", convertValueJsonNode(caseDetails.getJurisdiction())); From 41022e2ede15e9ce64e7238c987ac155ca0860cf Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 12 Jun 2023 15:26:15 +0100 Subject: [PATCH 03/23] AM-2794: Update befta test data files --- .../features/F-011/S-210.v1_1.td.json | 4 ++++ .../features/F-011/S-212.v1_1.td.json | 4 ++++ .../features/F-011/S-231.v1_1.td.json | 4 ++++ .../features/F-011/S-232.v1_1.td.json | 4 ++++ .../F-011/S-232.v1_1_rejected.td.json | 23 ++++++++++++++++++- 5 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/functionalTest/resources/features/F-011/S-210.v1_1.td.json create mode 100644 src/functionalTest/resources/features/F-011/S-212.v1_1.td.json create mode 100644 src/functionalTest/resources/features/F-011/S-231.v1_1.td.json create mode 100644 src/functionalTest/resources/features/F-011/S-232.v1_1.td.json diff --git a/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json new file mode 100644 index 0000000000..d1e7cc9892 --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json @@ -0,0 +1,4 @@ +{ + "_guid_": "S-210.v1_1", + "_extends_": "S-210" +} diff --git a/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json new file mode 100644 index 0000000000..0572f4ec2a --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json @@ -0,0 +1,4 @@ +{ + "_guid_": "S-212.v1_1", + "_extends_": "S-212" +} diff --git a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json new file mode 100644 index 0000000000..ff753d466a --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json @@ -0,0 +1,4 @@ +{ + "_guid_": "S-231.v1_1", + "_extends_": "S-231" +} diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json new file mode 100644 index 0000000000..49bb690f48 --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json @@ -0,0 +1,4 @@ +{ + "_guid_": "S-232.v1_1", + "_extends_": "S-232" +} diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json index dfedcdc273..5b9062e304 100644 --- a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json +++ b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json @@ -60,7 +60,28 @@ "requestedRoles": [ { "_extends_": "ResponseRequestedRole", - "status": "REJECTED" + "process" : "specific-access", + "actorId": "${[scenarioContext][testData][request][body][requestedRoles][0][actorId]}", + "roleName": "${[scenarioContext][testData][request][body][requestedRoles][0][roleName]}", + "roleCategory": "${[scenarioContext][testData][request][body][requestedRoles][0][roleCategory]}", + "roleType": "${[scenarioContext][testData][request][body][requestedRoles][0][roleType]}", + "grantType": "${[scenarioContext][testData][request][body][requestedRoles][0][grantType]}", + "classification" : "${[scenarioContext][testData][request][body][requestedRoles][0][classification]}", + "readOnly": true, + "attributes": { + "requestedRole":"specific-access-admin", + "caseId": "1607103938250138", + "jurisdiction" : "IA", + "caseType" : "Asylum", + "substantive" : "N" + }, + "notes" : [{ + "userId": "${[scenarioContext][testData][users][invokingUser][id]}", + "time": "2022-01-01T00:00Z", + "comment": "Need Access to case number 1607103938250138 for a month" + } + ], + "status" : "REJECTED" } ] } From baf3895b5c5ab91522d7ba19ff971628a58d39d0 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 12 Jun 2023 15:40:42 +0100 Subject: [PATCH 04/23] AM-2794: Update data file for 232.v1_1_rejected --- .../resources/features/F-011/S-232.v1_1_rejected.td.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json index 5b9062e304..ca1cbcdd5d 100644 --- a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json +++ b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json @@ -55,6 +55,7 @@ "roleAssignmentResponse": { "roleRequest": { "_extends_": "ResponseRoleRequest", + "replaceExisting" : true, "status": "REJECTED" }, "requestedRoles": [ @@ -71,9 +72,7 @@ "attributes": { "requestedRole":"specific-access-admin", "caseId": "1607103938250138", - "jurisdiction" : "IA", - "caseType" : "Asylum", - "substantive" : "N" + "jurisdiction" : "IA" }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", From 9d02500fb15d9026b1e888cbebf21fa01ee318ce Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 12 Jun 2023 17:05:27 +0100 Subject: [PATCH 05/23] AM-2794: Request roles value not important as rejected status is the focus of test --- .../F-011/S-232.v1_1_rejected.td.json | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json index ca1cbcdd5d..7a531412eb 100644 --- a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json +++ b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json @@ -58,31 +58,7 @@ "replaceExisting" : true, "status": "REJECTED" }, - "requestedRoles": [ - { - "_extends_": "ResponseRequestedRole", - "process" : "specific-access", - "actorId": "${[scenarioContext][testData][request][body][requestedRoles][0][actorId]}", - "roleName": "${[scenarioContext][testData][request][body][requestedRoles][0][roleName]}", - "roleCategory": "${[scenarioContext][testData][request][body][requestedRoles][0][roleCategory]}", - "roleType": "${[scenarioContext][testData][request][body][requestedRoles][0][roleType]}", - "grantType": "${[scenarioContext][testData][request][body][requestedRoles][0][grantType]}", - "classification" : "${[scenarioContext][testData][request][body][requestedRoles][0][classification]}", - "readOnly": true, - "attributes": { - "requestedRole":"specific-access-admin", - "caseId": "1607103938250138", - "jurisdiction" : "IA" - }, - "notes" : [{ - "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", - "comment": "Need Access to case number 1607103938250138 for a month" - } - ], - "status" : "REJECTED" - } - ] + "requestedRoles": "[[ANYTHING_PRESENT]]" } } } From 4494b48198a34bb825c3dd883005ffd17c5b99d7 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 12 Jun 2023 17:43:50 +0100 Subject: [PATCH 06/23] AM-2794: Ensure role is removed in clean up so doesn't impact other tests --- src/functionalTest/resources/features/F-011/F-011.feature | 3 ++- .../resources/features/F-011/S-232.v1_1_rejected.td.json | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index 73c6ecefdf..f9d06ee08b 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -139,4 +139,5 @@ Feature: F-011 : Create Specific Role Assignments 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_DeleteDataForRoleAssignmentsForOrgRoles], + And a successful call [to delete role assignments just created above] as in [S-232_DeleteDataForRoleAssignmentsForDeniedRole]. diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json index 7a531412eb..f911f43b96 100644 --- a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json +++ b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json @@ -13,7 +13,7 @@ }, "body": { "roleRequest": { - "assignerId": "${[scenarioContext][testData][users][invokingUser][id]}", + "assignerId": "${[scenarioContext][testData][users][befta4][id]}", "reference": "1607103938250138/specific-access-admin/${[scenarioContext][testData][users][invokingUser][id]}", "process" : "specific-access", "replaceExisting" : true @@ -23,12 +23,12 @@ "_extends_": "RequestedRole", "roleType" : "CASE", "grantType" : "BASIC", - "classification" : "RESTRICTED", + "classification" : "PRIVATE", "attributes": { "caseId": "1607103938250138", "requestedRole":"specific-access-admin" }, - "roleName": "specific-access-requested", + "roleName": "specific-access-denied", "roleCategory": "ADMIN", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", "beginTime": "2025-12-01T00:00Z", From ceafac9eb313a2c5792fc4b1b0f50847b3fd1883 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 12 Jun 2023 18:04:34 +0100 Subject: [PATCH 07/23] AM-2794: Revert rejected scenarios --- .../resources/features/F-011/F-011.feature | 85 +------------------ .../features/F-011/S-210.v1_1.td.json | 4 - .../features/F-011/S-212.v1_1.td.json | 4 - .../features/F-011/S-231.v1_1.td.json | 4 - .../features/F-011/S-232.v1_1.td.json | 4 - .../F-011/S-232.v1_1_rejected.td.json | 65 -------------- 6 files changed, 4 insertions(+), 162 deletions(-) delete mode 100644 src/functionalTest/resources/features/F-011/S-210.v1_1.td.json delete mode 100644 src/functionalTest/resources/features/F-011/S-212.v1_1.td.json delete mode 100644 src/functionalTest/resources/features/F-011/S-231.v1_1.td.json delete mode 100644 src/functionalTest/resources/features/F-011/S-232.v1_1.td.json delete mode 100644 src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index f9d06ee08b..3f98d7073c 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -5,22 +5,7 @@ Feature: F-011 : Create Specific Role Assignments Given an appropriate test context as detailed in the test data source @S-210 - @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) - Scenario: must successfully 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], - And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service], - 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-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) + @FeatureToggle(RAS:iac_specific_1_0=on) Scenario: must successfully 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], @@ -35,22 +20,7 @@ Feature: F-011 : Create Specific Role Assignments 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) @FeatureToggle(RAS:iac_specific_1_1=off) - Scenario: must successfully create specific access denied by requester - 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-212_Org_Role_Creation], - And a successful call [to create role assignments for requested role] as in [S-212_Access_Requested], - When a request is prepared with appropriate values, - And the request [contains specific-access-judiciary case denied role assignment], - And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service], - 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]. - - @S-212.v1_1 - @FeatureToggle(RAS:iac_specific_1_1=on) + @FeatureToggle(RAS:iac_specific_1_0=on) Scenario: must successfully create specific access denied by requester Given a user with [an active IDAM profile with full permissions], And a user [Befta1 - who is the actor for requested role], @@ -65,22 +35,7 @@ Feature: F-011 : Create Specific Role Assignments 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) @FeatureToggle(RAS:iac_specific_1_1=off) - Scenario: must successfully create 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_Access_Requested], - When a request is prepared with appropriate values, - And the request [contains specific-access-judiciary case granted role assignment], - And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service], - 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-231_DeleteDataForRoleAssignmentsForOrgRoles]. - - @S-231.v1_1 - @FeatureToggle(RAS:iac_specific_1_1=on) + @FeatureToggle(RAS:iac_specific_1_0=on) Scenario: must successfully create 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], @@ -95,7 +50,7 @@ Feature: F-011 : Create Specific Role Assignments 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) @FeatureToggle(RAS:iac_specific_1_1=off) + @FeatureToggle(RAS:iac_specific_1_0=on) Scenario: must successfully create 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], @@ -109,35 +64,3 @@ 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 successfully create 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], - And it is submitted to call the [Create Role Assignments] operation of [Role Assignments Service], - 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-232_DeleteDataForRoleAssignmentsForOrgRoles], - And a successful call [to delete role assignments just created above] as in [S-232_DeleteDataForRoleAssignmentsForDeniedRole]. - - @S-232.v1_1_rejection - @FeatureToggle(RAS:iac_specific_1_1=on) - Scenario: must receive a Reject 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]. diff --git a/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json deleted file mode 100644 index d1e7cc9892..0000000000 --- a/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "_guid_": "S-210.v1_1", - "_extends_": "S-210" -} diff --git a/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json deleted file mode 100644 index 0572f4ec2a..0000000000 --- a/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "_guid_": "S-212.v1_1", - "_extends_": "S-212" -} diff --git a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json deleted file mode 100644 index ff753d466a..0000000000 --- a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "_guid_": "S-231.v1_1", - "_extends_": "S-231" -} diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json deleted file mode 100644 index 49bb690f48..0000000000 --- a/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "_guid_": "S-232.v1_1", - "_extends_": "S-232" -} diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json deleted file mode 100644 index f911f43b96..0000000000 --- a/src/functionalTest/resources/features/F-011/S-232.v1_1_rejected.td.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "title": "must receive a Reject response when begin date is in the future for specific access denied role for PRIVATELAW admin", - "_guid_": "S-232.v1_1_rejection", - "_extends_": "F-011_Test_Data_Base", - "specs": [ - "Befta1 - who is the actor for requested role", - "contains specific-access-admin case denied role assignment with begin date in the future" - ], - - "request": { - "headers": { - "ServiceAuthorization": "${[scenarioContext][customValues][generateS2STokenForXui]}" - }, - "body": { - "roleRequest": { - "assignerId": "${[scenarioContext][testData][users][befta4][id]}", - "reference": "1607103938250138/specific-access-admin/${[scenarioContext][testData][users][invokingUser][id]}", - "process" : "specific-access", - "replaceExisting" : true - }, - "requestedRoles": [ - { - "_extends_": "RequestedRole", - "roleType" : "CASE", - "grantType" : "BASIC", - "classification" : "PRIVATE", - "attributes": { - "caseId": "1607103938250138", - "requestedRole":"specific-access-admin" - }, - "roleName": "specific-access-denied", - "roleCategory": "ADMIN", - "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "beginTime": "2025-12-01T00:00Z", - "endTime" : "2026-03-02T00:00Z", - "readOnly": true, - "notes" : [{ - "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", - "comment": "Need Access to case number 1607103938250138 for a month" - }] - } - ] - } - }, - - "expectedResponse": { - "responseCode": 422, - "responseMessage": "Unprocessable Entity", - "headers": { - "Content-Length": "[[ANYTHING_PRESENT]]", - "Content-Type": "application/json" - }, - "body": { - "roleAssignmentResponse": { - "roleRequest": { - "_extends_": "ResponseRoleRequest", - "replaceExisting" : true, - "status": "REJECTED" - }, - "requestedRoles": "[[ANYTHING_PRESENT]]" - } - } - } -} From 01d1c56f837ddd6fe86ec51dc254b71c14580a5b Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 13 Jun 2023 09:24:12 +0100 Subject: [PATCH 08/23] AM-2794: Add private law specific access denied test --- .../resources/features/F-011/F-011.feature | 16 +++++ .../features/F-011/S-232.v1_1.td.json | 65 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 src/functionalTest/resources/features/F-011/S-232.v1_1.td.json diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index 3f98d7073c..96292cdef7 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -64,3 +64,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]. diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json new file mode 100644 index 0000000000..c2f9b3895a --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json @@ -0,0 +1,65 @@ +{ + "title": "must receive a Reject response when begin date is in the future for specific access denied role for PRIVATELAW admin", + "_guid_": "S-232.v1_1", + "_extends_": "F-011_Test_Data_Base", + "specs": [ + "Befta1 - who is the actor for requested role", + "contains specific-access-admin case denied role assignment with begin date in the future" + ], + + "request": { + "headers": { + "ServiceAuthorization": "${[scenarioContext][customValues][generateS2STokenForXui]}" + }, + "body": { + "roleRequest": { + "assignerId": "${[scenarioContext][testData][users][befta4][id]}", + "reference": "1607103938250138/specific-access-admin/${[scenarioContext][testData][users][invokingUser][id]}", + "process" : "specific-access", + "replaceExisting" : true + }, + "requestedRoles": [ + { + "_extends_": "RequestedRole", + "roleType" : "CASE", + "grantType" : "BASIC", + "classification" : "PRIVATE", + "attributes": { + "caseId": "1607103938250138", + "requestedRole":"specific-access-admin" + }, + "roleName": "specific-access-denied", + "roleCategory": "ADMIN", + "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", + "beginTime": "2025-12-01T00:00Z", + "endTime" : "2026-01-01T00:00Z", + "readOnly": true, + "notes" : [{ + "userId": "${[scenarioContext][testData][users][invokingUser][id]}", + "time": "2022-01-01T00:00Z", + "comment": "Need Access to case number 1607103938250138 for a month" + }] + } + ] + } + }, + + "expectedResponse": { + "responseCode": 422, + "responseMessage": "Unprocessable Entity", + "headers": { + "Content-Length": "[[ANYTHING_PRESENT]]", + "Content-Type": "application/json" + }, + "body": { + "roleAssignmentResponse": { + "roleRequest": { + "_extends_": "ResponseRoleRequest", + "replaceExisting" : true, + "status": "REJECTED" + }, + "requestedRoles": "[[ANYTHING_PRESENT]]" + } + } + } +} From c2e659f1cedeedb94614ebc8f6160c8eed1f081a Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 13 Jun 2023 09:58:12 +0100 Subject: [PATCH 09/23] AM-2794: Add civil judiciary specific access granted role fta test --- .../resources/features/F-011/F-011.feature | 15 ++++ .../features/F-011/S-210.v1_1.td.json | 1 + .../features/F-011/S-212.v1_1.td.json | 1 + .../features/F-011/S-231.v1_1.td.json | 87 +++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 src/functionalTest/resources/features/F-011/S-210.v1_1.td.json create mode 100644 src/functionalTest/resources/features/F-011/S-212.v1_1.td.json create mode 100644 src/functionalTest/resources/features/F-011/S-231.v1_1.td.json diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index 96292cdef7..084179239a 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -49,6 +49,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 Reject 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_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 diff --git a/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json @@ -0,0 +1 @@ +{} diff --git a/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json @@ -0,0 +1 @@ +{} diff --git a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json new file mode 100644 index 0000000000..ff8f207813 --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json @@ -0,0 +1,87 @@ +{ + "title": "must receive a Reject response when begin date is in the future for specific access granted role for CIVIL judiciary", + "_guid_": "S-231.v1_1", + "_extends_": "F-011_Test_Data_Base", + "specs": [ + "Befta1 - who is the actor for requested role", + "contains specific-access-judiciary case granted role assignment with begin date in the future" + ], + + "request": { + "headers": { + "ServiceAuthorization": "${[scenarioContext][customValues][generateS2STokenForXui]}" + }, + "body": { + "roleRequest": { + "assignerId": "${[scenarioContext][testData][users][invokingUser][id]}", + "reference": "1607103938250138/specific-access-judiciary/${[scenarioContext][testData][users][befta4][id]}", + "process" : "specific-access", + "replaceExisting" : true + }, + "requestedRoles": [ + { + "_extends_": "RequestedRole", + "roleType" : "CASE", + "grantType" : "BASIC", + "classification" : "PRIVATE", + "attributes": { + "caseId": "1607103938250138", + "requestedRole":"specific-access-judiciary" + }, + "roleName": "specific-access-granted", + "roleCategory": "JUDICIAL", + "actorId": "${[scenarioContext][testData][users][befta4][id]}", + "beginTime": "2025-12-01T00:00Z", + "endTime" : "2026-01-01T00:00Z", + "readOnly": true, + "notes" : [{ + "userId": "${[scenarioContext][testData][users][invokingUser][id]}", + "time": "2022-01-01T00:00Z", + "comment": "Need Access to case number 1607103938250138 for a month in the future" + }] + }, + { + "_extends_": "RequestedRole", + "roleType" : "CASE", + "grantType" : "SPECIFIC", + "classification" : "RESTRICTED", + "attributes": { + "caseId": "1607103938250138", + "requestedRole":"specific-access-judiciary" + }, + "roleName" : "specific-access-judiciary", + "roleCategory" : "JUDICIAL", + "actorId" : "${[scenarioContext][testData][users][befta4][id]}", + "endTime" : "2024-03-02T00:00Z", + "readOnly": true, + "notes" : [ + { + "userId": "${[scenarioContext][testData][users][invokingUser][id]}", + "time": "2022-01-01T00:00Z", + "comment": "Need Access to case number 1607103938250138 for a month" + } + ] + } + ] + } + }, + + "expectedResponse": { + "responseCode": 422, + "responseMessage": "Unprocessable Entity", + "headers": { + "Content-Length": "[[ANYTHING_PRESENT]]", + "Content-Type": "application/json" + }, + "body": { + "roleAssignmentResponse": { + "roleRequest": { + "_extends_": "ResponseRoleRequest", + "replaceExisting" : true, + "status": "REJECTED" + }, + "requestedRoles": "[[ANYTHING_PRESENT]]" + } + } + } +} From e2371a1ffc9f7158633e16a8ae82797c8e418fa2 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 13 Jun 2023 10:26:50 +0100 Subject: [PATCH 10/23] AM-2794: Clean up S-231.v1_1 fta test --- src/functionalTest/resources/features/F-011/F-011.feature | 2 +- src/functionalTest/resources/features/F-011/S-210.v1_1.td.json | 1 - src/functionalTest/resources/features/F-011/S-212.v1_1.td.json | 1 - src/functionalTest/resources/features/F-011/S-231.v1_1.td.json | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 src/functionalTest/resources/features/F-011/S-210.v1_1.td.json delete mode 100644 src/functionalTest/resources/features/F-011/S-212.v1_1.td.json diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index 084179239a..ad6a4b437e 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -51,7 +51,7 @@ Feature: F-011 : Create Specific Role Assignments @S-231.v1_1 @FeatureToggle(RAS:iac_specific_1_1=on) - Scenario: must receive a Reject response when begin date is in the future for specific access granted role for CIVIL judiciary + 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], diff --git a/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json index ff8f207813..eb333ec233 100644 --- a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json +++ b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json @@ -1,5 +1,5 @@ { - "title": "must receive a Reject response when begin date is in the future for specific access granted role for CIVIL judiciary", + "title": "must receive a rejected response when begin date is in the future for specific access granted role for CIVIL judiciary", "_guid_": "S-231.v1_1", "_extends_": "F-011_Test_Data_Base", "specs": [ From d35a421ed622001de8c883b23644f9e53b6fd4bf Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 13 Jun 2023 11:13:42 +0100 Subject: [PATCH 11/23] AM-2794: Update feature flags on F-011 FTAs --- src/functionalTest/resources/features/F-011/F-011.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index ad6a4b437e..e03fcb2439 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -5,7 +5,7 @@ Feature: F-011 : Create Specific Role Assignments Given an appropriate test context as detailed in the test data source @S-210 - @FeatureToggle(RAS:iac_specific_1_0=on) + @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) Scenario: must successfully 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], @@ -20,7 +20,7 @@ Feature: F-011 : Create Specific Role Assignments 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) + @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) Scenario: must successfully create specific access denied by requester Given a user with [an active IDAM profile with full permissions], And a user [Befta1 - who is the actor for requested role], @@ -35,7 +35,7 @@ Feature: F-011 : Create Specific Role Assignments 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) + @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) Scenario: must successfully create 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], @@ -65,7 +65,7 @@ Feature: F-011 : Create Specific Role Assignments 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) + @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) Scenario: must successfully create 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], From 2ffb64635820cc8f6798447593fca8058a25bb7d Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 13 Jun 2023 12:16:16 +0100 Subject: [PATCH 12/23] AM-2794: Fix references in post test cleanup role removal --- src/functionalTest/resources/features/F-011/S-231.v1_1.td.json | 3 ++- .../S-232_DeleteDataForRoleAssignmentsForDeniedRole.td.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json index eb333ec233..aa6e0e850d 100644 --- a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json +++ b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json @@ -52,7 +52,8 @@ "roleName" : "specific-access-judiciary", "roleCategory" : "JUDICIAL", "actorId" : "${[scenarioContext][testData][users][befta4][id]}", - "endTime" : "2024-03-02T00:00Z", + "beginTime": "2025-12-01T00:00Z", + "endTime" : "2026-01-01T00:00Z", "readOnly": true, "notes" : [ { diff --git a/src/functionalTest/resources/features/F-011/S-232_DeleteDataForRoleAssignmentsForDeniedRole.td.json b/src/functionalTest/resources/features/F-011/S-232_DeleteDataForRoleAssignmentsForDeniedRole.td.json index 6e952bf467..ef748ffe85 100644 --- a/src/functionalTest/resources/features/F-011/S-232_DeleteDataForRoleAssignmentsForDeniedRole.td.json +++ b/src/functionalTest/resources/features/F-011/S-232_DeleteDataForRoleAssignmentsForDeniedRole.td.json @@ -20,7 +20,7 @@ }, "pathVariables": { "process": "specific-access", - "reference": "${[scenarioContext][parentContext][testData][request][body][roleRequest][reference]}" + "reference": "${[scenarioContext][parentContext][childContexts][S-232_Access_Requested][testData][request][body][roleRequest][reference]}" } }, "expectedResponse": { From 7c05adc3ce490fff72b847fb70ac2de26ae0e4fc Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 13 Jun 2023 13:08:03 +0100 Subject: [PATCH 13/23] AM-2794: Add FTA scenarios for remaining features in F-011 --- .../resources/features/F-011/F-011.feature | 30 ++++++++ .../features/F-011/S-210.v1_1.td.json | 69 ++++++++++++++++++ .../features/F-011/S-212.v1_1.td.json | 70 +++++++++++++++++++ .../features/F-011/S-232.v1_1.td.json | 2 +- 4 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 src/functionalTest/resources/features/F-011/S-210.v1_1.td.json create mode 100644 src/functionalTest/resources/features/F-011/S-212.v1_1.td.json diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index e03fcb2439..b8ca772aff 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -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 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-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) @FeatureToggle(RAS:iac_specific_1_1=off) Scenario: must successfully create specific access denied by requester @@ -34,6 +49,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-212_DeleteDataForRoleAssignmentsForOrgRoles]. + @S-212.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 denied by requester + 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-212_Org_Role_Creation], + And a successful call [to create role assignments for requested role] as in [S-212_Access_Requested], + When a request is prepared with appropriate values, + And the request [contains specific-access-judiciary 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 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]. + @S-231 @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) Scenario: must successfully create specific access granted role for CIVIL judiciary diff --git a/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json new file mode 100644 index 0000000000..eb0482df68 --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json @@ -0,0 +1,69 @@ +{ + "title": "must receive a rejected response when begin date is in the future for create specific access requested role for judiciary", + "_guid_": "S-210.v1_1", + "_extends_": "F-011_Test_Data_Base", + "specs": [ + "Befta1 - who is the actor for requested role", + "contains specific-access-legal-ops case requested role assignment with begin date in the future" + ], + "users": { + "invokingUser": { + "_extends_": "AmBeftaUser6" + } + }, + "request": { + "headers": { + "ServiceAuthorization": "${[scenarioContext][customValues][generateS2STokenForXui]}" + }, + "body": { + "roleRequest": { + "assignerId": "${[scenarioContext][testData][users][invokingUser][id]}", + "reference": "1607103938250138/specific-access-legal-ops/${[scenarioContext][testData][users][invokingUser][id]}", + "process" : "specific-access", + "replaceExisting" : true + }, + "requestedRoles": [ + { + "_extends_": "RequestedRole", + "roleType" : "CASE", + "grantType" : "BASIC", + "classification" : "RESTRICTED", + "attributes": { + "caseId": "1607103938250138", + "requestedRole":"specific-access-legal-ops" + }, + "roleName": "specific-access-requested", + "roleCategory": "JUDICIAL", + "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", + "beginTime": "2025-12-01T00:00Z", + "endTime" : "2026-01-01T00:00Z", + "readOnly": true, + "notes" : [{ + "userId": "${[scenarioContext][testData][users][invokingUser][id]}", + "time": "2022-01-01T00:00Z", + "comment": "Need Access to case number 1649753913215769 for a month" + }] + } + ] + } + }, + + "expectedResponse": { + "responseCode": 422, + "responseMessage": "Unprocessable Entity", + "headers": { + "Content-Length": "[[ANYTHING_PRESENT]]", + "Content-Type": "application/json" + }, + "body": { + "roleAssignmentResponse": { + "roleRequest": { + "_extends_": "ResponseRoleRequest", + "replaceExisting" : true, + "status": "REJECTED" + }, + "requestedRoles": "[[ANYTHING_PRESENT]]" + } + } + } +} diff --git a/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json new file mode 100644 index 0000000000..0dc43ccbda --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json @@ -0,0 +1,70 @@ +{ + "title": "must receive a Reject response when begin date is in the future for create specific access denied by requester", + "_guid_": "S-212.v1_1", + "_extends_": "F-011_Test_Data_Base", + "specs": [ + "Befta1 - who is the actor for requested role", + "contains specific-access-judiciary case denied role assignment with begin date in the future" + ], + "users": { + "invokingUser": { + "_extends_": "AmBeftaUser4" + } + }, + "request": { + "headers": { + "ServiceAuthorization": "${[scenarioContext][customValues][generateS2STokenForXui]}" + }, + "body": { + "roleRequest": { + "assignerId": "${[scenarioContext][testData][users][invokingUser][id]}", + "reference": "1607103938250138/specific-access-judiciary/${[scenarioContext][testData][users][invokingUser][id]}", + "process": "specific-access", + "replaceExisting": true + }, + "requestedRoles": [ + { + "_extends_": "RequestedRole", + "roleType": "CASE", + "grantType": "BASIC", + "classification": "PRIVATE", + "attributes": { + "caseId": "1607103938250138", + "requestedRole": "specific-access-judiciary" + }, + "roleName": "specific-access-denied", + "roleCategory": "JUDICIAL", + "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", + "beginTime": "2025-12-01T00:00Z", + "endTime" : "2026-01-01T00:00Z", + "readOnly": true, + "notes": [ + { + "userId": "${[scenarioContext][testData][users][invokingUser][id]}", + "time": "2022-01-01T00:00Z", + "comment": "Need Access to case number 1607103938250138 for a month in the future" + } + ] + } + ] + } + }, + "expectedResponse": { + "responseCode": 422, + "responseMessage": "Unprocessable Entity", + "headers": { + "Content-Length": "[[ANYTHING_PRESENT]]", + "Content-Type": "application/json" + }, + "body": { + "roleAssignmentResponse": { + "roleRequest": { + "_extends_": "ResponseRoleRequest", + "replaceExisting" : true, + "status": "REJECTED" + }, + "requestedRoles": "[[ANYTHING_PRESENT]]" + } + } + } +} diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json index c2f9b3895a..987f41a942 100644 --- a/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json +++ b/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json @@ -1,5 +1,5 @@ { - "title": "must receive a Reject response when begin date is in the future for specific access denied role for PRIVATELAW admin", + "title": "must receive a rejected response when begin date is in the future for specific access denied role for PRIVATELAW admin", "_guid_": "S-232.v1_1", "_extends_": "F-011_Test_Data_Base", "specs": [ From c660a2f72e36dab12dc19d5b1e24b1772e4aeb3d Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 13 Jun 2023 13:27:07 +0100 Subject: [PATCH 14/23] AM-2794: Fix typo in test --- .../resources/features/F-011/F-011.feature | 19 +---- .../features/F-011/S-212.v1_1.td.json | 70 ------------------- 2 files changed, 2 insertions(+), 87 deletions(-) delete mode 100644 src/functionalTest/resources/features/F-011/S-212.v1_1.td.json diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index b8ca772aff..f80bd1f7f7 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -28,14 +28,14 @@ Feature: F-011 : Create Specific Role Assignments 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 positive response is received, + 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) @FeatureToggle(RAS:iac_specific_1_1=off) + @FeatureToggle(RAS:iac_specific_1_0=on) Scenario: must successfully create specific access denied by requester Given a user with [an active IDAM profile with full permissions], And a user [Befta1 - who is the actor for requested role], @@ -49,21 +49,6 @@ 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-212_DeleteDataForRoleAssignmentsForOrgRoles]. - @S-212.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 denied by requester - 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-212_Org_Role_Creation], - And a successful call [to create role assignments for requested role] as in [S-212_Access_Requested], - When a request is prepared with appropriate values, - And the request [contains specific-access-judiciary 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 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]. - @S-231 @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) Scenario: must successfully create specific access granted role for CIVIL judiciary diff --git a/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json deleted file mode 100644 index 0dc43ccbda..0000000000 --- a/src/functionalTest/resources/features/F-011/S-212.v1_1.td.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "title": "must receive a Reject response when begin date is in the future for create specific access denied by requester", - "_guid_": "S-212.v1_1", - "_extends_": "F-011_Test_Data_Base", - "specs": [ - "Befta1 - who is the actor for requested role", - "contains specific-access-judiciary case denied role assignment with begin date in the future" - ], - "users": { - "invokingUser": { - "_extends_": "AmBeftaUser4" - } - }, - "request": { - "headers": { - "ServiceAuthorization": "${[scenarioContext][customValues][generateS2STokenForXui]}" - }, - "body": { - "roleRequest": { - "assignerId": "${[scenarioContext][testData][users][invokingUser][id]}", - "reference": "1607103938250138/specific-access-judiciary/${[scenarioContext][testData][users][invokingUser][id]}", - "process": "specific-access", - "replaceExisting": true - }, - "requestedRoles": [ - { - "_extends_": "RequestedRole", - "roleType": "CASE", - "grantType": "BASIC", - "classification": "PRIVATE", - "attributes": { - "caseId": "1607103938250138", - "requestedRole": "specific-access-judiciary" - }, - "roleName": "specific-access-denied", - "roleCategory": "JUDICIAL", - "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "beginTime": "2025-12-01T00:00Z", - "endTime" : "2026-01-01T00:00Z", - "readOnly": true, - "notes": [ - { - "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", - "comment": "Need Access to case number 1607103938250138 for a month in the future" - } - ] - } - ] - } - }, - "expectedResponse": { - "responseCode": 422, - "responseMessage": "Unprocessable Entity", - "headers": { - "Content-Length": "[[ANYTHING_PRESENT]]", - "Content-Type": "application/json" - }, - "body": { - "roleAssignmentResponse": { - "roleRequest": { - "_extends_": "ResponseRoleRequest", - "replaceExisting" : true, - "status": "REJECTED" - }, - "requestedRoles": "[[ANYTHING_PRESENT]]" - } - } - } -} From ed2596690fb7795c5c98c4544173f7084328b154 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Thu, 15 Jun 2023 16:19:03 +0100 Subject: [PATCH 15/23] AM-2794: Remove redundant flags from FTAs --- src/functionalTest/resources/features/F-011/F-011.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index f80bd1f7f7..685e511a97 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -5,7 +5,7 @@ Feature: F-011 : Create Specific Role Assignments Given an appropriate test context as detailed in the test data source @S-210 - @FeatureToggle(RAS:iac_specific_1_0=on) @FeatureToggle(RAS:iac_specific_1_1=off) + @FeatureToggle(RAS:iac_specific_1_0=on) Scenario: must successfully 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], @@ -50,7 +50,7 @@ Feature: F-011 : Create Specific Role Assignments 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) @FeatureToggle(RAS:iac_specific_1_1=off) + @FeatureToggle(RAS:iac_specific_1_0=on) Scenario: must successfully create 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], @@ -80,7 +80,7 @@ Feature: F-011 : Create Specific Role Assignments 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) @FeatureToggle(RAS:iac_specific_1_1=off) + @FeatureToggle(RAS:iac_specific_1_0=on) Scenario: must successfully create 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], From cb0d5457fdc73c86633709660ff2a83e416d2c73 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 19 Jun 2023 10:49:31 +0100 Subject: [PATCH 16/23] AM-2794: Add extra cleanup step to S-231 to ensure all created roles are cleaned up --- src/functionalTest/resources/features/F-011/F-011.feature | 6 ++++-- ...S-231_DeleteDataForRoleAssignmentsForGrantedRole.td.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index 685e511a97..1176431c57 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -62,7 +62,8 @@ 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-231_DeleteDataForRoleAssignmentsForOrgRoles]. + And a successful call [to delete role assignments just created above] as in [S-231_DeleteDataForRoleAssignmentsForOrgRoles], + And a successful call [to delete role assignments just created above] as in [S-231_DeleteDataForRoleAssignmentsForGrantedRole]. @S-231.v1_1 @FeatureToggle(RAS:iac_specific_1_1=on) @@ -77,7 +78,8 @@ Feature: F-011 : Create Specific Role Assignments 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]. + And a successful call [to delete role assignments just created above] as in [S-231_DeleteDataForRoleAssignmentsForOrgRoles], + And a successful call [to delete role assignments just created above] as in [S-231_DeleteDataForRoleAssignmentsForGrantedRole]. @S-232 @FeatureToggle(RAS:iac_specific_1_0=on) diff --git a/src/functionalTest/resources/features/F-011/S-231_DeleteDataForRoleAssignmentsForGrantedRole.td.json b/src/functionalTest/resources/features/F-011/S-231_DeleteDataForRoleAssignmentsForGrantedRole.td.json index fea714ea58..28bd27e9a7 100644 --- a/src/functionalTest/resources/features/F-011/S-231_DeleteDataForRoleAssignmentsForGrantedRole.td.json +++ b/src/functionalTest/resources/features/F-011/S-231_DeleteDataForRoleAssignmentsForGrantedRole.td.json @@ -20,7 +20,7 @@ }, "pathVariables": { "process": "specific-access", - "reference": "${[scenarioContext][parentContext][testData][request][body][roleRequest][reference]}" + "reference": "${[scenarioContext][parentContext][childContexts][S-231_Access_Requested][testData][request][body][roleRequest][reference]}" } }, "expectedResponse": { From 1dc77377e355aa4f117be843345bd262a2826c79 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 19 Jun 2023 11:47:50 +0100 Subject: [PATCH 17/23] AM-2794: Revert previous change after clarification - Specific Access Granted roles cannot be deleted as per previous discovery due to no drool rule for deletion (see AM-2760 comments for more) --- .../resources/features/F-011/F-011.feature | 6 +- .../features/F-011/S-231.v1_1.td.json | 10 +- ...taForRoleAssignmentsForGrantedRole.td.json | 2 +- .../F-011/S-231_v1_Access_Requested.td.json | 92 +++++++++++++++++++ 4 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index 1176431c57..685e511a97 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -62,8 +62,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-231_DeleteDataForRoleAssignmentsForOrgRoles], - And a successful call [to delete role assignments just created above] as in [S-231_DeleteDataForRoleAssignmentsForGrantedRole]. + 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) @@ -78,8 +77,7 @@ Feature: F-011 : Create Specific Role Assignments 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], - And a successful call [to delete role assignments just created above] as in [S-231_DeleteDataForRoleAssignmentsForGrantedRole]. + 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) diff --git a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json index aa6e0e850d..f61004e34b 100644 --- a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json +++ b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json @@ -14,7 +14,7 @@ "body": { "roleRequest": { "assignerId": "${[scenarioContext][testData][users][invokingUser][id]}", - "reference": "1607103938250138/specific-access-judiciary/${[scenarioContext][testData][users][befta4][id]}", + "reference": "1607103938250137/specific-access-judiciary/${[scenarioContext][testData][users][befta4][id]}", "process" : "specific-access", "replaceExisting" : true }, @@ -25,7 +25,7 @@ "grantType" : "BASIC", "classification" : "PRIVATE", "attributes": { - "caseId": "1607103938250138", + "caseId": "1607103938250137", "requestedRole":"specific-access-judiciary" }, "roleName": "specific-access-granted", @@ -37,7 +37,7 @@ "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", "time": "2022-01-01T00:00Z", - "comment": "Need Access to case number 1607103938250138 for a month in the future" + "comment": "Need Access to case number 1607103938250137 for a month in the future" }] }, { @@ -46,7 +46,7 @@ "grantType" : "SPECIFIC", "classification" : "RESTRICTED", "attributes": { - "caseId": "1607103938250138", + "caseId": "1607103938250137", "requestedRole":"specific-access-judiciary" }, "roleName" : "specific-access-judiciary", @@ -59,7 +59,7 @@ { "userId": "${[scenarioContext][testData][users][invokingUser][id]}", "time": "2022-01-01T00:00Z", - "comment": "Need Access to case number 1607103938250138 for a month" + "comment": "Need Access to case number 1607103938250137 for a month" } ] } diff --git a/src/functionalTest/resources/features/F-011/S-231_DeleteDataForRoleAssignmentsForGrantedRole.td.json b/src/functionalTest/resources/features/F-011/S-231_DeleteDataForRoleAssignmentsForGrantedRole.td.json index 28bd27e9a7..fea714ea58 100644 --- a/src/functionalTest/resources/features/F-011/S-231_DeleteDataForRoleAssignmentsForGrantedRole.td.json +++ b/src/functionalTest/resources/features/F-011/S-231_DeleteDataForRoleAssignmentsForGrantedRole.td.json @@ -20,7 +20,7 @@ }, "pathVariables": { "process": "specific-access", - "reference": "${[scenarioContext][parentContext][childContexts][S-231_Access_Requested][testData][request][body][roleRequest][reference]}" + "reference": "${[scenarioContext][parentContext][testData][request][body][roleRequest][reference]}" } }, "expectedResponse": { diff --git a/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json new file mode 100644 index 0000000000..f38fec27b5 --- /dev/null +++ b/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json @@ -0,0 +1,92 @@ +{ + "title": "must successfully create access-requested Case Role Assignment", + "_guid_": "S-231_v1_Access_Requested", + "_extends_": "F-011_Test_Data_Base", + "specs": [ + "to create role assignments for requested role" + ], + "users": { + "invokingUser": { + "_extends_": "AmBeftaUser4" + } + }, + "request": { + "headers": { + "ServiceAuthorization": "${[scenarioContext][customValues][generateS2STokenForXui]}" + }, + "body": { + "roleRequest": { + "assignerId": "${[scenarioContext][testData][users][invokingUser][id]}", + "reference": "1607103938250137/specific-access-judiciary/${[scenarioContext][testData][users][invokingUser][id]}", + "process" : "specific-access", + "replaceExisting" : true + }, + "requestedRoles": [ + { + "_extends_": "RequestedRole", + "roleType" : "CASE", + "grantType" : "BASIC", + "classification" : "RESTRICTED", + "attributes": { + "caseId": "1607103938250137", + "requestedRole":"specific-access-judiciary" + }, + "roleName": "specific-access-requested", + "roleCategory": "JUDICIAL", + "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", + "endTime" : "2024-03-02T00:00Z", + "readOnly": true, + "notes" : [{ + "userId": "${[scenarioContext][testData][users][invokingUser][id]}", + "time": "2022-01-01T00:00Z", + "comment": "Need Access to case number 1607103938250137 for a month" + }] + } + ] + } + }, + "expectedResponse": { + "_extends_": "Common_201_Response", + "headers": { + "Content-Length": "[[ANYTHING_PRESENT]]", + "Content-Type": "application/json" + }, + "body": { + "roleAssignmentResponse": { + "roleRequest": { + "_extends_": "ResponseRoleRequest", + "reference": "${[scenarioContext][testData][request][body][roleRequest][reference]}", + "process" : "specific-access", + "replaceExisting": true + }, + "requestedRoles": [ + { + "_extends_": "ResponseRequestedRole", + "process" : "specific-access", + "actorId": "${[scenarioContext][testData][request][body][requestedRoles][0][actorId]}", + "roleName": "${[scenarioContext][testData][request][body][requestedRoles][0][roleName]}", + "roleCategory": "${[scenarioContext][testData][request][body][requestedRoles][0][roleCategory]}", + "roleType": "${[scenarioContext][testData][request][body][requestedRoles][0][roleType]}", + "grantType": "${[scenarioContext][testData][request][body][requestedRoles][0][grantType]}", + "classification" : "${[scenarioContext][testData][request][body][requestedRoles][0][classification]}", + "readOnly": true, + "attributes": { + "requestedRole":"specific-access-judiciary", + "caseId": "1607103938250137", + "jurisdiction" : "IA", + "caseType" : "Asylum", + "substantive" : "N" + }, + "notes" : [{ + "userId": "${[scenarioContext][testData][users][invokingUser][id]}", + "time": "2022-01-01T00:00Z", + "comment": "Need Access to case number 1607103938250137 for a month" + } + ] + } + ] + } + } + } +} + From e469c9063bcc7d44984750f394d6c9b1d646f3ee Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 19 Jun 2023 12:03:15 +0100 Subject: [PATCH 18/23] AM-2794: Point at new access request file in test --- src/functionalTest/resources/features/F-011/F-011.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functionalTest/resources/features/F-011/F-011.feature b/src/functionalTest/resources/features/F-011/F-011.feature index 685e511a97..622c37f7cf 100644 --- a/src/functionalTest/resources/features/F-011/F-011.feature +++ b/src/functionalTest/resources/features/F-011/F-011.feature @@ -70,7 +70,7 @@ Feature: F-011 : Create Specific Role Assignments 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_Access_Requested], + 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], From 4d0643fa583ed3079929ae4027fcd5ae479251af Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 19 Jun 2023 13:00:09 +0100 Subject: [PATCH 19/23] AM-2794: Update case id being used in test --- .../resources/features/F-011/S-231.v1_1.td.json | 10 +++++----- .../features/F-011/S-231_v1_Access_Requested.td.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json index f61004e34b..4c7226f60c 100644 --- a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json +++ b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json @@ -14,7 +14,7 @@ "body": { "roleRequest": { "assignerId": "${[scenarioContext][testData][users][invokingUser][id]}", - "reference": "1607103938250137/specific-access-judiciary/${[scenarioContext][testData][users][befta4][id]}", + "reference": "1673952218333561/specific-access-judiciary/${[scenarioContext][testData][users][befta4][id]}", "process" : "specific-access", "replaceExisting" : true }, @@ -25,7 +25,7 @@ "grantType" : "BASIC", "classification" : "PRIVATE", "attributes": { - "caseId": "1607103938250137", + "caseId": "1673952218333561", "requestedRole":"specific-access-judiciary" }, "roleName": "specific-access-granted", @@ -37,7 +37,7 @@ "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", "time": "2022-01-01T00:00Z", - "comment": "Need Access to case number 1607103938250137 for a month in the future" + "comment": "Need Access to case number 1673952218333561 for a month in the future" }] }, { @@ -46,7 +46,7 @@ "grantType" : "SPECIFIC", "classification" : "RESTRICTED", "attributes": { - "caseId": "1607103938250137", + "caseId": "1673952218333561", "requestedRole":"specific-access-judiciary" }, "roleName" : "specific-access-judiciary", @@ -59,7 +59,7 @@ { "userId": "${[scenarioContext][testData][users][invokingUser][id]}", "time": "2022-01-01T00:00Z", - "comment": "Need Access to case number 1607103938250137 for a month" + "comment": "Need Access to case number 1673952218333561 for a month" } ] } diff --git a/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json index f38fec27b5..04e3a5d8a8 100644 --- a/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json @@ -17,7 +17,7 @@ "body": { "roleRequest": { "assignerId": "${[scenarioContext][testData][users][invokingUser][id]}", - "reference": "1607103938250137/specific-access-judiciary/${[scenarioContext][testData][users][invokingUser][id]}", + "reference": "1673952218333561/specific-access-judiciary/${[scenarioContext][testData][users][invokingUser][id]}", "process" : "specific-access", "replaceExisting" : true }, @@ -28,7 +28,7 @@ "grantType" : "BASIC", "classification" : "RESTRICTED", "attributes": { - "caseId": "1607103938250137", + "caseId": "1673952218333561", "requestedRole":"specific-access-judiciary" }, "roleName": "specific-access-requested", @@ -39,7 +39,7 @@ "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", "time": "2022-01-01T00:00Z", - "comment": "Need Access to case number 1607103938250137 for a month" + "comment": "Need Access to case number 1673952218333561 for a month" }] } ] @@ -72,7 +72,7 @@ "readOnly": true, "attributes": { "requestedRole":"specific-access-judiciary", - "caseId": "1607103938250137", + "caseId": "1673952218333561", "jurisdiction" : "IA", "caseType" : "Asylum", "substantive" : "N" @@ -80,7 +80,7 @@ "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", "time": "2022-01-01T00:00Z", - "comment": "Need Access to case number 1607103938250137 for a month" + "comment": "Need Access to case number 1673952218333561 for a month" } ] } From 9c90405af2704577482f25f2b306787c3223e73c Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Fri, 23 Jun 2023 10:22:06 +0100 Subject: [PATCH 20/23] AM-2834: Plug dates into tests to replace hard coded dates --- .../befta/RoleAssignmentTestAutomationAdapter.java | 10 ++++++++-- .../resources/features/F-001/S-008.td.json | 2 +- .../resources/features/F-001/S-009.td.json | 4 ++-- .../resources/features/F-001/S-010.td.json | 4 ++-- .../F-001/S-101_Response_without_time.td.json | 4 ++-- .../F-001/S-101_Role_Request_without_time.td.json | 4 ++-- .../features/F-001/S-202_Org_Role_Creation.td.json | 4 ++-- .../features/F-001/S-203_Org_Role_Creation.td.json | 4 ++-- .../features/F-001/S-204_Org_Role_Creation.td.json | 4 ++-- .../features/F-001/S-205_Org_Role_Creation.td.json | 4 ++-- .../features/F-001/S-206_Org_Role_Creation.td.json | 4 ++-- .../F-008/S-106_Multiple_Org_Role_Creation.td.json | 6 +++--- .../features/F-008/S-201_Org_Role_Creation.td.json | 4 ++-- .../features/F-008/S-207_Org_Role_Creation.td.json | 4 ++-- .../S-208_Org_Role_Creation_For_Requester.td.json | 2 +- .../S-209_Org_Role_Creation_For_Requester.td.json | 2 +- .../F-010/S-190_Multiple_Org_Role_Creation.td.json | 4 ++-- .../F-010/S-191_Multiple_Org_Role_Creation.td.json | 4 ++-- .../F-010/S-192_Multiple_Org_Role_Creation.td.json | 4 ++-- .../F-010/S-193_Multiple_Org_Role_Creation.td.json | 4 ++-- .../resources/features/F-011/S-210.td.json | 4 ++-- .../resources/features/F-011/S-210.v1_1.td.json | 6 +++--- .../features/F-011/S-210_Org_Role_Creation.td.json | 2 +- .../resources/features/F-011/S-211.td.json | 8 ++++---- .../features/F-011/S-211_Access_Requested.td.json | 4 ++-- .../features/F-011/S-211_Org_Role_Creation.td.json | 4 ++-- .../resources/features/F-011/S-212.td.json | 4 ++-- .../features/F-011/S-212_Access_Requested.td.json | 4 ++-- .../features/F-011/S-212_Org_Role_Creation.td.json | 2 +- .../resources/features/F-011/S-231.td.json | 8 ++++---- .../resources/features/F-011/S-231.v1_1.td.json | 12 ++++++------ .../features/F-011/S-231_Access_Requested.td.json | 4 ++-- .../features/F-011/S-231_Org_Role_Creation.td.json | 4 ++-- .../features/F-011/S-231_v1_Access_Requested.td.json | 4 ++-- .../resources/features/F-011/S-232.td.json | 4 ++-- .../resources/features/F-011/S-232.v1_1.td.json | 6 +++--- .../features/F-011/S-232_Access_Requested.td.json | 4 ++-- .../features/F-011/S-232_Org_Role_Creation.td.json | 4 ++-- .../resources/features/F-012/S-213.td.json | 4 ++-- .../features/F-012/S-213_Org_Role_Creation.td.json | 2 +- .../resources/features/F-012/S-214.td.json | 4 ++-- .../features/F-012/S-214_Org_Role_Creation.td.json | 2 +- .../resources/features/F-012/S-215.td.json | 4 ++-- .../features/F-012/S-215_Org_Role_Creation.td.json | 2 +- .../resources/features/F-013/S-216.td.json | 4 ++-- .../features/F-013/S-216_Org_Role_Creation.td.json | 2 +- .../resources/features/F-014/S-219.td.json | 4 ++-- .../features/F-014/S-219_Org_Role_Creation.td.json | 2 +- .../resources/features/F-014/S-220.td.json | 4 ++-- .../features/F-014/S-220_Org_Role_Creation.td.json | 2 +- .../features/F-015/S-223_Org_Role_Creation.td.json | 4 ++-- .../features/F-015/S-224_Org_Role_Creation.td.json | 4 ++-- .../resources/features/common/RequestedRole.td.json | 8 ++++---- .../features/common/ResponseRequestedRole.td.json | 4 ++-- .../ResponseRequestedRoleWithoutSubstantive.td.json | 4 ++-- 55 files changed, 118 insertions(+), 112 deletions(-) diff --git a/src/functionalTest/java/uk/gov/hmcts/reform/roleassignment/befta/RoleAssignmentTestAutomationAdapter.java b/src/functionalTest/java/uk/gov/hmcts/reform/roleassignment/befta/RoleAssignmentTestAutomationAdapter.java index 573b4e0291..0b4fa5dffe 100644 --- a/src/functionalTest/java/uk/gov/hmcts/reform/roleassignment/befta/RoleAssignmentTestAutomationAdapter.java +++ b/src/functionalTest/java/uk/gov/hmcts/reform/roleassignment/befta/RoleAssignmentTestAutomationAdapter.java @@ -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); } diff --git a/src/functionalTest/resources/features/F-001/S-008.td.json b/src/functionalTest/resources/features/F-001/S-008.td.json index 5fca47fafb..963600e5f0 100644 --- a/src/functionalTest/resources/features/F-001/S-008.td.json +++ b/src/functionalTest/resources/features/F-001/S-008.td.json @@ -19,7 +19,7 @@ "requestedRoles": [ { "_extends_": "RequestedRole", - "beginTime" : "2020-01-01T00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "endTime" : "2025-01-01T00:00Z", "roleType": "CASE", "grantType": "SPECIFIC", diff --git a/src/functionalTest/resources/features/F-001/S-009.td.json b/src/functionalTest/resources/features/F-001/S-009.td.json index 3c9b6c716c..ce73f5fa20 100644 --- a/src/functionalTest/resources/features/F-001/S-009.td.json +++ b/src/functionalTest/resources/features/F-001/S-009.td.json @@ -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" } ] } diff --git a/src/functionalTest/resources/features/F-001/S-010.td.json b/src/functionalTest/resources/features/F-001/S-010.td.json index d5cbfe0d3b..47850122e5 100644 --- a/src/functionalTest/resources/features/F-001/S-010.td.json +++ b/src/functionalTest/resources/features/F-001/S-010.td.json @@ -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" } ] } diff --git a/src/functionalTest/resources/features/F-001/S-101_Response_without_time.td.json b/src/functionalTest/resources/features/F-001/S-101_Response_without_time.td.json index 50f91f7a70..4335a941f5 100644 --- a/src/functionalTest/resources/features/F-001/S-101_Response_without_time.td.json +++ b/src/functionalTest/resources/features/F-001/S-101_Response_without_time.td.json @@ -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" } ] } diff --git a/src/functionalTest/resources/features/F-001/S-101_Role_Request_without_time.td.json b/src/functionalTest/resources/features/F-001/S-101_Role_Request_without_time.td.json index c8a79c83ce..fc58af1036 100644 --- a/src/functionalTest/resources/features/F-001/S-101_Role_Request_without_time.td.json +++ b/src/functionalTest/resources/features/F-001/S-101_Role_Request_without_time.td.json @@ -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" } ] diff --git a/src/functionalTest/resources/features/F-001/S-202_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-001/S-202_Org_Role_Creation.td.json index 87959a4ad2..bebad23f8f 100644 --- a/src/functionalTest/resources/features/F-001/S-202_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-001/S-202_Org_Role_Creation.td.json @@ -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" @@ -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" diff --git a/src/functionalTest/resources/features/F-001/S-203_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-001/S-203_Org_Role_Creation.td.json index 642fd02185..370ea71bc9 100644 --- a/src/functionalTest/resources/features/F-001/S-203_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-001/S-203_Org_Role_Creation.td.json @@ -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" @@ -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" diff --git a/src/functionalTest/resources/features/F-001/S-204_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-001/S-204_Org_Role_Creation.td.json index b1caa3927f..a47410dc38 100644 --- a/src/functionalTest/resources/features/F-001/S-204_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-001/S-204_Org_Role_Creation.td.json @@ -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" @@ -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" diff --git a/src/functionalTest/resources/features/F-001/S-205_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-001/S-205_Org_Role_Creation.td.json index bc62d66199..7eb6037eaa 100644 --- a/src/functionalTest/resources/features/F-001/S-205_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-001/S-205_Org_Role_Creation.td.json @@ -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" @@ -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" diff --git a/src/functionalTest/resources/features/F-001/S-206_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-001/S-206_Org_Role_Creation.td.json index d0413c8dc3..f3bd711a80 100644 --- a/src/functionalTest/resources/features/F-001/S-206_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-001/S-206_Org_Role_Creation.td.json @@ -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" @@ -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" diff --git a/src/functionalTest/resources/features/F-008/S-106_Multiple_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-008/S-106_Multiple_Org_Role_Creation.td.json index fb8780cd58..9a66fe02b4 100644 --- a/src/functionalTest/resources/features/F-008/S-106_Multiple_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-008/S-106_Multiple_Org_Role_Creation.td.json @@ -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", @@ -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", @@ -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", diff --git a/src/functionalTest/resources/features/F-008/S-201_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-008/S-201_Org_Role_Creation.td.json index 90f01792b1..5d439c2e69 100644 --- a/src/functionalTest/resources/features/F-008/S-201_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-008/S-201_Org_Role_Creation.td.json @@ -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", @@ -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", diff --git a/src/functionalTest/resources/features/F-008/S-207_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-008/S-207_Org_Role_Creation.td.json index 836982bf71..a553cdda76 100644 --- a/src/functionalTest/resources/features/F-008/S-207_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-008/S-207_Org_Role_Creation.td.json @@ -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", @@ -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", diff --git a/src/functionalTest/resources/features/F-008/S-208_Org_Role_Creation_For_Requester.td.json b/src/functionalTest/resources/features/F-008/S-208_Org_Role_Creation_For_Requester.td.json index 047ceacffa..fc252ea5ac 100644 --- a/src/functionalTest/resources/features/F-008/S-208_Org_Role_Creation_For_Requester.td.json +++ b/src/functionalTest/resources/features/F-008/S-208_Org_Role_Creation_For_Requester.td.json @@ -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", diff --git a/src/functionalTest/resources/features/F-008/S-209_Org_Role_Creation_For_Requester.td.json b/src/functionalTest/resources/features/F-008/S-209_Org_Role_Creation_For_Requester.td.json index f6702c29a2..5c4978f941 100644 --- a/src/functionalTest/resources/features/F-008/S-209_Org_Role_Creation_For_Requester.td.json +++ b/src/functionalTest/resources/features/F-008/S-209_Org_Role_Creation_For_Requester.td.json @@ -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", diff --git a/src/functionalTest/resources/features/F-010/S-190_Multiple_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-010/S-190_Multiple_Org_Role_Creation.td.json index 15b299a96b..ace2833366 100644 --- a/src/functionalTest/resources/features/F-010/S-190_Multiple_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-010/S-190_Multiple_Org_Role_Creation.td.json @@ -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", @@ -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", diff --git a/src/functionalTest/resources/features/F-010/S-191_Multiple_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-010/S-191_Multiple_Org_Role_Creation.td.json index f12e7a5b33..ac6e02b0ba 100644 --- a/src/functionalTest/resources/features/F-010/S-191_Multiple_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-010/S-191_Multiple_Org_Role_Creation.td.json @@ -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", @@ -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", diff --git a/src/functionalTest/resources/features/F-010/S-192_Multiple_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-010/S-192_Multiple_Org_Role_Creation.td.json index 7356899c8f..7b97fea139 100644 --- a/src/functionalTest/resources/features/F-010/S-192_Multiple_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-010/S-192_Multiple_Org_Role_Creation.td.json @@ -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", @@ -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", diff --git a/src/functionalTest/resources/features/F-010/S-193_Multiple_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-010/S-193_Multiple_Org_Role_Creation.td.json index f3a7df6465..33772cb6b4 100644 --- a/src/functionalTest/resources/features/F-010/S-193_Multiple_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-010/S-193_Multiple_Org_Role_Creation.td.json @@ -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", @@ -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", diff --git a/src/functionalTest/resources/features/F-011/S-210.td.json b/src/functionalTest/resources/features/F-011/S-210.td.json index affb25b197..647dadab97 100644 --- a/src/functionalTest/resources/features/F-011/S-210.td.json +++ b/src/functionalTest/resources/features/F-011/S-210.td.json @@ -39,7 +39,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1649753913215769 for a month" }] } @@ -80,7 +80,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1649753913215769 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json index eb0482df68..89031261d0 100644 --- a/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json +++ b/src/functionalTest/resources/features/F-011/S-210.v1_1.td.json @@ -35,12 +35,12 @@ "roleName": "specific-access-requested", "roleCategory": "JUDICIAL", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "beginTime": "2025-12-01T00:00Z", - "endTime" : "2026-01-01T00:00Z", + "beginTime": "${[scenarioContext][customValues][nextMonth]}T00:00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1649753913215769 for a month" }] } diff --git a/src/functionalTest/resources/features/F-011/S-210_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-011/S-210_Org_Role_Creation.td.json index d6dfdae0e7..1a317720e5 100644 --- a/src/functionalTest/resources/features/F-011/S-210_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-011/S-210_Org_Role_Creation.td.json @@ -23,7 +23,7 @@ "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", "roleName": "case-allocator", "roleCategory": "JUDICIAL", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "IA" diff --git a/src/functionalTest/resources/features/F-011/S-211.td.json b/src/functionalTest/resources/features/F-011/S-211.td.json index 7277d45b0c..d339494843 100644 --- a/src/functionalTest/resources/features/F-011/S-211.td.json +++ b/src/functionalTest/resources/features/F-011/S-211.td.json @@ -39,7 +39,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] }, @@ -60,7 +60,7 @@ "notes" : [ { "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] @@ -102,7 +102,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] @@ -126,7 +126,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-211_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-211_Access_Requested.td.json index d1f03d93cd..d3dee1e78c 100644 --- a/src/functionalTest/resources/features/F-011/S-211_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-211_Access_Requested.td.json @@ -38,7 +38,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] } @@ -79,7 +79,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-211_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-011/S-211_Org_Role_Creation.td.json index 6ce42730eb..0d54a7a8d2 100644 --- a/src/functionalTest/resources/features/F-011/S-211_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-011/S-211_Org_Role_Creation.td.json @@ -19,7 +19,7 @@ "actorId": "${[scenarioContext][testData][users][befta4][id]}", "roleName": "case-allocator", "roleCategory": "JUDICIAL", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "IA" @@ -30,7 +30,7 @@ "actorId": "${[scenarioContext][testData][users][befta3][id]}", "roleName": "leadership-judge", "roleCategory": "JUDICIAL", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "IA" diff --git a/src/functionalTest/resources/features/F-011/S-212.td.json b/src/functionalTest/resources/features/F-011/S-212.td.json index 5751b07a32..6f2dba237c 100644 --- a/src/functionalTest/resources/features/F-011/S-212.td.json +++ b/src/functionalTest/resources/features/F-011/S-212.td.json @@ -39,7 +39,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] } @@ -80,7 +80,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-212_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-212_Access_Requested.td.json index f9f5d07d13..19f72edb14 100644 --- a/src/functionalTest/resources/features/F-011/S-212_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-212_Access_Requested.td.json @@ -38,7 +38,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] } @@ -79,7 +79,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-212_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-011/S-212_Org_Role_Creation.td.json index 507050723e..684d33c132 100644 --- a/src/functionalTest/resources/features/F-011/S-212_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-011/S-212_Org_Role_Creation.td.json @@ -23,7 +23,7 @@ "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", "roleName": "case-allocator", "roleCategory": "JUDICIAL", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "IA" diff --git a/src/functionalTest/resources/features/F-011/S-231.td.json b/src/functionalTest/resources/features/F-011/S-231.td.json index 0f6ac2b449..e29064f837 100644 --- a/src/functionalTest/resources/features/F-011/S-231.td.json +++ b/src/functionalTest/resources/features/F-011/S-231.td.json @@ -39,7 +39,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] }, @@ -60,7 +60,7 @@ "notes" : [ { "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] @@ -102,7 +102,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] @@ -126,7 +126,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json index 4c7226f60c..0dacead0fc 100644 --- a/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json +++ b/src/functionalTest/resources/features/F-011/S-231.v1_1.td.json @@ -31,12 +31,12 @@ "roleName": "specific-access-granted", "roleCategory": "JUDICIAL", "actorId": "${[scenarioContext][testData][users][befta4][id]}", - "beginTime": "2025-12-01T00:00Z", - "endTime" : "2026-01-01T00:00Z", + "beginTime": "${[scenarioContext][customValues][nextMonth]}T00:00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1673952218333561 for a month in the future" }] }, @@ -52,13 +52,13 @@ "roleName" : "specific-access-judiciary", "roleCategory" : "JUDICIAL", "actorId" : "${[scenarioContext][testData][users][befta4][id]}", - "beginTime": "2025-12-01T00:00Z", - "endTime" : "2026-01-01T00:00Z", + "beginTime": "${[scenarioContext][customValues][nextMonth]}T00:00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [ { "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1673952218333561 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-231_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-231_Access_Requested.td.json index 9cc5805431..32f79b1be0 100644 --- a/src/functionalTest/resources/features/F-011/S-231_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-231_Access_Requested.td.json @@ -38,7 +38,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] } @@ -79,7 +79,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-231_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-011/S-231_Org_Role_Creation.td.json index 42362d1822..9bcb6f2191 100644 --- a/src/functionalTest/resources/features/F-011/S-231_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-011/S-231_Org_Role_Creation.td.json @@ -19,7 +19,7 @@ "actorId": "${[scenarioContext][testData][users][befta4][id]}", "roleName": "case-allocator", "roleCategory": "JUDICIAL", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "CIVIL" @@ -30,7 +30,7 @@ "actorId": "${[scenarioContext][testData][users][befta3][id]}", "roleName": "leadership-judge", "roleCategory": "JUDICIAL", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "IA" diff --git a/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json index 04e3a5d8a8..f6271b5667 100644 --- a/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json @@ -38,7 +38,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1673952218333561 for a month" }] } @@ -79,7 +79,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1673952218333561 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-232.td.json b/src/functionalTest/resources/features/F-011/S-232.td.json index 03dc6d65bd..fef2b7aa95 100644 --- a/src/functionalTest/resources/features/F-011/S-232.td.json +++ b/src/functionalTest/resources/features/F-011/S-232.td.json @@ -41,7 +41,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] } @@ -82,7 +82,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json b/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json index 987f41a942..f5f3952511 100644 --- a/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json +++ b/src/functionalTest/resources/features/F-011/S-232.v1_1.td.json @@ -31,12 +31,12 @@ "roleName": "specific-access-denied", "roleCategory": "ADMIN", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "beginTime": "2025-12-01T00:00Z", - "endTime" : "2026-01-01T00:00Z", + "beginTime": "${[scenarioContext][customValues][nextMonth]}T00:00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] } diff --git a/src/functionalTest/resources/features/F-011/S-232_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-232_Access_Requested.td.json index 6855b36533..f49d7a79b7 100644 --- a/src/functionalTest/resources/features/F-011/S-232_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-232_Access_Requested.td.json @@ -38,7 +38,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] } @@ -79,7 +79,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-011/S-232_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-011/S-232_Org_Role_Creation.td.json index 70484f4c26..4122f8cb73 100644 --- a/src/functionalTest/resources/features/F-011/S-232_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-011/S-232_Org_Role_Creation.td.json @@ -19,7 +19,7 @@ "actorId": "${[scenarioContext][testData][users][befta1][id]}", "roleName": "case-allocator", "roleCategory": "ADMIN", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "PRIVATELAW", @@ -31,7 +31,7 @@ "actorId": "${[scenarioContext][testData][users][befta4][id]}", "roleName": "leadership-judge", "roleCategory": "JUDICIAL", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "IA", diff --git a/src/functionalTest/resources/features/F-012/S-213.td.json b/src/functionalTest/resources/features/F-012/S-213.td.json index 17f338238f..ab6e9688c8 100644 --- a/src/functionalTest/resources/features/F-012/S-213.td.json +++ b/src/functionalTest/resources/features/F-012/S-213.td.json @@ -39,7 +39,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] } @@ -79,7 +79,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-012/S-213_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-012/S-213_Org_Role_Creation.td.json index 06e0bdf73e..f0bd803e5f 100644 --- a/src/functionalTest/resources/features/F-012/S-213_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-012/S-213_Org_Role_Creation.td.json @@ -24,7 +24,7 @@ "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", "roleName": "senior-tribunal-caseworker", "roleCategory": "LEGAL_OPERATIONS", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "primaryLocation": "445777" diff --git a/src/functionalTest/resources/features/F-012/S-214.td.json b/src/functionalTest/resources/features/F-012/S-214.td.json index bbb215a102..4b7706a81f 100644 --- a/src/functionalTest/resources/features/F-012/S-214.td.json +++ b/src/functionalTest/resources/features/F-012/S-214.td.json @@ -39,7 +39,7 @@ "readOnly": false, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] } @@ -79,7 +79,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-012/S-214_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-012/S-214_Org_Role_Creation.td.json index 6452daf876..4c7af897a2 100644 --- a/src/functionalTest/resources/features/F-012/S-214_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-012/S-214_Org_Role_Creation.td.json @@ -24,7 +24,7 @@ "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", "roleName": "leadership-judge", "roleCategory": "JUDICIAL", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "IA" diff --git a/src/functionalTest/resources/features/F-012/S-215.td.json b/src/functionalTest/resources/features/F-012/S-215.td.json index 402de6ecd8..d66cd9f73b 100644 --- a/src/functionalTest/resources/features/F-012/S-215.td.json +++ b/src/functionalTest/resources/features/F-012/S-215.td.json @@ -39,7 +39,7 @@ "readOnly": false, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" }] } @@ -79,7 +79,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1607103938250138 for a month" } ] diff --git a/src/functionalTest/resources/features/F-012/S-215_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-012/S-215_Org_Role_Creation.td.json index 719fae928e..548621bbbc 100644 --- a/src/functionalTest/resources/features/F-012/S-215_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-012/S-215_Org_Role_Creation.td.json @@ -24,7 +24,7 @@ "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", "roleName": "hearing-centre-admin", "roleCategory": "ADMIN", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "primaryLocation": "123321", diff --git a/src/functionalTest/resources/features/F-013/S-216.td.json b/src/functionalTest/resources/features/F-013/S-216.td.json index ddae0f2a6b..6fd83eda6d 100644 --- a/src/functionalTest/resources/features/F-013/S-216.td.json +++ b/src/functionalTest/resources/features/F-013/S-216.td.json @@ -41,7 +41,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1677150343037308 for a month" }] } @@ -83,7 +83,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1677150343037308 for a month" } ] diff --git a/src/functionalTest/resources/features/F-013/S-216_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-013/S-216_Org_Role_Creation.td.json index 23555cffbd..061a9ce038 100644 --- a/src/functionalTest/resources/features/F-013/S-216_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-013/S-216_Org_Role_Creation.td.json @@ -24,7 +24,7 @@ "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", "roleName": "circuit-judge", "roleCategory": "JUDICIAL", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "CIVIL", diff --git a/src/functionalTest/resources/features/F-014/S-219.td.json b/src/functionalTest/resources/features/F-014/S-219.td.json index 1e327bbe6b..20bcc8080e 100644 --- a/src/functionalTest/resources/features/F-014/S-219.td.json +++ b/src/functionalTest/resources/features/F-014/S-219.td.json @@ -40,7 +40,7 @@ "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1675782944487896 for a month" }] } @@ -80,7 +80,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1675782944487896 for a month" } ] diff --git a/src/functionalTest/resources/features/F-014/S-219_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-014/S-219_Org_Role_Creation.td.json index bd0a3541c0..96c2db87a6 100644 --- a/src/functionalTest/resources/features/F-014/S-219_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-014/S-219_Org_Role_Creation.td.json @@ -24,7 +24,7 @@ "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", "roleName": "ctsc", "roleCategory": "CTSC", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "primaryLocation": "445777", diff --git a/src/functionalTest/resources/features/F-014/S-220.td.json b/src/functionalTest/resources/features/F-014/S-220.td.json index db87f9841a..eb62dbf39d 100644 --- a/src/functionalTest/resources/features/F-014/S-220.td.json +++ b/src/functionalTest/resources/features/F-014/S-220.td.json @@ -41,7 +41,7 @@ "readOnly": false, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1675782944487896 for a month" }] } @@ -82,7 +82,7 @@ }, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", - "time": "2022-01-01T00:00Z", + "time": "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "comment": "Need Access to case number 1675782944487896 for a month" } ] diff --git a/src/functionalTest/resources/features/F-014/S-220_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-014/S-220_Org_Role_Creation.td.json index c3e8bdecaa..fc67c131c9 100644 --- a/src/functionalTest/resources/features/F-014/S-220_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-014/S-220_Org_Role_Creation.td.json @@ -24,7 +24,7 @@ "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", "roleName": "senior-tribunal-caseworker", "roleCategory": "LEGAL_OPERATIONS", - "beginTime" : "2022-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "PRIVATELAW", diff --git a/src/functionalTest/resources/features/F-015/S-223_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-015/S-223_Org_Role_Creation.td.json index 51d70caab7..014cf0ca03 100644 --- a/src/functionalTest/resources/features/F-015/S-223_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-015/S-223_Org_Role_Creation.td.json @@ -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": "PRIVATELAW", @@ -34,7 +34,7 @@ "actorId": "${[scenarioContext][testData][users][befta3][id]}", "roleName": "magistrate", "roleCategory": "JUDICIAL", - "beginTime" : "2020-09-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "PRIVATELAW", diff --git a/src/functionalTest/resources/features/F-015/S-224_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-015/S-224_Org_Role_Creation.td.json index c1974a1013..6f35f7f5db 100644 --- a/src/functionalTest/resources/features/F-015/S-224_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-015/S-224_Org_Role_Creation.td.json @@ -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": "PRIVATELAW", @@ -34,7 +34,7 @@ "actorId": "${[scenarioContext][testData][users][befta3][id]}", "roleName": "judge", "roleCategory": "JUDICIAL", - "beginTime" : "2020-09-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", "attributes": { "jurisdiction": "PRIVATELAW", diff --git a/src/functionalTest/resources/features/common/RequestedRole.td.json b/src/functionalTest/resources/features/common/RequestedRole.td.json index 2ab5b2a373..427018c5b1 100644 --- a/src/functionalTest/resources/features/common/RequestedRole.td.json +++ b/src/functionalTest/resources/features/common/RequestedRole.td.json @@ -8,8 +8,8 @@ "classification": "PUBLIC", "grantType": "STANDARD", "readOnly": false, - "beginTime" : "2021-01-01T00:00:00Z", - "endTime" : "2025-01-01T00:00:00Z", + "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "attributes": { "jurisdiction": "IA", @@ -19,12 +19,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" } ] diff --git a/src/functionalTest/resources/features/common/ResponseRequestedRole.td.json b/src/functionalTest/resources/features/common/ResponseRequestedRole.td.json index 4dd7798715..642360008f 100644 --- a/src/functionalTest/resources/features/common/ResponseRequestedRole.td.json +++ b/src/functionalTest/resources/features/common/ResponseRequestedRole.td.json @@ -23,11 +23,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" } ] } diff --git a/src/functionalTest/resources/features/common/ResponseRequestedRoleWithoutSubstantive.td.json b/src/functionalTest/resources/features/common/ResponseRequestedRoleWithoutSubstantive.td.json index 92698d2d28..31ac23b7c3 100644 --- a/src/functionalTest/resources/features/common/ResponseRequestedRoleWithoutSubstantive.td.json +++ b/src/functionalTest/resources/features/common/ResponseRequestedRoleWithoutSubstantive.td.json @@ -22,11 +22,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" } ] } From 47d150da399218a9a2ec857934858f792a3c934e Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Fri, 23 Jun 2023 10:49:40 +0100 Subject: [PATCH 21/23] AM-2834: Resolve issue with ordering of items in F-015 test --- .../resources/features/F-015/S-223_Org_Role_Creation.td.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/functionalTest/resources/features/F-015/S-223_Org_Role_Creation.td.json b/src/functionalTest/resources/features/F-015/S-223_Org_Role_Creation.td.json index 014cf0ca03..cf8fabf9c6 100644 --- a/src/functionalTest/resources/features/F-015/S-223_Org_Role_Creation.td.json +++ b/src/functionalTest/resources/features/F-015/S-223_Org_Role_Creation.td.json @@ -59,6 +59,10 @@ "replaceExisting": true }, "requestedRoles": [ + { + "__ordering__": "UNORDERED", + "__elementId__": "roleName" + }, { "_extends_": "ResponseRequestedRole", "actorId": "${[scenarioContext][testData][users][befta3][id]}", From 148576f7077ea6ab9e2aa3ddbf66a050fd3920d8 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Wed, 28 Jun 2023 15:15:59 +0100 Subject: [PATCH 22/23] AM-2834: Add plugged in dates missed on inital pass --- src/functionalTest/resources/features/F-001/S-008.td.json | 2 +- src/functionalTest/resources/features/F-011/S-210.td.json | 2 +- src/functionalTest/resources/features/F-011/S-211.td.json | 4 ++-- .../resources/features/F-011/S-211_Access_Requested.td.json | 2 +- src/functionalTest/resources/features/F-011/S-212.td.json | 2 +- .../resources/features/F-011/S-212_Access_Requested.td.json | 2 +- src/functionalTest/resources/features/F-011/S-231.td.json | 4 ++-- .../resources/features/F-011/S-231_Access_Requested.td.json | 2 +- .../features/F-011/S-231_v1_Access_Requested.td.json | 2 +- src/functionalTest/resources/features/F-011/S-232.td.json | 2 +- .../resources/features/F-011/S-232_Access_Requested.td.json | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/functionalTest/resources/features/F-001/S-008.td.json b/src/functionalTest/resources/features/F-001/S-008.td.json index 963600e5f0..d6dbcfcf6e 100644 --- a/src/functionalTest/resources/features/F-001/S-008.td.json +++ b/src/functionalTest/resources/features/F-001/S-008.td.json @@ -20,7 +20,7 @@ { "_extends_": "RequestedRole", "beginTime" : "${[scenarioContext][customValues][yesterday]}T00:00:00Z", - "endTime" : "2025-01-01T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "roleType": "CASE", "grantType": "SPECIFIC", "attributes": { diff --git a/src/functionalTest/resources/features/F-011/S-210.td.json b/src/functionalTest/resources/features/F-011/S-210.td.json index 647dadab97..162117ea8e 100644 --- a/src/functionalTest/resources/features/F-011/S-210.td.json +++ b/src/functionalTest/resources/features/F-011/S-210.td.json @@ -35,7 +35,7 @@ "roleName": "specific-access-requested", "roleCategory": "JUDICIAL", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", diff --git a/src/functionalTest/resources/features/F-011/S-211.td.json b/src/functionalTest/resources/features/F-011/S-211.td.json index d339494843..1a53013bdd 100644 --- a/src/functionalTest/resources/features/F-011/S-211.td.json +++ b/src/functionalTest/resources/features/F-011/S-211.td.json @@ -35,7 +35,7 @@ "roleName": "specific-access-granted", "roleCategory": "JUDICIAL", "actorId": "${[scenarioContext][testData][users][befta4][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", @@ -55,7 +55,7 @@ "roleName" : "specific-access-judiciary", "roleCategory" : "JUDICIAL", "actorId" : "${[scenarioContext][testData][users][befta4][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [ { diff --git a/src/functionalTest/resources/features/F-011/S-211_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-211_Access_Requested.td.json index d3dee1e78c..8053a98c59 100644 --- a/src/functionalTest/resources/features/F-011/S-211_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-211_Access_Requested.td.json @@ -34,7 +34,7 @@ "roleName": "specific-access-requested", "roleCategory": "JUDICIAL", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", diff --git a/src/functionalTest/resources/features/F-011/S-212.td.json b/src/functionalTest/resources/features/F-011/S-212.td.json index 6f2dba237c..3d9a19a949 100644 --- a/src/functionalTest/resources/features/F-011/S-212.td.json +++ b/src/functionalTest/resources/features/F-011/S-212.td.json @@ -35,7 +35,7 @@ "roleName": "specific-access-denied", "roleCategory": "JUDICIAL", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", diff --git a/src/functionalTest/resources/features/F-011/S-212_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-212_Access_Requested.td.json index 19f72edb14..5c31153e33 100644 --- a/src/functionalTest/resources/features/F-011/S-212_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-212_Access_Requested.td.json @@ -34,7 +34,7 @@ "roleName": "specific-access-requested", "roleCategory": "JUDICIAL", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", diff --git a/src/functionalTest/resources/features/F-011/S-231.td.json b/src/functionalTest/resources/features/F-011/S-231.td.json index e29064f837..a8a7ff4c4e 100644 --- a/src/functionalTest/resources/features/F-011/S-231.td.json +++ b/src/functionalTest/resources/features/F-011/S-231.td.json @@ -35,7 +35,7 @@ "roleName": "specific-access-granted", "roleCategory": "JUDICIAL", "actorId": "${[scenarioContext][testData][users][befta4][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", @@ -55,7 +55,7 @@ "roleName" : "specific-access-judiciary", "roleCategory" : "JUDICIAL", "actorId" : "${[scenarioContext][testData][users][befta4][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [ { diff --git a/src/functionalTest/resources/features/F-011/S-231_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-231_Access_Requested.td.json index 32f79b1be0..e84418cd4a 100644 --- a/src/functionalTest/resources/features/F-011/S-231_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-231_Access_Requested.td.json @@ -34,7 +34,7 @@ "roleName": "specific-access-requested", "roleCategory": "JUDICIAL", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", diff --git a/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json index f6271b5667..309c5fdbae 100644 --- a/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-231_v1_Access_Requested.td.json @@ -34,7 +34,7 @@ "roleName": "specific-access-requested", "roleCategory": "JUDICIAL", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", diff --git a/src/functionalTest/resources/features/F-011/S-232.td.json b/src/functionalTest/resources/features/F-011/S-232.td.json index fef2b7aa95..d8adae3dee 100644 --- a/src/functionalTest/resources/features/F-011/S-232.td.json +++ b/src/functionalTest/resources/features/F-011/S-232.td.json @@ -37,7 +37,7 @@ "roleName": "specific-access-denied", "roleCategory": "ADMIN", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", diff --git a/src/functionalTest/resources/features/F-011/S-232_Access_Requested.td.json b/src/functionalTest/resources/features/F-011/S-232_Access_Requested.td.json index f49d7a79b7..1513bb33a4 100644 --- a/src/functionalTest/resources/features/F-011/S-232_Access_Requested.td.json +++ b/src/functionalTest/resources/features/F-011/S-232_Access_Requested.td.json @@ -34,7 +34,7 @@ "roleName": "specific-access-requested", "roleCategory": "ADMIN", "actorId": "${[scenarioContext][testData][users][invokingUser][id]}", - "endTime" : "2024-03-02T00:00Z", + "endTime" : "${[scenarioContext][customValues][nextYear]}T00:00:00Z", "readOnly": true, "notes" : [{ "userId": "${[scenarioContext][testData][users][invokingUser][id]}", From cd8843d0c2b48d2452ef3ede3497b59654ad903b Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Thu, 6 Jul 2023 16:33:20 +0100 Subject: [PATCH 23/23] Trigger build