diff --git a/Jenkinsfile_CNP b/Jenkinsfile_CNP index e5249582b..7dfdace6c 100644 --- a/Jenkinsfile_CNP +++ b/Jenkinsfile_CNP @@ -16,7 +16,7 @@ GradleBuilder builder = new GradleBuilder(this, product) def definitionStoreDevelopPr = "PR-1540" // This doesn't change frequently, but when it does, only change this value. def dataStoreApiDevelopPr = "PR-2552" // This doesn't change frequently, but when it does, only change this value. def prsToUseAat = "PR-148,PR-161,PR-167,PR-259,PR-264" // Set this value to a PR number, or add it as a comma-separated value, if it's to follow CI/CD. -def prsRunningInIsolation = "PR-463" // Set this value to a PR number, or add it as a comma-separated value, if PRs for MCA, Data-Store and Def-Store are all configured to run in isolation from other PRs. +def prsRunningInIsolation = "PR-561" // Set this value to a PR number, or add it as a comma-separated value, if PRs for MCA, Data-Store and Def-Store are all configured to run in isolation from other PRs. def secrets = [ 'rpx-${env}': [ @@ -41,7 +41,13 @@ def secrets = [ secret('ccd-befta-jurisdiction3-solicitor1-pwd', 'CCD_BEFTA_JURISDICTION_3_SOLICITOR_1_PWD'), secret('ccd-befta-solicitor-4-pwd', 'CCD_BEFTA_SOLICITOR_4_PWD'), secret('ccd-befta-citizen-2-pwd', 'CCD_BEFTA_CITIZEN_2_PWD'), - secret('ccd-befta-pui-caa-1-pwd', 'CCD_BEFTA_PUI_CAA_1_PWD') + secret('ccd-befta-pui-caa-1-pwd', 'CCD_BEFTA_PUI_CAA_1_PWD'), + secret('ccd-befta-caseworker-caa-pwd', 'CCD_BEFTA_CASEWORKER_CAA_PWD'), + secret('ccd-befta-master-caseworker-pwd', 'CCD_BEFTA_MASTER_CASEWORKER_ROLE1_BASIC_PWD'), + secret('ccd-befta-master-caseworker-pwd', 'CCD_BEFTA_MASTER_CASEWORKER_ROLE1_STANDARD_PWD'), + secret('ccd-befta-master-caseworker-pwd', 'CCD_BEFTA_MASTER_CASEWORKER_ROLE3_CHALLENGED_PWD'), + secret('ccd-befta-master-caseworker-regional-staff-pwd', 'CCD_BEFTA_MASTER_CASEWORKER_REGIONAL_STAFF_PWD'), + secret('ccd-befta-master-caseworker-staff-pwd', 'CCD_BEFTA_MASTER_CASEWORKER_STAFF_PWD') ], 's2s-${env}': [ secret('microservicekey-ccd-gw', 'CCD_API_GATEWAY_S2S_KEY'), diff --git a/build.gradle b/build.gradle index 89c83b08a..129a34652 100644 --- a/build.gradle +++ b/build.gradle @@ -128,9 +128,6 @@ tasks.register('smoke', Test) { outputs.upToDateWhen { false } } -def tags = (findProperty('tags') == null) ? ' not @Ignore' : '(' + findProperty('tags') + ') and not @Ignore' -println 'tags =' + tags - tasks.register('functional', Test) { description = "Runs functional tests" group = "Verification" @@ -145,6 +142,8 @@ tasks.register('functional', Test) { cucumberReports.reports = files("${cucumberReports.outputDir}/cucumber.json") cucumberReports.notFailingStatuses = ["skipped", "passed"] + def tags = (project.hasProperty('tags')) ? "(${project.property('tags')}) and not @Ignore" : 'not @Ignore' + javaexec { main = "uk.gov.hmcts.reform.managecase.befta.ManageCaseAssignmentBeftaMain" classpath += sourceSets.functionalTest.runtimeClasspath + sourceSets.main.output + sourceSets.test.output @@ -152,12 +151,13 @@ tasks.register('functional', Test) { '--threads', '1', '--plugin', "json:${cucumberReports.outputDir}/cucumber.json", '--plugin', "junit:${buildDir}/test-results/functional/cucumber.xml", - '--tags', 'not @Ignore', + '--tags', "${tags}", '--glue', 'uk.gov.hmcts.befta.player', '--glue', 'uk.gov.hmcts.reform.managecase.befta', 'src/functionalTest/resources/features' ] // '--add-opens=...' added to suppress 'WARNING: An illegal reflective access operation has occurred' in uk.gov.hmcts.befta.util.CucumberStepAnnotationUtils jvmArgs = [ '--add-opens=java.base/java.lang.reflect=ALL-UNNAMED' ] + println 'args =' + args } } diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/F-206 - Request Notice Of Change.feature b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/F-206 - Request Notice Of Change.feature index a53a51647..80d16b65f 100644 --- a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/F-206 - Request Notice Of Change.feature +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/F-206 - Request Notice Of Change.feature @@ -142,9 +142,9 @@ Scenario: (Happy Path) CAA (also a solicitor for a different jurisdiction) reque #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -# ACA-68 / AC-7 +# ACA-68 / AC-7 CCD-5334/6255 AC1 @S-206.7 @callbackTests -Scenario: (Happy Path) Solicitor requests NoC to replace representation - auto-approval applies +Scenario: (Happy Path) Solicitor having STANDARD access to case requests NoC to replace representation - auto-approval applies Given a user [Richard - with the ability to create a case for a particular jurisdiction within an organisation], And a user [Dil - with a solicitor role for the same jurisdiction, within a different organisation from Richard's], @@ -159,9 +159,10 @@ Scenario: (Happy Path) Solicitor requests NoC to replace representation - auto-a Then a positive response is received, And the response has all the details as expected, - And a call [to verify that Dil HAS been granted case roles R1 & R2 for the case but not R3] will get the expected response as in [F-206_Verify_Granted_Case_Roles_R1_R2_Dil], + And a call [to verify that Dil has NOT been granted any case roles for the case] will get the expected response as in [F-206_Verify_Not_Granted_Case_Roles_Dil], And a call [to verify there is NO pending NOC request on the case and the OrganisationPolicy for R2 HAS been updated] will get the expected response as in [F-206_Verify_Case_Data_COR_Approved_ReplaceRepresentation], And a call [to get Case Events API returns a NoCRequest event in which the user ID is set to invoking users email address AND the proxied_by field set to the ID of the system user] will get the expected response as in [F-206_Verify_NoC_Request_Event_Data]. + And a call [to get Grant Access Metadata API returning Standard Grant Access for case] will get the expected response as in [F-206_Verify_NoC_Request_Access_Metadata], #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -174,17 +175,17 @@ Scenario: (Happy Path) Solicitor requests NoC for a non-represented litigant - a And a successful call [by Mario to create a case C1, which contains 3 Org Policies for 3 case roles: R1 which is assigned to Dil's organisation, R2 & R3 which are both not assigned to any organisation] as in [F-206_NoC_Auto_Approval_Case_Creation_By_Mario_With_Assigned_R1_Org_Policy], When a request is prepared with appropriate values, - And the request [is made by Dil to place a NOC Request for C1], + And a call [to verify that Dil has NOT been granted any case roles for the case] will get the expected response as in [F-206_Verify_Not_Granted_Case_Roles_Dil], And the request [contains all correct answers in the correct format], And the request [contains answers identifying case role R2], And it is submitted to call the [Request NoC] operation of [Manage Case Assignment Microservice], Then a positive response is received, And the response has all the details as expected, - And a call [to verify that Dil HAS been granted case roles R1 & R2 for the case but not R3] will get the expected response as in [F-206_Verify_Granted_Case_Roles_R1_R2_Dil], + And a call [to verify that Dil has NOT been granted any case roles for the case] will get the expected response as in [F-206_Verify_Not_Granted_Case_Roles_Dil], And a call [to verify there is NO pending NOC request on the case and the OrganisationPolicy for R2 HAS been updated] will get the expected response as in [F-206_Verify_Case_Data_COR_Approved_AddRepresentation], And a call [to get Case Events API returns a NoCRequest event in which the user ID is set to invoking users email address AND the proxied_by field set to the ID of the system user] will get the expected response as in [F-206_Verify_NoC_Request_Event_Data]. - + And a call [to get Grant Access Metadata API returning Standard Grant Access for case] will get the expected response as in [F-206_Verify_NoC_Request_Access_Metadata], #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # ACA-68 / AC-9 @@ -207,6 +208,7 @@ Scenario: (Happy Path) CAA requests NoC to replace representation - auto-approva And a call [to verify that Matt has NOT been granted any case roles for the case] will get the expected response as in [F-206_Verify_Not_Granted_Case_Roles_Matt], And another call [to verify there is NO pending NOC request on the case and the OrganisationPolicy for R2 HAS been updated] will get the expected response as in [F-206_Verify_Case_Data_COR_Approved_ReplaceRepresentation], And another call [to get Case Events API returns a NoCRequest event in which the user ID is set to invoking users email address AND the proxied_by field set to the ID of the system user] will get the expected response as in [F-206_Verify_NoC_Request_Event_Data]. + And a call [to get Grant Access Metadata API returning Standard Grant Access for case] will get the expected response as in [F-206_Verify_NoC_Request_Access_Metadata], #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -294,10 +296,10 @@ Scenario: (Happy Path) CAA (also a solicitor for the same jurisdiction) requests Then a positive response is received, And the response has all the details as expected, - And a call [to verify that Jane HAS been granted case roles R1 & R2 for the case but not R3] will get the expected response as in [F-206_Verify_Granted_Case_Roles_R1_R2_Jane], + And a call [to verify that Bill has NOT been granted any case roles for the case] will get the expected response as in [F-206_Verify_Not_Granted_Case_Roles_Bill], And a call [to verify there is NO pending NOC request on the case and the OrganisationPolicy for R2 HAS been updated] will get the expected response as in [F-206_Verify_Case_Data_COR_Approved_ReplaceRepresentation], - And a call [to get Case Events API returns a NoCRequest event in which the user ID is set to invoking users email address AND the proxied_by field set to the ID of the system user] will get the expected response as in [F-206_Verify_NoC_Request_Event_Data]. - + And a call [to get Case Events API returns a NoCRequest event in which the user ID is set to invoking users email address AND the proxied_by field set to the ID of the system user] will get the expected response as in [F-206_Verify_NoC_Request_Event_Data], + And a call [to get Grant Access Metadata API returning NO Grant Access for case] will get the expected response as in [F-206_Verify_NoC_Request_Access_Metadata_Bill] #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # ACA-68 / AC-14 @@ -316,10 +318,10 @@ Scenario: (Happy Path) CAA (also a solicitor for the same jurisdiction) requests Then a positive response is received, And the response has all the details as expected, - And a call [to verify that Jane HAS been granted case roles R1 & R2 for the case but not R3] will get the expected response as in [F-206_Verify_Granted_Case_Roles_R1_R2_Jane], + And a call [to verify that JANE has NOT been granted any case roles for the case] will get the expected response as in [F-206_Verify_Not_Granted_Case_Roles_Jane], And a call [to verify there is NO pending NOC request on the case and the OrganisationPolicy for R2 HAS been updated] will get the expected response as in [F-206_Verify_Case_Data_COR_Approved_AddRepresentation], - And a call [to get Case Events API returns a NoCRequest event in which the user ID is set to invoking users email address AND the proxied_by field set to the ID of the system user] will get the expected response as in [F-206_Verify_NoC_Request_Event_Data]. - + And a call [to get Case Events API returns a NoCRequest event in which the user ID is set to invoking users email address AND the proxied_by field set to the ID of the system user] will get the expected response as in [F-206_Verify_NoC_Request_Event_Data], + And a call [to get Grant Access Metadata API returning Standard Grant Access for case] will get the expected response as in [F-206_Verify_NoC_Request_Access_Metadata] #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # ACA-68 (repeat of ACA-71 / AC-4 && ACA-72 / AC-4 but for [Request NoC] API) diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/S-206.07.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/S-206.07.td.json index 9f0b03b6a..3d28dcace 100644 --- a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/S-206.07.td.json +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/S-206.07.td.json @@ -2,7 +2,7 @@ "_guid_": "S-206.7", "_extends_": "Request_NoC__Base", - "title": "(Happy Path) Solicitor requests NoC to replace representation - auto-approval applies", + "title": "(Happy Path) Solicitor having STANDARD access to case requests NoC to replace representation - auto-approval applies", "specs": [ "Richard - with the ability to create a case for a particular jurisdiction within an organisation", diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/GrantAccess/GrantAccess_FT_NoCAutoApprovalCaseType_CaseworkerCaa_SPECIFIC.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/GrantAccess/GrantAccess_FT_NoCAutoApprovalCaseType_CaseworkerCaa_SPECIFIC.td.json new file mode 100644 index 000000000..b52ba161f --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/GrantAccess/GrantAccess_FT_NoCAutoApprovalCaseType_CaseworkerCaa_SPECIFIC.td.json @@ -0,0 +1,19 @@ +{ + "_guid_": "GrantAccess_FT_NoCAutoApprovalCaseType_CaseworkerCaa_SPECIFIC", + "_extends_": "GrantAccess_FT_NoCAutoApprovalCaseType_CaseworkerCaa_SPECIFIC__Base", + + "specs": [ + "to grant SPECIFIC access to the caseworkerCaa" + ], + "request": { + "body": { + "case_users": [ + { + "case_id": "${[scenarioContext][siblingContexts][F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_With_Assigned_Org_Policies][testData][actualResponse][body][id]}", + "user_id": "${[scenarioContext][testData][users][invokingUser][id]}", + "case_role": "[SPECIFICACCESSPROFILE]" + } + ] + } + } +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/GrantAccess/GrantAccess_FT_NoCAutoApprovalCaseType_CaseworkerCaa_SPECIFIC__Base.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/GrantAccess/GrantAccess_FT_NoCAutoApprovalCaseType_CaseworkerCaa_SPECIFIC__Base.td.json new file mode 100644 index 000000000..f23cd138e --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/GrantAccess/GrantAccess_FT_NoCAutoApprovalCaseType_CaseworkerCaa_SPECIFIC__Base.td.json @@ -0,0 +1,13 @@ +{ + "_guid_": "GrantAccess_FT_NoCAutoApprovalCaseType_CaseworkerCaa_SPECIFIC__Base", + "_extends_": "CaseUserRoles_Add__PositiveResponse_Base", + + "users": { + "invokingUser": { + "_extends_": "BeftaCaseworkerCaa" + }, + "caseworker": { + "_extends_": "BeftaMasterCaseworker_Role1Basic" + } + } +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case-creation/FT_NoCAutoApprovalCaseType/F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_Token_Creation.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case-creation/FT_NoCAutoApprovalCaseType/F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_Token_Creation.td.json new file mode 100644 index 000000000..56d4e213e --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case-creation/FT_NoCAutoApprovalCaseType/F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_Token_Creation.td.json @@ -0,0 +1,14 @@ +{ + "_guid_": "F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_Token_Creation", + "_extends_": "NoC_Auto_Approval_Case_Creation_Token_Creation__Base", + + "specs": [ + "As a prerequisite" + ], + + "users": { + "invokingUser": { + "_extends_": "BeftaCaseworkerCaa" + } + } +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case-creation/FT_NoCAutoApprovalCaseType/F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_With_Assigned_Org_Policies.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case-creation/FT_NoCAutoApprovalCaseType/F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_With_Assigned_Org_Policies.td.json new file mode 100644 index 000000000..bec093b24 --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case-creation/FT_NoCAutoApprovalCaseType/F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_With_Assigned_Org_Policies.td.json @@ -0,0 +1,80 @@ +{ + "_guid_": "F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_With_Assigned_Org_Policies", + "_extends_": "F-206_NoC_Auto_Approval_Case_Creation__Base", + + "specs": [ + "by BeftaCaseworkerCaa to create a case C1 on behalf of Mario, which contains 3 Org Policies for 3 case roles: R1 which is assigned to Dil's organisation, R2 & R3 which are both assigned to BeftaCaseworkerCaa's organisation", + "by BeftaCaseworkerCaa to create a case C1 on behalf of Mario, which contains 3 Org Policies for 3 case roles: R1 which is assigned to Matt's organisation, R2 & R3 which are both assigned to BeftaCaseworkerCaa's organisation", + "by BeftaCaseworkerCaa to create a case C1 on behalf of Mario, which contains 3 Org Policies for 3 case roles: R1 which is assigned to Alice's organisation, R2 & R3 which are both assigned to BeftaCaseworkerCaa's organisation", + "by BeftaCaseworkerCaa to create a case C1 on behalf of Mario, which contains 3 Org Policies for 3 case roles: R1 which is assigned to Jane's organisation, R2 & R3 which are both assigned to BeftaCaseworkerCaa's organisation" + ], + + "users": { + "invokingUser": { + "_extends_": "BeftaCaseworkerCaa" + } + }, + + "prerequisites": [ + { + "Token_Creation": "F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_Token_Creation", + "Get_Organisation_Identifier": "Get_Organisation_Identifier_For_Any_Org1_User__Prerequisite" + } + ], + + "request": { + "body": { + "event_token": "${[scenarioContext][childContexts][Token_Creation][testData][actualResponse][body][token]}", + + "data": { + "applicantOrganisationPolicy": { + "Organisation": { + "OrganisationID": "${[scenarioContext][childContexts][Get_Organisation_Identifier][testData][actualResponse][body][organisationIdentifier]}" + } + }, + "respondentOrganisationPolicy": { + "Organisation": { + "OrganisationID": "LESTKK0" + }, + "PreviousOrganisations": [ + { + "_extends_": "F-206_PreviousOrganisations" + } + ] + }, + "otherPartyOrganisationPolicy": { + "Organisation": { + "OrganisationID": "LESTKK0" + } + } + } + } + }, + + "expectedResponse": { + "body": { + "case_data": { + "applicantOrganisationPolicy": { + "Organisation": { + "OrganisationID": "${[scenarioContext][childContexts][Get_Organisation_Identifier][testData][actualResponse][body][organisationIdentifier]}" + } + }, + "respondentOrganisationPolicy": { + "Organisation": { + "OrganisationID": "LESTKK0" + }, + "PreviousOrganisations": [ + { + "_extends_": "F-206_PreviousOrganisations" + } + ] + }, + "otherPartyOrganisationPolicy": { + "Organisation": { + "OrganisationID": "LESTKK0" + } + } + } + } + } +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case-data-snapshot/F-206_Take_Case_Data_Snapshot_For_NoC_Auto_Approval_Case_Created_By_BeftaCaseworkerCaa.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case-data-snapshot/F-206_Take_Case_Data_Snapshot_For_NoC_Auto_Approval_Case_Created_By_BeftaCaseworkerCaa.td.json new file mode 100644 index 000000000..4d770a03d --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case-data-snapshot/F-206_Take_Case_Data_Snapshot_For_NoC_Auto_Approval_Case_Created_By_BeftaCaseworkerCaa.td.json @@ -0,0 +1,10 @@ +{ + "_guid_": "F-206_Take_Case_Data_Snapshot_For_NoC_Auto_Approval_Case_Created_By_BeftaCaseworkerCaa", + "_extends_": "F-206_Take_Case_Data_Snapshot_For_NoC_Auto_Approval__Base", + + "request": { + "pathVariables": { + "caseId": "${[scenarioContext][parentContext][childContexts][F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_With_Assigned_Org_Policies][testData][actualResponse][body][id]}" + } + } +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case_users/CaseUserRoles_Add__Base.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case_users/CaseUserRoles_Add__Base.td.json new file mode 100644 index 000000000..d91a2432d --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case_users/CaseUserRoles_Add__Base.td.json @@ -0,0 +1,18 @@ +{ + "_guid_": "CaseUserRoles_Add__Base", + + "title": "Add Case-Assigned Users and Roles", + + "productName": "CCD Data Store Api", + "operationName": "Add Case-Assigned Users and Roles", + + "method": "POST", + "uri": "/case-users", + + "request": { + "_extends_": "Common_Request", + "body": { + "case_users": [] + } + } +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case_users/CaseUserRoles_Add__PositiveResponse_Base.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case_users/CaseUserRoles_Add__PositiveResponse_Base.td.json new file mode 100644 index 000000000..6231ed3f8 --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/case_users/CaseUserRoles_Add__PositiveResponse_Base.td.json @@ -0,0 +1,20 @@ +{ + "_guid_": "CaseUserRoles_Add__PositiveResponse_Base", + "_extends_": "CaseUserRoles_Add__Base", + + "s2sClientId": "aac_manage_case_assignment", + + "expectedResponse": { + "_extends_": "Common_201_Response", + + "headers": { + "Content-Length": "[[ANYTHING_PRESENT]]", + "Content-Type": "[[ANYTHING_PRESENT]]", + "Content-Encoding": "[[ANYTHING_PRESENT]]" + }, + + "body": { + "status_message": "Case-User-Role assignments created successfully" + } + } +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/verify-case-roles/F-206_Verify_Granted_Specific_Case_Roles_BeftaCaseworkerCaa.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/verify-case-roles/F-206_Verify_Granted_Specific_Case_Roles_BeftaCaseworkerCaa.td.json new file mode 100644 index 000000000..2c8e7f6cb --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/verify-case-roles/F-206_Verify_Granted_Specific_Case_Roles_BeftaCaseworkerCaa.td.json @@ -0,0 +1,15 @@ +{ + "_guid_": "F-206_Verify_Granted_Specific_Case_Roles_BeftaCaseworkerCaa", + "_extends_": "F-206_Verify_Granted_Case_Roles_R1_R2__Base", + + "specs": [ + "to verify that specific access has been granted to BeftaCaseworkerCaa for the case" + ], + + "users": { + "invokingUser": { + "_extends_": "BeftaCaseworkerCaa" + } + } + +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/verify-case-roles/F-206_Verify_Not_Granted_Case_Roles_Bill.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/verify-case-roles/F-206_Verify_Not_Granted_Case_Roles_Bill.td.json new file mode 100644 index 000000000..5b885aff8 --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/verify-case-roles/F-206_Verify_Not_Granted_Case_Roles_Bill.td.json @@ -0,0 +1,15 @@ +{ + "_guid_": "F-206_Verify_Not_Granted_Case_Roles_Bill", + "_extends_": "F-206_Verify_Not_Granted_Case_Roles__Base", + + "specs": [ + "to verify that Bill has NOT been granted any case roles for the case" + ], + + "users": { + "invokingUser": { + "_extends_": "ACA_Users_Bill" + } + } + +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/verify-case-roles/F-206_Verify_Not_Granted_Case_Roles_Jane.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/verify-case-roles/F-206_Verify_Not_Granted_Case_Roles_Jane.td.json new file mode 100644 index 000000000..0e1483c0e --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/common/verify-case-roles/F-206_Verify_Not_Granted_Case_Roles_Jane.td.json @@ -0,0 +1,15 @@ +{ + "_guid_": "F-206_Verify_Not_Granted_Case_Roles_Jane", + "_extends_": "F-206_Verify_Not_Granted_Case_Roles__Base", + + "specs": [ + "to verify that JANE has NOT been granted any case roles for the case" + ], + + "users": { + "invokingUser": { + "_extends_": "ACA_Users_CAA_Jane" + } + } + +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/verify-case-access-metadata/F-206_Verify_NoC_Request_Access_Metadata.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/verify-case-access-metadata/F-206_Verify_NoC_Request_Access_Metadata.td.json new file mode 100644 index 000000000..f5f344495 --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/verify-case-access-metadata/F-206_Verify_NoC_Request_Access_Metadata.td.json @@ -0,0 +1,28 @@ +{ + "_guid_": "F-206_Verify_NoC_Request_Access_Metadata", + "_extends_": "Retrieve_Access_Metadata_By_Case_ID__Base", + + "specs": [ + "to get Grant Access Metadata API returning Standard Grant Access for case" + ], + + "users": { + "invokingUser": { + "_extends_": "ACA_Users_Caseworker_CAA" + } + }, + + "request": { + "pathVariables": { + "caseId": "${[scenarioContext][parentContext][testData][request][body][case_id]}" + } + }, + + "expectedResponse": { + "_extends_": "Common_200_Response", + "body": { + "accessGrants" : [ "STANDARD" ], + "accessProcess": "NONE" + } + } +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/verify-case-access-metadata/F-206_Verify_NoC_Request_Access_Metadata_Bill.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/verify-case-access-metadata/F-206_Verify_NoC_Request_Access_Metadata_Bill.td.json new file mode 100644 index 000000000..ca8cd0ec3 --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/verify-case-access-metadata/F-206_Verify_NoC_Request_Access_Metadata_Bill.td.json @@ -0,0 +1,28 @@ +{ + "_guid_": "F-206_Verify_NoC_Request_Access_Metadata_Bill", + "_extends_": "Retrieve_Access_Metadata_By_Case_ID__Base", + + "specs": [ + "to get Grant Access Metadata API returning NO Grant Access for case" + ], + + "users": { + "invokingUser": { + "_extends_": "ACA_Users_Bill" + } + }, + + "request": { + "pathVariables": { + "caseId": "${[scenarioContext][parentContext][testData][request][body][case_id]}" + } + }, + + "expectedResponse": { + "_extends_": "Common_200_Response", + "body": { + "accessGrants" : [ ], + "accessProcess": "SPECIFIC" + } + } +} diff --git a/src/functionalTest/resources/features/F-206 - Request Notice Of Change/verify-case-access-metadata/F-206_Verify_NoC_Request_Access_Metadata_Jane.td.json b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/verify-case-access-metadata/F-206_Verify_NoC_Request_Access_Metadata_Jane.td.json new file mode 100644 index 000000000..bc3f49ae6 --- /dev/null +++ b/src/functionalTest/resources/features/F-206 - Request Notice Of Change/verify-case-access-metadata/F-206_Verify_NoC_Request_Access_Metadata_Jane.td.json @@ -0,0 +1,28 @@ +{ + "_guid_": "F-206_Verify_NoC_Request_Access_Metadata_Jane", + "_extends_": "Retrieve_Access_Metadata_By_Case_ID__Base", + + "specs": [ + "to get Grant Access Metadata API returning Standard Grant Access for case" + ], + + "users": { + "invokingUser": { + "_extends_": "ACA_Users_CAA_Jane" + } + }, + + "request": { + "pathVariables": { + "caseId": "${[scenarioContext][parentContext][testData][request][body][case_id]}" + } + }, + + "expectedResponse": { + "_extends_": "Common_200_Response", + "body": { + "accessGrants" : [ "STANDARD" ], + "accessProcess": "NONE" + } + } +} diff --git a/src/functionalTest/resources/features/F-206a - Request Notice Of Change Assigning Cases/F-206a - Request Notice Of Change Assigning Cases.feature b/src/functionalTest/resources/features/F-206a - Request Notice Of Change Assigning Cases/F-206a - Request Notice Of Change Assigning Cases.feature new file mode 100644 index 000000000..e0ccc0fa6 --- /dev/null +++ b/src/functionalTest/resources/features/F-206a - Request Notice Of Change Assigning Cases/F-206a - Request Notice Of Change Assigning Cases.feature @@ -0,0 +1,75 @@ +#============================================= +@F-206a +Feature: F-206a: Request Notice of Change (NoC) - Assigning Cases +#============================================= + +Background: + Given an appropriate test context as detailed in the test data source + +#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + @S-206a.01 @callbackTests #(S-206.7 REPLACEMENT) + Scenario: NoC is requested by a Solicitor having STANDARD access to case - auto-approval applies + + Given a user [Richard - with the ability to create a case for a particular jurisdiction within an organisation], + And a user [Dil - with a solicitor role for the same jurisdiction, within a different organisation from Richard's], + And [a citizen Mario, on behalf of whom Richard will create a case] in the context, + And a successful call [by Richard to create a case C1 on behalf of Mario, which contains 3 Org Policies for 3 case roles: R1 which is assigned to Dil's organisation, R2 & R3 which are both assigned to Richard's organisation] as in [F-206_NoC_Auto_Approval_Case_Creation_By_Richard_With_Assigned_Org_Policies], + + When a request is prepared with appropriate values, + And the request [is made by Dil to place a NOC Request for C1], + And the request [contains all correct answers in the correct format], + And the request [contains answers identifying case role R2], + And it is submitted to call the [Request NoC] operation of [Manage Case Assignment Microservice], + + Then a positive response is received, + And the response has all the details as expected, + And a call [to verify that Dil has NOT been granted any case roles for the case] will get the expected response as in [F-206_Verify_Not_Granted_Case_Roles_Dil], + And a call [to verify there is NO pending NOC request on the case and the OrganisationPolicy for R2 HAS been updated] will get the expected response as in [F-206_Verify_Case_Data_COR_Approved_ReplaceRepresentation], + And a call [to get Case Events API returns a NoCRequest event in which the user ID is set to invoking users email address AND the proxied_by field set to the ID of the system user] will get the expected response as in [F-206_Verify_NoC_Request_Event_Data]. + And a call [to get Grant Access Metadata API returning Standard Grant Access for case] will get the expected response as in [F-206_Verify_NoC_Request_Access_Metadata], + + @S-206a.02 @callbackTests + Scenario: NoC is requested by a Solicitor having SPECIFIC access to case - auto-approval applies + + Given a user [BeftaCaseworkerCaa - with the ability to create a case for a particular jurisdiction within an organisation], + And a user [Dil - with a solicitor role for the same jurisdiction, within a different organisation from BeftaCaseworkerCaa's], + And [a citizen Mario, on behalf of whom BeftaCaseworkerCaa will create a case] in the context, + And a successful call [by BeftaCaseworkerCaa to create a case C1 on behalf of Mario, which contains 3 Org Policies for 3 case roles: R1 which is assigned to Dil's organisation, R2 & R3 which are both assigned to BeftaCaseworkerCaa's organisation] as in [F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_With_Assigned_Org_Policies], + And a successful call [to grant SPECIFIC access to the caseworkerCaa] as in [GrantAccess_FT_NoCAutoApprovalCaseType_CaseworkerCaa_SPECIFIC] + + When a request is prepared with appropriate values, + And the request [is made by Dil to place a NOC Request for C1], + And the request [contains all correct answers in the correct format], + And the request [contains answers identifying case role R2], + And it is submitted to call the [Request NoC] operation of [Manage Case Assignment Microservice], + + Then a positive response is received, + And the response has all the details as expected, + And a call [to verify that specific access has been granted to BeftaCaseworkerCaa for the case] will get the expected response as in [F-206_Verify_Granted_Specific_Case_Roles_BeftaCaseworkerCaa], + And a call [to verify there is NO pending NOC request on the case and the OrganisationPolicy for R2 HAS been updated] will get the expected response as in [F-206_Verify_Case_Data_COR_Approved_ReplaceRepresentation], + And a call [to get Case Events API returns a NoCRequest event in which the user ID is set to invoking users email address AND the proxied_by field set to the ID of the system user] will get the expected response as in [F-206_Verify_NoC_Request_Event_Data]. + And a call [to get Grant Access Metadata API returning Standard Grant Access for case] will get the expected response as in [F-206_Verify_NoC_Request_Access_Metadata], + + + @Ignore @S-206a.03 @callbackTests #SPECIFIC + Scenario: NoC is requested by a Solicitor having SPECIFIC access to case - auto-approval applies + + Given a user [BeftaCaseworkerCaa - with the ability to create a case for a particular jurisdiction within an organisation], + And a user [Dil - with a solicitor role for the same jurisdiction, within a different organisation from Richard's], + And [a citizen Mario, on behalf of whom Richard will create a case] in the context, + And a successful call [by Richard to create a case C1 on behalf of Mario, which contains 3 Org Policies for 3 case roles: R1 which is assigned to Dil's organisation, R2 & R3 which are both assigned to Richard's organisation] as in [F-206_NoC_Auto_Approval_Case_Creation_By_Richard_With_Assigned_Org_Policies], + And a successful call [to grant SPECIFIC access to the caseworkerCaa] as in [GrantAccess_FT_NoCAutoApprovalCaseTypeRole_CaseworkerCaa_SPECIFIC] + + When a request is prepared with appropriate values, + And the request [is made by Dil to place a NOC Request for C1], + And the request [contains all correct answers in the correct format], + And the request [contains answers identifying case role R2], + And it is submitted to call the [Request NoC] operation of [Manage Case Assignment Microservice], + + Then a positive response is received, + And the response has all the details as expected, + And a call [to verify that specific access has been granted to BeftaCaseworkerCaa for the case] will get the expected response as in [F-206_Verify_Granted_Case_Roles_BeftaCaseworkerCaa], + And a call [to verify there is NO pending NOC request on the case and the OrganisationPolicy for R2 HAS been updated] will get the expected response as in [F-206_Verify_Case_Data_COR_Approved_ReplaceRepresentation], + And a call [to get Case Events API returns a NoCRequest event in which the user ID is set to invoking users email address AND the proxied_by field set to the ID of the system user] will get the expected response as in [F-206_Verify_NoC_Request_Event_Data]. + And a call [to get Grant Access Metadata API returning Standard Grant Access for case] will get the expected response as in [F-206_Verify_NoC_Request_Access_Metadata], diff --git a/src/functionalTest/resources/features/F-206a - Request Notice Of Change Assigning Cases/S-206a.01.td.json b/src/functionalTest/resources/features/F-206a - Request Notice Of Change Assigning Cases/S-206a.01.td.json new file mode 100644 index 000000000..e3080f206 --- /dev/null +++ b/src/functionalTest/resources/features/F-206a - Request Notice Of Change Assigning Cases/S-206a.01.td.json @@ -0,0 +1,48 @@ +{ + "_guid_": "S-206a.01", + "_extends_": "Request_NoC__Base", + + "title": "NoC is requested by a Solicitor having STANDARD access to case - auto-approval applies", + + "specs": [ + "Richard - with the ability to create a case for a particular jurisdiction within an organisation", + "Dil - with a solicitor role for the same jurisdiction, within a different organisation from Richard's", + "a citizen Mario, on behalf of whom Richard will create a case", + + "contains all correct answers in the correct format", + "contains answers identifying case role R2", + + "is made by Dil to place a NOC Request for C1" + ], + + "users": { + "Richard": { + "_extends_": "ACA_Users_Richard" + }, + "invokingUser": { + "_extends_": "ACA_Users_Dil" + } + }, + + "prerequisites": [ + { "case_snapshot": "F-206_Take_Case_Data_Snapshot_For_NoC_Auto_Approval_Case_Created_By_Richard" + } + ], + + "request": { + "body": { + "_extends_": "NoC_Auto_Approval_Valid_Answers_For_Case_Role_R2", + + "case_id": "${[scenarioContext][childContexts][F-206_NoC_Auto_Approval_Case_Creation_By_Richard_With_Assigned_Org_Policies][testData][actualResponse][body][id]}" + } + }, + + "expectedResponse": { + "_extends_": "Common_201_Response", + "body": { + "status_message": "The Notice of Change request has been successfully submitted.", + "case_role": "[RespondentSolicitor]", + "approval_status": "APPROVED" + } + } +} diff --git a/src/functionalTest/resources/features/F-206a - Request Notice Of Change Assigning Cases/S-206a.02.td.json b/src/functionalTest/resources/features/F-206a - Request Notice Of Change Assigning Cases/S-206a.02.td.json new file mode 100644 index 000000000..dd1571893 --- /dev/null +++ b/src/functionalTest/resources/features/F-206a - Request Notice Of Change Assigning Cases/S-206a.02.td.json @@ -0,0 +1,48 @@ +{ + "_guid_": "S-206a.02", + "_extends_": "Request_NoC__Base", + + "title": "NoC is requested by a Solicitor having STANDARD access to case - auto-approval applies", + + "specs": [ + "BeftaCaseworkerCaa - with the ability to create a case for a particular jurisdiction within an organisation", + "Dil - with a solicitor role for the same jurisdiction, within a different organisation from BeftaCaseworkerCaa's", + "a citizen Mario, on behalf of whom BeftaCaseworkerCaa will create a case", + + "contains all correct answers in the correct format", + "contains answers identifying case role R2", + + "is made by Dil to place a NOC Request for C1" + ], + + "users": { + "Richard": { + "_extends_": "BeftaCaseworkerCaa" + }, + "invokingUser": { + "_extends_": "ACA_Users_Dil" + } + }, + + "prerequisites": [ + { "case_snapshot": "F-206_Take_Case_Data_Snapshot_For_NoC_Auto_Approval_Case_Created_By_BeftaCaseworkerCaa" + } + ], + + "request": { + "body": { + "_extends_": "NoC_Auto_Approval_Valid_Answers_For_Case_Role_R2", + + "case_id": "${[scenarioContext][childContexts][F-206_NoC_Auto_Approval_Case_Creation_By_BeftaCaseworkerCaa_With_Assigned_Org_Policies][testData][actualResponse][body][id]}" + } + }, + + "expectedResponse": { + "_extends_": "Common_201_Response", + "body": { + "status_message": "The Notice of Change request has been successfully submitted.", + "case_role": "[RespondentSolicitor]", + "approval_status": "APPROVED" + } + } +} diff --git a/src/functionalTest/resources/features/common/data-store/Retrieve_Access_Metadata_By_Case_ID__Base.td.json b/src/functionalTest/resources/features/common/data-store/Retrieve_Access_Metadata_By_Case_ID__Base.td.json new file mode 100644 index 000000000..447354232 --- /dev/null +++ b/src/functionalTest/resources/features/common/data-store/Retrieve_Access_Metadata_By_Case_ID__Base.td.json @@ -0,0 +1,20 @@ +{ + "_guid_": "Retrieve_Access_Metadata_By_Case_ID__Base", + + "productName": "CCD Data Store", + "operationName": "Retrieve access metadata for a given case ID", + + "method": "GET", + "uri": "{{CCD_DATA_STORE_API_BASE_URL}}/internal/cases/{caseId}/access-metadata", + + "request": { + "_extends_": "Common_Request", + "headers": { + "experimental": "true" + } + }, + + "expectedResponse": { + "_extends_": "Common_200_Response" + } +} diff --git a/src/functionalTest/resources/features/common/users/RoleAccess/BeftaCaseworkerCaa.td.json b/src/functionalTest/resources/features/common/users/RoleAccess/BeftaCaseworkerCaa.td.json new file mode 100644 index 000000000..d771f09cd --- /dev/null +++ b/src/functionalTest/resources/features/common/users/RoleAccess/BeftaCaseworkerCaa.td.json @@ -0,0 +1,6 @@ +{ + "_guid_": "BeftaCaseworkerCaa", + + "username": "befta.caseworker.caa@gmail.com", + "password": "[[$CCD_BEFTA_CASEWORKER_CAA_PWD]]" +} diff --git a/src/functionalTest/resources/features/common/users/RoleAccess/BeftaMasterCaseworker_Role1Basic.td.json b/src/functionalTest/resources/features/common/users/RoleAccess/BeftaMasterCaseworker_Role1Basic.td.json new file mode 100644 index 000000000..2cd9adaa8 --- /dev/null +++ b/src/functionalTest/resources/features/common/users/RoleAccess/BeftaMasterCaseworker_Role1Basic.td.json @@ -0,0 +1,6 @@ +{ + "_guid_": "BeftaMasterCaseworker_Role1Basic", + + "username": "master.caseworker.role1.basic@gmail.com", + "password": "[[$CCD_BEFTA_MASTER_CASEWORKER_ROLE1_BASIC_PWD]]" +}