Skip to content

CCD-6207 #2552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6ab4e63
FT changes for CCD-6207
patelila Mar 21, 2025
cf47b0d
fix Version of java helm chart below 5.3.0 is deprecated, please upgr…
patelila Mar 21, 2025
9871159
Bumping chart version/ fixing aliases
hmcts-jenkins-a-to-c[bot] Mar 21, 2025
002063d
empty commit to trigger build
patelila Mar 21, 2025
db1657c
Merge remote-tracking branch 'origin/CCD-6207_Retrieve_access-metadat…
patelila Mar 21, 2025
a3d4f19
empty commit to trigger build
patelila Mar 21, 2025
ae4b646
Added "organisationStatus", "organisationProfileIds" to expected resp…
patelila Mar 21, 2025
035fa0b
empty commit to trigger build
patelila Mar 21, 2025
2e58246
empty commit to trigger build
patelila Mar 24, 2025
80fc27b
renamed caseMetadataResource to CaseAccessMetadataResource
patelila Mar 24, 2025
caf5de1
use caseAccessMetadata instead
patelila Mar 24, 2025
e489b7b
fix FT
patelila Mar 24, 2025
1de4193
fix FT, revert change
patelila Mar 24, 2025
e813437
empty commit to trigger build
patelila Mar 25, 2025
55e72ad
use the correct PR's of definition-store and data-store
patelila Mar 25, 2025
f868eb4
Merge branch 'master' into CCD-6207_Retrieve_access-metadata-case-ID
patelila Mar 26, 2025
086a4ea
use correct pr no.
patelila Mar 27, 2025
971a66b
Readme changes to make easy to copy commands
patelila Mar 27, 2025
9601d64
empty commit to trigger build
patelila Mar 27, 2025
ab33692
Removed unnecessary code
patelila Mar 27, 2025
87bc682
empty commit to trigger build
patelila Apr 2, 2025
5b59fda
use normal pr's
patelila Apr 2, 2025
6c278a6
Merge branch 'master' into CCD-6207_Retrieve_access-metadata-case-ID
patelila Apr 4, 2025
7541779
fix pipline pointing to data-store-api PR-2552 and definition-store P…
patelila Apr 4, 2025
595ae9f
Merge branch 'master' into CCD-6207_Retrieve_access-metadata-case-ID
patelila Apr 8, 2025
992456d
Merge branch 'master' into CCD-6207_Retrieve_access-metadata-case-ID
patelila Apr 11, 2025
176a29b
Merge branch 'master' into CCD-6207_Retrieve_access-metadata-case-ID
patelila Apr 28, 2025
72c7ced
Merge branch 'master' into CCD-6207_Retrieve_access-metadata-case-ID
patelila May 1, 2025
01bbf54
Merge branch 'master' into CCD-6207_Retrieve_access-metadata-case-ID
RebeccaBaker May 7, 2025
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
4 changes: 2 additions & 2 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def branchesToSync = ['demo', 'ithc', 'perftest', 'develop']

// Variables to switch pipeline logic and wiring per type of build

def definitionStoreDevelopPr = "PR-575" // This doesn't change frequently, but when it does, only change this value.
def dataStoreApiDevelopPr = "PR-1260" // This doesn't change frequently, but when it does, only change this value.
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.
Comment on lines +23 to +24
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be reverted prior to merging

def prsToUseAat = "PR-1793,PR-1888" // Set this value to a PR number, or add it as a comma-separated value, if it's to follow CI/CD.

def secrets = [
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,22 @@ To find out more about BEFTA Framework, see the repository and its README [here]
##### All Functional Tests
Will run all the FT's:

./gradlew functional
```bash
./gradlew functional
```

##### Some Functional Tests
Will run both F-1023 and F-777:

./gradlew functional -P tags="@F-1023 or @F-777"
```bash
./gradlew functional -P tags="@F-1023 or @F-777"
```

Will run only S-1023.5:

./gradlew functional -P tags="@S-1023.5"
```bash
./gradlew functional -P tags="@S-1023.5"
```

## LICENSE

Expand Down
2 changes: 1 addition & 1 deletion charts/ccd-data-store-api/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ java:
DATA_STORE_DB_PASSWORD: "{{ .Values.postgresql.auth.password}}"
DATA_STORE_DB_OPTIONS: "?stringtype=unspecified"
DATA_STORE_DB_MAX_POOL_SIZE: 10
DEFINITION_STORE_HOST: http://ccd-definition-store-api-pr-575-java/
DEFINITION_STORE_HOST: http://ccd-definition-store-api-pr-1540-java/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be reverted prior to merging

USER_PROFILE_HOST: http://ccd-user-profile-api-pr-399-java/
ELASTIC_SEARCH_ENABLED: true # enable whenever ES required on a particular PR
ELASTIC_SEARCH_NODES_DISCOVERY_ENABLED: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#==========================================================
@F-065a
Feature: F-065a: Retrieve access metadata for a given case ID
#==========================================================

Background: Load test data for the scenario
Given an appropriate test context as detailed in the test data source

#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@S-065a.1
Scenario: must return case access metadata when the case reference exists

Given a case that has just been created as in [Standard_Full_Case_Creation_Data],
And a user with [an active profile in CCD],
And a successful call [to get an event token for just created case] as in [S-065a-Prerequisite],
And another successful call [to update case with the token just created] as in [S-065a-Prerequisite_Case_Update],

When a request is prepared with appropriate values,
And the request [contains a case that has just been created as in Standard_Full_Case_Creation_Data],
And it is submitted to call the [Retrieve access metadata for a given case ID] operation of [CCD Data Store],

Then a positive response is received,
And the response [contains details of the case just created, along with an HTTP-200 OK],
And the response [contains the case access metadata],
And the response has all other details as expected.

#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@S-065a.2
Scenario: must return null when case reference does NOT exist

Given a user with [an active profile in CCD],

When a request is prepared with appropriate values,
And the request [uses case-reference which does not exist in CCD],
And it is submitted to call the [Retrieve access metadata for a given case ID] operation of [CCD Data Store],

Then a positive response is received,
And the response [has an HTTP-200 OK],
And the response [contains the case access metadata with null],

#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@S-065a.3
Scenario: must return 400 when case reference is invalid

Given a user with [an active profile in CCD],

When a request is prepared with appropriate values,
And the request [uses an invalid case-reference],
And it is submitted to call the [Retrieve access metadata for a given case ID] operation of [CCD Data Store],

Then a negative response is received,
And the response [has an HTTP-400 code]
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "F-065a_Test_Data_Access_Metadata_Base",

"productName": "CCD Data Store",
"operationName": "Retrieve access metadata for a given case ID",

"method": "GET",
"uri": "/internal/cases/{cid}/access-metadata",

"user": {
"_extends_": "Common_User_For_Request"
},

"request": {
"_extends_": "Common_Request",
"headers": {
"experimental": true
},
"pathVariables": {
"cid": "1234567890123456"
}
},

"expectedResponse": {
"headers": {
"_extends_": "Common_Response_Headers",
"Content-Type": "[[ANYTHING_PRESENT]]",
"Content-Encoding": "gzip"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"_guid_": "S-065a-Prerequisite",
"title": "should create an event token for correct inputs",

"productName": "CCD Data Store",
"operationName": "Retrieve a create token",

"method": "GET",
"uri": "/caseworkers/{uid}/jurisdictions/{jid}/case-types/{ctid}/cases/{cid}/event-triggers/{etid}/token",

"specs": [
"to get an event token for just created case"
],

"user": {
"_extends_": "Common_User_For_Request"
},

"request": {
"headers": {
"_extends_": "Common_Request_Headers"
},
"pathVariables": {
"uid": "[[DEFAULT_AUTO_VALUE]]",
"jid": "AUTOTEST1",
"ctid": "AAT_AUTH_15",
"cid": "${[scenarioContext][parentContext][childContexts][Standard_Full_Case_Creation_Data][testData][actualResponse][body][id]}",
"etid": "UPDATE"
}
},

"expectedResponse": {
"_extends_": "Common_200_Response",
"headers": {
"Content-Encoding": "gzip",
"Content-Length": "[[ANYTHING_PRESENT]]"
},
"body": {
"token": "[[ANYTHING_PRESENT]]",
"case_details": "[[ANYTHING_PRESENT]]",
"event_id": "UPDATE"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
{
"_guid_": "S-065a-Prerequisite_Case_Update",
"title": "should update an existing case with correct inputs",

"productName": "CCD Data Store",
"operationName": "Submit update case event",

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

"specs": [
"to update case with the token just created"
],

"user": {
"_extends_": "Common_User_For_Request"
},

"request": {
"headers": {
"_extends_": "Common_Request_Headers"
},
"pathVariables": {
"uid": "[[DEFAULT_AUTO_VALUE]]",
"jid": "AUTOTEST1",
"ctid": "AAT_AUTH_15",
"cid": "${[scenarioContext][parentContext][childContexts][Standard_Full_Case_Creation_Data][testData][actualResponse][body][id]}"
},
"body": {
"data": {
"MoneyGBPField": "4300",
"FixedListField": "VALUE3",
"AddressUKField": {
"County": "Greater London",
"Country": "UK",
"PostCode": "SW1H 9AJ",
"PostTown": "Westminster",
"AddressLine1": "102 Petty France",
"AddressLine2": "CCD",
"AddressLine3": "c/o HMCTS Reform"
},
"ComplexField": {
"ComplexTextField": "Nested text",
"ComplexFixedListField": "VALUE2"
},
"DateTimeField": "1988-07-07T22:20:00",
"PhoneUKField": "07123456789",
"NumberField": "164528",
"MultiSelectListField": [
"OPTION2",
"OPTION4"
],
"YesOrNoField": "Yes",
"EmailField": "[email protected]",
"TextField": "Some Text",
"DateField": "2017-02-13",
"TextAreaField": "Line1\nLine2",
"CollectionField": [
{
"id": "4926d94c-1fa3-4c16-b5ba-5a122d8c622d",
"value": "Alias 1"
},
{
"id": "936b6a65-a179-474f-bdff-1d4f961e9a8c",
"value": "Alias 2"
}
]
},
"event": {
"id": "UPDATE",
"summary": "",
"description": ""
},
"event_token": "${[scenarioContext][parentContext][childContexts][S-065a-Prerequisite][testData][actualResponse][body][token]}",
"ignore_warning": false
}
},

"expectedResponse": {
"_extends_": "Common_201_Response",
"headers": {
"vary": "accept-encoding",
"Content-Length": "[[ANYTHING_PRESENT]]",
"Content-Encoding": "gzip"
},
"body": {
"id": "[[ANYTHING_PRESENT]]",
"jurisdiction": "AUTOTEST1",
"state": "TODO",
"version": 1,
"case_type_id": "AAT_AUTH_15",
"last_state_modified_date": "[[ANYTHING_PRESENT]]",
"created_date": "[[ANYTHING_PRESENT]]",
"last_modified": "[[ANYTHING_PRESENT]]",
"security_classification": "PUBLIC",
"case_data": {
"MoneyGBPField": "[[ANYTHING_PRESENT]]",
"FixedListField": "VALUE3",
"AddressUKField": {
"County": "Greater London",
"Country": "UK",
"PostCode": "SW1H 9AJ",
"PostTown": "Westminster",
"AddressLine1": "102 Petty France",
"AddressLine2": "CCD",
"AddressLine3": "c/o HMCTS Reform"
},
"ComplexField": {
"ComplexTextField": "Nested text",
"ComplexFixedListField": "VALUE2"
},
"DateTimeField": "[[ANYTHING_PRESENT]]",
"PhoneUKField": "07123456789",
"NumberField": "164528",
"MultiSelectListField": [
"OPTION2",
"OPTION4"
],
"YesOrNoField": "Yes",
"EmailField": "[email protected]",
"TextField": "Some Text",
"DateField": "2017-02-13",
"TextAreaField": "Line1\nLine2",
"CollectionField": [
{
"value": "Alias 1",
"id": "[[ANYTHING_PRESENT]]"
},
{
"value": "Alias 2",
"id": "[[ANYTHING_PRESENT]]"
}
]
},
"data_classification": {
"MoneyGBPField": "PUBLIC",
"FixedListField": "PUBLIC",
"AddressUKField": {
"classification": "PUBLIC",
"value": {
"County": "PUBLIC",
"Country": "PUBLIC",
"PostCode": "PUBLIC",
"PostTown": "PUBLIC",
"AddressLine1": "PUBLIC",
"AddressLine2": "PUBLIC",
"AddressLine3": "PUBLIC"
}
},
"DateTimeField": "PUBLIC",
"PhoneUKField": "PUBLIC",
"NumberField": "PUBLIC",
"MultiSelectListField": "PUBLIC",
"YesOrNoField": "PUBLIC",
"EmailField": "PUBLIC",
"TextField": "PUBLIC",
"DateField": "PUBLIC",
"TextAreaField": "PUBLIC",
"CollectionField": {
"classification": "PUBLIC",
"value": [
{
"__ordering__": "ordered"
},
{
"id": "[[ANYTHING_PRESENT]]",
"classification": "PUBLIC"
},
{
"id": "[[ANYTHING_PRESENT]]",
"classification": "PUBLIC"
}
]
}
},
"supplementary_data": null,
"after_submit_callback_response": null,
"callback_response_status_code": null,
"callback_response_status": 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,31 @@
{
"_guid_": "S-065a.1",
"_extends_": "F-065a_Test_Data_Access_Metadata_Base",
"title": "must return case view history when the case reference exists",

"specs": [
"an active profile in CCD",
"contains a case that has just been created as in Standard_Full_Case_Creation_Data",
"contains details of the case just created, along with an HTTP-200 OK",
"contains the case access metadata"
],

"request": {
"pathVariables": {
"cid": "${[scenarioContext][childContexts][Standard_Full_Case_Creation_Data][testData][actualResponse][body][id]}"
}
},

"expectedResponse": {
"_extends_": "Common_200_Response",
"headers": {
"Vary": "Accept-Encoding",
"Transfer-Encoding": "chunked",
"Content-Type": "application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-case-access-metadata.v2+json;charset=UTF-8"
},
"body": {
"accessGrants" : [ "STANDARD" ],
"accessProcess" : "NONE"
}
}
}
Loading