Skip to content
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

Implement permission checks to prevent unnecessary overwrit… #2506

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ dependencies {
implementation 'org.jooq:jool-java-8:0.9.14'
implementation 'com.github.hmcts:ccd-case-document-am-client:1.7.1'

testImplementation group: 'com.github.hmcts', name: 'ccd-test-definitions', version: '7.24.0'
testImplementation group: 'com.github.hmcts', name: 'ccd-test-definitions', version: '7.24.2'
testImplementation group: 'com.github.hmcts', name: 'befta-fw', version: '9.2.0'

contractTestImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"
Expand Down
44 changes: 44 additions & 0 deletions src/aat/resources/features/F-038/F-038-Base-Prerequisite.td.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"_guid_": "F-038-Base-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 the case 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]}",
"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,44 @@
{
"_guid_": "F-038-Base-PrivateCaseWorker-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 the case 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][F-038-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"
}
}
}
100 changes: 100 additions & 0 deletions src/aat/resources/features/F-038/F-038-Case-Creation-Data.td.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"_guid_": "F-038-Case-Creation-Data",
"_extends_": "Case_Creation_Data_Base",

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

"request": {
"pathVariables": {
"jid": "AUTOTEST1",
"ctid": "AAT_AUTH_15"
},
"body": {
"data": {
"_extends_": "F-038-Full-Case-Data"
}
}
},

"expectedResponse": {
"body": {
"jurisdiction": "AUTOTEST1",
"case_type_id": "AAT_AUTH_15",
"case_data": {
"_extends_": "F-038-Full-Case-Data"
},
"data_classification": {
"MoneyGBPField": "PUBLIC",
"FixedListField": "PUBLIC",
"AddressUKField": {
"classification": "PUBLIC",
"value": {
"AddressLine1": "PUBLIC",
"AddressLine2": "PUBLIC",
"AddressLine3": "PUBLIC",
"PostTown": "PUBLIC",
"County": "PUBLIC",
"PostCode": "PUBLIC",
"Country": "PUBLIC"
}
},
"AddressForeignField": {
"classification": "PUBLIC",
"value": {
"AddressLine1": "PUBLIC",
"AddressLine2": "PUBLIC",
"AddressLine3": "PUBLIC",
"PostTown": "PUBLIC",
"County": "PUBLIC",
"PostCode": "PUBLIC",
"Country": "PUBLIC"
}
},
"DateTimeField": "PUBLIC",
"PhoneUKField": "PUBLIC",
"NumberField": "PUBLIC",
"MultiSelectListField": "PUBLIC",
"YesOrNoField": "PUBLIC",
"EmailField": "PUBLIC",
"TextField": "PUBLIC",
"DateField": "PUBLIC",
"TextAreaField": "PUBLIC",
"CollectionField": {
"classification": "PUBLIC",
"value": [
{
"id": "CollectionField1",
"classification": "PUBLIC"
},
{
"id": "CollectionField2",
"classification": "PUBLIC"
}
]
},
"CollectionPermissionField": {
"classification": "PUBLIC",
"value": [
{
"id": "CollectionPermissionField1",
"classification": "PUBLIC"
},
{
"id": "CollectionPermissionField2",
"classification": "PUBLIC"
},
{
"id": "CollectionPermissionField3",
"classification": "PUBLIC"
}
]
}
},
"supplementary_data": null
}
}
}
64 changes: 64 additions & 0 deletions src/aat/resources/features/F-038/F-038-Full-Case-Data.td.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"_guid_": "F-038-Full-Case-Data",

"TextField": "Some Text",
"NumberField": "164528",
"YesOrNoField": "Yes",
"PhoneUKField": "07123456789",
"EmailField": "[email protected]",
"MoneyGBPField": "4200",
"DateField": "2017-02-13",
"DateTimeField": "1988-07-07T22:20:00",
"TextAreaField": "Line1\nLine2",
"FixedListField": "VALUE3",
"MultiSelectListField": [
"OPTION2",
"OPTION4"
],
"CollectionField": [
{
"id": "CollectionField1",
"value": "Alias 1"
},
{
"id": "CollectionField2",
"value": "Alias 2"
}
],
"CollectionPermissionField": [
{
"id": "CollectionPermissionField1",
"value": "Alias 1"
},
{
"id": "CollectionPermissionField2",
"value": "Alias 2"
},
{
"id": "CollectionPermissionField3",
"value": "Alias 3"
}
],
"ComplexField": {
"ComplexTextField": "Nested text",
"ComplexFixedListField": "VALUE2"
},
"AddressUKField": {
"AddressLine1": "102 Petty France",
"AddressLine2": "CCD",
"AddressLine3": "c/o HMCTS Reform",
"PostTown": "Westminster",
"County": "Greater London",
"PostCode": "SW1H 9AJ",
"Country": "UK"
},
"AddressForeignField": {
"AddressLine1": "102 Petty France",
"AddressLine2": "CCD",
"AddressLine3": "c/o HMCTS Reform",
"PostTown": "Westminster",
"County": "Paris",
"PostCode": "SW1H 9AJ",
"Country": "France"
}
}
Loading