diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/Default_Document_Upload_Data_45.td.json b/src/aat/resources/features/F-1003 - Case Creation With Documents/Default_Document_Upload_Data_45.td.json new file mode 100644 index 0000000000..15e696450f --- /dev/null +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/Default_Document_Upload_Data_45.td.json @@ -0,0 +1,34 @@ +{ + "_guid_": "Default_Document_Upload_Data_45", + "_extends_": "Default_Document_Upload_Data_Base", + "specs": [ + "to upload a document with mandatory metadata" + ], + "users": { + "invokingUser": { + "_extends_": "BeftaMasterCaseworker" + } + }, + "request": { + "body": { + "arrayInMap": [ + { + "key": "classification", + "value": "PUBLIC" + }, + { + "key": "caseTypeId", + "value": "FT_MasterCaseType" + }, + { + "key": "jurisdictionId", + "value": "BEFTA_MASTER" + }, + { + "key": "files", + "filePath": "features/common/files/Sample.png" + } + ] + } + } +} diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/Default_Document_Upload_Data_46.td.json b/src/aat/resources/features/F-1003 - Case Creation With Documents/Default_Document_Upload_Data_46.td.json new file mode 100644 index 0000000000..903b26d240 --- /dev/null +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/Default_Document_Upload_Data_46.td.json @@ -0,0 +1,34 @@ +{ + "_guid_": "Default_Document_Upload_Data_46", + "_extends_": "Default_Document_Upload_Data_Base", + "specs": [ + "to upload a document with mandatory metadata" + ], + "users": { + "invokingUser": { + "_extends_": "BeftaMasterCaseworker" + } + }, + "request": { + "body": { + "arrayInMap": [ + { + "key": "classification", + "value": "PUBLIC" + }, + { + "key": "caseTypeId", + "value": "FT_MasterCaseType" + }, + { + "key": "jurisdictionId", + "value": "BEFTA_MASTER" + }, + { + "key": "files", + "filePath": "features/common/files/Sample.png" + } + ] + } + } +} diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/F-1003.feature b/src/aat/resources/features/F-1003 - Case Creation With Documents/F-1003.feature index 224a9d9563..91ded793d5 100644 --- a/src/aat/resources/features/F-1003 - Case Creation With Documents/F-1003.feature +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/F-1003.feature @@ -155,3 +155,29 @@ Feature: F-1003: Submit Case Creation And the response [contains necessary details about the document attached to the case], And the response has all other details as expected, And a call [to retrieve case details by case id] will get the expected response as in [Default_Get_Case_Data_Base_02] + + @S-1045 # CCD-7472 regression: documents stripped by the about-to-submit callback must not be attached to CDAM + Scenario: Submit case creation with a document but the callback strips it - document must not be persisted + Given a user with [an active caseworker profile in CCD with full permissions on a document field], + And a successful call [to upload a document with mandatory metadata] as in [Default_Document_Upload_Data_45], + And a successful call [to register a document strip callback stub with the ccd-test-stubs service] as in [Register_Doc_Strip_Stub], + And a successful call [to create a token for case creation] as in [S-1045_Case_Data_Create_Token_Creation], + When a request is prepared with appropriate values, + And the request [contains a document with a valid hash token], + And it is submitted to call the [Submit Case Creation] operation of [CCD Data Store], + Then a positive response is received, + And the response [does not contain the document stripped by the callback], + And the response has all other details as expected. + + @S-1046 # CCD-7472 guard: the saved-data filter must not drop documents the callback retains + Scenario: Submit case creation with a document and the callback echoes the data - document must be persisted + Given a user with [an active caseworker profile in CCD with full permissions on a document field], + And a successful call [to upload a document with mandatory metadata] as in [Default_Document_Upload_Data_46], + And a successful call [to register a document echo callback stub with the ccd-test-stubs service] as in [Register_Doc_Echo_Stub], + And a successful call [to create a token for case creation] as in [S-1046_Case_Data_Create_Token_Creation], + When a request is prepared with appropriate values, + And the request [contains a document with a valid hash token], + And it is submitted to call the [Submit Case Creation] operation of [CCD Data Store], + Then a positive response is received, + And the response [contains the document attached to the case], + And the response has all other details as expected. diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/Register_Doc_Echo_Stub.td.json b/src/aat/resources/features/F-1003 - Case Creation With Documents/Register_Doc_Echo_Stub.td.json new file mode 100644 index 0000000000..836cf97cff --- /dev/null +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/Register_Doc_Echo_Stub.td.json @@ -0,0 +1,71 @@ +{ + "_guid_": "Register_Doc_Echo_Stub", + "_extends_": "Register_Dynamic_Stub", + "specs": [ + "to register a document echo callback stub with the ccd-test-stubs service" + ], + "prerequisites": [ + "UnRegister_All_Doc_Echo_Stubs_By_Metadata" + ], + "request": { + "body": { + "priority": 1, + "request": { + "method": "POST", + "urlPath": "/document_hash_callback", + "bodyPatterns": [ + { + "contains": "S-1046-payload" + } + ] + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "case_data": {} + }, + "transformers": [ + "dynamic-case-case-data-response-transformer" + ] + }, + "metadata": { + "testId": "S-1046" + } + } + }, + "expectedResponse": { + "_extends_": "Common_201_Response", + "body": { + "id": "[[ANY_STRING_NOT_NULLABLE]]", + "priority": 1, + "request": { + "urlPath": "/document_hash_callback", + "method": "POST", + "bodyPatterns": [ + { + "contains": "S-1046-payload" + } + ] + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "case_data": {} + }, + "transformers": [ + "dynamic-case-case-data-response-transformer" + ] + }, + "uuid": "[[ANY_STRING_NOT_NULLABLE]]", + "metadata": { + "testId": "S-1046" + } + } + } +} \ No newline at end of file diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/Register_Doc_Strip_Stub.td.json b/src/aat/resources/features/F-1003 - Case Creation With Documents/Register_Doc_Strip_Stub.td.json new file mode 100644 index 0000000000..eff03a9661 --- /dev/null +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/Register_Doc_Strip_Stub.td.json @@ -0,0 +1,69 @@ +{ + "_guid_": "Register_Doc_Strip_Stub", + "_extends_": "Register_Dynamic_Stub", + "specs": [ + "to register a document strip callback stub with the ccd-test-stubs service" + ], + "prerequisites": [ + "UnRegister_All_Doc_Strip_Stubs_By_Metadata" + ], + "request": { + "body": { + "priority": 1, + "request": { + "method": "POST", + "urlPath": "/document_hash_callback", + "bodyPatterns": [ + { + "contains": "S-1045-payload" + } + ] + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "data": { + "TextField": "S-1045-stripped-by-callback" + } + } + }, + "metadata": { + "testId": "S-1045" + } + } + }, + "expectedResponse": { + "_extends_": "Common_201_Response", + "body": { + "id": "[[ANY_STRING_NOT_NULLABLE]]", + "priority": 1, + "request": { + "urlPath": "/document_hash_callback", + "method": "POST", + "bodyPatterns": [ + { + "contains": "S-1045-payload" + } + ] + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "data": { + "TextField": "S-1045-stripped-by-callback" + } + } + }, + "uuid": "[[ANY_STRING_NOT_NULLABLE]]", + "metadata": { + "testId": "S-1045" + } + } + } +} diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1045.td.json b/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1045.td.json new file mode 100644 index 0000000000..3b8cbc0317 --- /dev/null +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1045.td.json @@ -0,0 +1,86 @@ +{ + "_guid_": "S-1045", + "productName": "CCD Data Store", + "operationName": "Submit Case Creation", + "title": "Callback strips the payload document - document must not be persisted nor attached", + "specs": [ + "an active caseworker profile in CCD with full permissions on a document field", + "contains a document with a valid hash token", + "does not contain the document stripped by the callback" + ], + "users": { + "invokingUser": { + "_extends_": "BeftaMasterCaseworker" + } + }, + "method": "POST", + "uri": "case-types/{CaseTypeID}/cases", + "request": { + "headers": { + "Authorization": "[[DEFAULT_AUTO_VALUE]]", + "ServiceAuthorization": "[[DEFAULT_AUTO_VALUE]]", + "Content-Type": "application/json;charset=UTF-8", + "experimental": true + }, + "pathVariables": { + "CaseTypeID": "FT_MasterCaseType" + }, + "body": { + "data": { + "TextField": "S-1045-payload", + "DocumentField": { + "document_url": "${[scenarioContext][childContexts][Default_Document_Upload_Data_45][testData][actualResponse][body][documents][0][_links][self][href]}", + "document_filename": "${[scenarioContext][childContexts][Default_Document_Upload_Data_45][testData][actualResponse][body][documents][0][originalDocumentName]}", + "document_binary_url": "${[scenarioContext][childContexts][Default_Document_Upload_Data_45][testData][actualResponse][body][documents][0][_links][binary][href]}", + "document_hash": "${[scenarioContext][childContexts][Default_Document_Upload_Data_45][testData][actualResponse][body][documents][0][hashToken]}" + } + }, + "event": { + "id": "documentHashCallback", + "summary": "", + "description": "" + }, + "event_token": "${[scenarioContext][childContexts][S-1045_Case_Data_Create_Token_Creation][testData][actualResponse][body][token]}", + "ignore_warning": false, + "draft_id": null + } + }, + "expectedResponse": { + "_extends_": "Common_201_Response", + "headers": { + "Content-Encoding": "[[ANYTHING_PRESENT]]", + "Content-Length": "[[ANYTHING_PRESENT]]", + "Content-Type": "[[ANYTHING_PRESENT]]" + }, + "body": { + "_links": { + "self": "[[ANYTHING_PRESENT]]" + }, + "id": "[[ANYTHING_PRESENT]]", + "jurisdiction": "BEFTA_MASTER", + "case_type": "FT_MasterCaseType", + "created_on": "[[ANYTHING_PRESENT]]", + "last_modified_on": "[[ANYTHING_PRESENT]]", + "last_state_modified_on": "[[ANYTHING_PRESENT]]", + "state": "CaseCreated", + "security_classification": "PUBLIC", + "data": { + "TextField": "S-1045-stripped-by-callback", + "SearchCriteria": {} + }, + "data_classification": { + "TextField": "PUBLIC", + "SearchCriteria": { + "classification": "PUBLIC", + "value": {} + } + }, + "after_submit_callback_response": null, + "callback_response_status_code": null, + "callback_response_status": null, + "callback_error_message": null, + "delete_draft_response_status_code": null, + "delete_draft_response_status": null + } + } +} diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1045_Case_Data_Create_Token_Creation.td.json b/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1045_Case_Data_Create_Token_Creation.td.json new file mode 100644 index 0000000000..c2820214b7 --- /dev/null +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1045_Case_Data_Create_Token_Creation.td.json @@ -0,0 +1,29 @@ +{ + "_guid_": "S-1045_Case_Data_Create_Token_Creation", + "_extends_": "Standard_Token_Creation_Data_For_Case_Creation", + "specs": [ + "to create a token for case creation" + ], + "users": { + "invokingUser": { + "_extends_": "BeftaMasterCaseworker" + } + }, + "request": { + "pathVariables": { + "uid": "[[DEFAULT_AUTO_VALUE]]", + "jid": "BEFTA_MASTER", + "ctid": "FT_MasterCaseType", + "etid": "documentHashCallback" + } + }, + "expectedResponse": { + "body": { + "case_details": { + "jurisdiction": "BEFTA_MASTER", + "case_type_id": "FT_MasterCaseType" + }, + "event_id": "documentHashCallback" + } + } +} diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1046.td.json b/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1046.td.json new file mode 100644 index 0000000000..882e01d53d --- /dev/null +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1046.td.json @@ -0,0 +1,93 @@ +{ + "_guid_": "S-1046", + "productName": "CCD Data Store", + "operationName": "Submit Case Creation", + "title": "Callback echoes the data - payload document must be persisted and attached", + "specs": [ + "an active caseworker profile in CCD with full permissions on a document field", + "contains a document with a valid hash token", + "contains the document attached to the case" + ], + "users": { + "invokingUser": { + "_extends_": "BeftaMasterCaseworker" + } + }, + "method": "POST", + "uri": "case-types/{CaseTypeID}/cases", + "request": { + "headers": { + "Authorization": "[[DEFAULT_AUTO_VALUE]]", + "ServiceAuthorization": "[[DEFAULT_AUTO_VALUE]]", + "Content-Type": "application/json;charset=UTF-8", + "experimental": true + }, + "pathVariables": { + "CaseTypeID": "FT_MasterCaseType" + }, + "body": { + "data": { + "TextField": "S-1046-payload", + "DocumentField": { + "document_url": "${[scenarioContext][childContexts][Default_Document_Upload_Data_46][testData][actualResponse][body][documents][0][_links][self][href]}", + "document_filename": "${[scenarioContext][childContexts][Default_Document_Upload_Data_46][testData][actualResponse][body][documents][0][originalDocumentName]}", + "document_binary_url": "${[scenarioContext][childContexts][Default_Document_Upload_Data_46][testData][actualResponse][body][documents][0][_links][binary][href]}", + "document_hash": "${[scenarioContext][childContexts][Default_Document_Upload_Data_46][testData][actualResponse][body][documents][0][hashToken]}" + } + }, + "event": { + "id": "documentHashCallback", + "summary": "", + "description": "" + }, + "event_token": "${[scenarioContext][childContexts][S-1046_Case_Data_Create_Token_Creation][testData][actualResponse][body][token]}", + "ignore_warning": false, + "draft_id": null + } + }, + "expectedResponse": { + "_extends_": "Common_201_Response", + "headers": { + "Content-Encoding": "[[ANYTHING_PRESENT]]", + "Content-Length": "[[ANYTHING_PRESENT]]", + "Content-Type": "[[ANYTHING_PRESENT]]" + }, + "body": { + "_links": { + "self": "[[ANYTHING_PRESENT]]" + }, + "id": "[[ANYTHING_PRESENT]]", + "jurisdiction": "BEFTA_MASTER", + "case_type": "FT_MasterCaseType", + "created_on": "[[ANYTHING_PRESENT]]", + "last_modified_on": "[[ANYTHING_PRESENT]]", + "last_state_modified_on": "[[ANYTHING_PRESENT]]", + "state": "CaseCreated", + "security_classification": "PUBLIC", + "data": { + "TextField": "S-1046-payload", + "DocumentField": { + "document_url": "${[scenarioContext][childContexts][Default_Document_Upload_Data_46][testData][actualResponse][body][documents][0][_links][self][href]}", + "document_filename": "${[scenarioContext][childContexts][Default_Document_Upload_Data_46][testData][actualResponse][body][documents][0][originalDocumentName]}", + "document_binary_url": "${[scenarioContext][childContexts][Default_Document_Upload_Data_46][testData][actualResponse][body][documents][0][_links][binary][href]}", + "upload_timestamp": "[[ANYTHING_PRESENT]]" + }, + "SearchCriteria": {} + }, + "data_classification": { + "TextField": "PUBLIC", + "DocumentField": "PUBLIC", + "SearchCriteria": { + "classification": "PUBLIC", + "value": {} + } + }, + "after_submit_callback_response": null, + "callback_response_status_code": null, + "callback_response_status": null, + "callback_error_message": null, + "delete_draft_response_status_code": null, + "delete_draft_response_status": null + } + } +} diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1046_Case_Data_Create_Token_Creation.td.json b/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1046_Case_Data_Create_Token_Creation.td.json new file mode 100644 index 0000000000..48435cfa0a --- /dev/null +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/S-1046_Case_Data_Create_Token_Creation.td.json @@ -0,0 +1,29 @@ +{ + "_guid_": "S-1046_Case_Data_Create_Token_Creation", + "_extends_": "Standard_Token_Creation_Data_For_Case_Creation", + "specs": [ + "to create a token for case creation" + ], + "users": { + "invokingUser": { + "_extends_": "BeftaMasterCaseworker" + } + }, + "request": { + "pathVariables": { + "uid": "[[DEFAULT_AUTO_VALUE]]", + "jid": "BEFTA_MASTER", + "ctid": "FT_MasterCaseType", + "etid": "documentHashCallback" + } + }, + "expectedResponse": { + "body": { + "case_details": { + "jurisdiction": "BEFTA_MASTER", + "case_type_id": "FT_MasterCaseType" + }, + "event_id": "documentHashCallback" + } + } +} diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/UnRegister_All_Doc_Echo_Stubs_By_Metadata.td.json b/src/aat/resources/features/F-1003 - Case Creation With Documents/UnRegister_All_Doc_Echo_Stubs_By_Metadata.td.json new file mode 100644 index 0000000000..12852ef3e0 --- /dev/null +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/UnRegister_All_Doc_Echo_Stubs_By_Metadata.td.json @@ -0,0 +1,20 @@ +{ + "_guid_": "UnRegister_All_Doc_Echo_Stubs_By_Metadata", + "_extends_": "UnRegister_Dynamic_Stub_By_Metadata", + "specs": [ + "to unregister all S-1046 callback stubs from the ccd-test-stubs service", + "As a prerequisite" + ], + "request": { + "body": { + "matchesJsonPath": { + "expression": "$.testId", + "contains": "S-1046" + } + } + }, + "expectedResponse": { + "_extends_": "Common_200_Response", + "body": {} + } +} diff --git a/src/aat/resources/features/F-1003 - Case Creation With Documents/UnRegister_All_Doc_Strip_Stubs_By_Metadata.td.json b/src/aat/resources/features/F-1003 - Case Creation With Documents/UnRegister_All_Doc_Strip_Stubs_By_Metadata.td.json new file mode 100644 index 0000000000..b9d2603993 --- /dev/null +++ b/src/aat/resources/features/F-1003 - Case Creation With Documents/UnRegister_All_Doc_Strip_Stubs_By_Metadata.td.json @@ -0,0 +1,20 @@ +{ + "_guid_": "UnRegister_All_Doc_Strip_Stubs_By_Metadata", + "_extends_": "UnRegister_Dynamic_Stub_By_Metadata", + "specs": [ + "to unregister all S-1045 callback stubs from the ccd-test-stubs service", + "As a prerequisite" + ], + "request": { + "body": { + "matchesJsonPath": { + "expression": "$.testId", + "contains": "S-1045" + } + } + }, + "expectedResponse": { + "_extends_": "Common_200_Response", + "body": {} + } +}