Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
Loading