Skip to content
Open
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ext {
testContainersVersion = '2.0.5'
cucumber = '7.34.3'
beftaFwVersion = '9.2.6'
ccdTestDefinitionVersion = '7.26.7'
ccdTestDefinitionVersion = '7.26.0-rc1'
limits = [
'instruction': 90,
'branch' : 85,
Expand Down
3 changes: 2 additions & 1 deletion charts/ccd-data-store-api/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ ccd:
ccd-definition-store-api:
java:
ingressHost: ccd-definition-store-${SERVICE_FQDN}
image: hmctsprod.azurecr.io/ccd/definition-store-api:latest
image: hmctsprod.azurecr.io/ccd/definition-store-api:pr-1800
#image: hmctsprod.azurecr.io/ccd/definition-store-api:pr-1611
imagePullPolicy: Always
devmemoryRequests: 2048Mi
devcpuRequests: 2000m
Expand Down
56 changes: 56 additions & 0 deletions src/aat/resources/features/F-942 - Get Closed Cases/F-942.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
@F-942
Feature: F-942: Get closed cases

Background: Load test data for the scenario
Given an appropriate test context as detailed in the test data source
And a call [to delete existing date case closed records] will get the expected response as in [F-942_DeleteExistingDateCaseClosed],

@S-942.1
Scenario: Return 200 when get closed cases requested
Given a case that has just been created as in [Standard_Full_Case_Creation_Data],
And a successful call [to create a date case closed record] as in [S-942.1_CreateDateCaseClosed],
And a user with [an active profile in CCD],

When a request is prepared with appropriate values,
And the request [contains Date field],
And it is submitted to call the [get closed cases] operation of [CCD Data Store],

Then a positive response is received,
And the response has all other details as expected.

@S-942.2
Scenario: Return 400 if date validation fails
Given a user with [an active profile in CCD],

When a request is prepared with appropriate values,
And the request [contains Date field],
And it is submitted to call the [get closed cases] operation of [CCD Data Store],

Then a negative response is received,
And the response [code is HTTP-400 Bad Request],
And the response has all the details as expected.

@S-942.3
Scenario: Return 401 if user is unauthorised
Given a user with [an active profile in CCD],

When a request is prepared with appropriate values,
And the request [contains a dummy user id],
And the request [contains Date field],
And it is submitted to call the [get closed cases] operation of [CCD Data Store],

Then a negative response is received,
And the response [code is HTTP-401],
And the response has all the details as expected.

@S-942.4
Scenario: Return 404 if no closed cases are found
Given a user with [an active profile in CCD],

When a request is prepared with appropriate values,
And the request [contains Date field for which there are no cases available],
And it is submitted to call the [get closed cases] operation of [CCD Data Store],

Then a negative response is received,
And the response [code is HTTP-404],
And the response has all the details as expected.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"_guid_": "F-942_DeleteExistingDateCaseClosed",
"title": "Delete existing date case closed records for get closed cases",
"specs": [
"to delete existing date case closed records"
],

"productName": "CCD Data Store",
"operationName": "delete existing date case closed records",

"method": "DELETE",
"uri": "/testing-support/date-case-closed",

"users": {
"invokingUser": {
"_extends_": "CaseworkerAutotest"
}
},

"request": {
"headers": {
"_extends_": "Common_Request_Headers"
},
"queryParams": {
"stateChangedDate": "${[scenarioContext][customValues][today]}"
}
},

"expectedResponse": {
"responseCode": 204
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"_guid_": "F-942_Test_Data_Base",

"productName": "CCD Data Store",
"operationName": "get closed cases",

"method": "GET",
"uri": "/internal/searchCases/getClosedCases/{date}",

"users": {
"invokingUser": {
"_extends_": "CaseworkerAutotest"
}
},

"request": {
"headers": {
"_extends_": "Common_Request_Headers"
},
"pathVariables": {
"date": "2025-01-01"
}
},

"expectedResponse": {
"responseCode": 200
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"_guid_": "S-942.1",
"_extends_": "F-942_Test_Data_Base",
"title": "Return list of closed cases successfully",

"specs": [
"an active profile in CCD",
"contains Date field"
],

"expectedResponse": {
"body": {
"caseReferences": [
"${[scenarioContext][customValues][caseIdAsStringFrom_Standard_Full_Case_Creation_Data]}"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"_guid_": "S-942.1_CreateDateCaseClosed",
"title": "Create date case closed record for get closed cases",
"specs": [
"to create a date case closed record"
],

"productName": "CCD Data Store",
"operationName": "create date case closed record",

"method": "POST",
"uri": "/testing-support/date-case-closed",

"users": {
"invokingUser": {
"_extends_": "CaseworkerAutotest"
}
},

"request": {
"headers": {
"_extends_": "Common_Request_Headers"
},
"body": {
"ccdCaseNumber": "${[scenarioContext][parentContext][childContexts][Standard_Full_Case_Creation_Data][testData][actualResponse][body][id]}",
"state": "Closed",
"stateCategory": "Closed",
"stateChangedDate": "2025-01-01T00:00:00"
}
},

"expectedResponse": {
"responseCode": 201,
"body": {
"id": "[[ANYTHING_PRESENT]]",
"ccdCaseNumber": "${[scenarioContext][parentContext][childContexts][Standard_Full_Case_Creation_Data][testData][actualResponse][body][id]}",
"state": "Closed",
"stateCategory": "Closed",
"stateChangedDate": "2025-01-01T00:00:00"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "S-942.2",
"_extends_": "F-942_Test_Data_Base",
"title": "Return 400 if date is not before current date",

"specs": [
"an active profile in CCD",
"contains Date field",
"code is HTTP-400 Bad Request"
],

"request": {
"pathVariables": {
"date": "2999-01-01"
}
},

"expectedResponse": {
"_extends_": "Common_400_Response",
"body": {
"exception": "uk.gov.hmcts.ccd.endpoint.exceptions.BadSearchRequest",
"status": 400,
"error": "Bad Request",
"message": "Date is not valid",
"path": "/internal/searchCases/getClosedCases/2999-01-01",
"details": null,
"callbackErrors": null,
"callbackWarnings": null
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"_guid_": "S-942.3",
"_extends_": "F-942_Test_Data_Base",
"title": "Return 401 if user is unauthorised",

"specs": [
"an active profile in CCD",
"contains a dummy user id",
"contains Date field",
"code is HTTP-401"
],

"request": {
"headers": {
"Authorization": "Bearer abc"
}
},

"expectedResponse": {
"_extends_": "Common_401_Response",
"body": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "S-942.4",
"_extends_": "F-942_Test_Data_Base",
"title": "Return 404 not found if no closed cases are found",

"specs": [
"an active profile in CCD",
"contains Date field for which there are no cases available",
"code is HTTP-404"
],

"request": {
"pathVariables": {
"date": "2024-01-01"
}
},

"expectedResponse": {
"_extends_": "Common_404_Response",
"body": {
"exception": "uk.gov.hmcts.ccd.domain.service.getcase.CaseNotFoundException",
"status": 404,
"error": "Not Found",
"message": "Case data not found",
"path": "/internal/searchCases/getClosedCases/2024-01-01",
"details": null,
"callbackErrors": null,
"callbackWarnings": null
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@F-944
Feature: F-944: Get closed for payment cases after creation

Background: Load test data for the scenario
Given an appropriate test context as detailed in the test data source
And a call [to delete existing date case closed records] will get the expected response as in [F-942_DeleteExistingDateCaseClosed],

@S-944.1
Scenario: Return created case when created case state category is closed for payment
Given a user with [an active profile in CCD],
And a successful call [to create a token for case creation] as in [S-944.1_GetToken_CaseCreate],
And a successful call [to create a case] as in [S-944.1_Create_Case],

When a request is prepared with appropriate values,
And the request [contains today's Date field],
And it is submitted to call the [get closed cases] operation of [CCD Data Store],

Then a positive response is received,
And the response has all other details as expected.

@S-944.2
Scenario: Do not return created case when created case state category is not closed for payment
Given a user with [an active profile in CCD],
And a successful call [to create a token for case creation] as in [S-944.2_GetToken_CaseCreate_NotClosed],
And a successful call [to create a case] as in [S-944.2_Create_Case_NotClosed],

When a request is prepared with appropriate values,
And the request [contains today's Date field],
And it is submitted to call the [get closed cases] operation of [CCD Data Store],

Then a negative response is received,
And the response [code is HTTP-404],
And the response has all other details as expected.
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"_guid_": "F-944_Create_Case_Base",

"productName": "CCD Data Store",
"operationName": "Submit case creation as Case worker",

"method": "POST",
"uri": "/caseworkers/{uid}/jurisdictions/{jid}/case-types/{ctid}/cases",

"specs": [
"to create a case"
],

"users": {
"invokingUser": {
"_extends_": "BeftaMasterCaseworker"
}
},

"request": {
"headers": {
"_extends_": "Common_Request_Headers"
},
"pathVariables": {
"uid": "[[DEFAULT_AUTO_VALUE]]",
"jid": "BEFTA_MASTER",
"ctid": "FT_DateCaseClosed"
},
"body": {
"data": {},
"event": {
"summary": "",
"description": ""
},
"ignore_warning": false,
"draft_id": null
}
},

"expectedResponse": {
"_extends_": "Common_201_Response",
"headers": {
"Content-Encoding": "gzip",
"vary": "accept-encoding",
"Content-Length": "[[ANYTHING_PRESENT]]"
},
"body": {
"id": "[[ANYTHING_PRESENT]]",
"jurisdiction": "BEFTA_MASTER",
"version": 0,
"case_type_id": "FT_DateCaseClosed",
"last_state_modified_date": "[[ANYTHING_PRESENT]]",
"created_date": "[[ANYTHING_PRESENT]]",
"last_modified": "[[ANYTHING_PRESENT]]",
"security_classification": "PUBLIC",
"case_data": {},
"data_classification": {},
"supplementary_data": null,
"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
}
}
}
Loading