Skip to content

Commit 7c9ff69

Browse files
pateliladinesh1patelRebeccaBakerbharatkumarpatel1
authored
Ccd 5322 POST /retrieve-access-types does retrieve AccessType and AccessTypeRoles associated for CaseTypeId (#1468)
* Changes so easy to run single FT * Using PropertyNamingStrategies.SnakeCaseStrategy because of c.f.j.d.PropertyNamingStrategy$SnakeCaseStrategy PropertyNamingStrategy.SnakeCaseStrategy is used but it has been deprecated due to risk of deadlock. Consider using PropertyNamingStrategies.SnakeCaseStrategy instead. See FasterXML/jackson-databind#2715 for more details. * changes to query for POST /retrieve-access-types does retrieve AccessType and AccessTypeRoles associated for CaseTypeId * FT for multiple jurisdiction and removing accessType (multiple) versionsfor POST /retrieve-access-types does retrieve AccessType and AccessTypeRoles associated for CaseTypeId * removed as commited by mistake * Update build.gradle revert version To check if tests pass and not get the json parser error * fix for error Errror at ✽.an appropriate test context as detailed in the test data source(file:///Users/ilapatel/Documents/Work/repos/ccd-definition-store-api/aat/src/aat/resources/features/F-082/F-082.feature:7) Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('{' (code 123)): was expecting double-quote to start field name at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 69, column: 13] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2481) * Modified FT 110.6 * CCD-test-definition using CCD_BEFTA_RM_CT_JURISDICTION1 which has cast_type removed and Modified FT 110.1a * CCD-test-definition using CCD_BEFTA_RM_CT_JURISDICTION1 which has cast_type removed and Modified FT 110.1a * Version change CCD-test-definition using CCD_BEFTA_RM_CT_JURISDICTION1 which has cast_type removed and Modified FT 110.1a * remove mistaken typeo * empty commit to trigger build * version change for ccd-test-definition * Fixing ERROR [main] uk.gov.hmcts.befta.util.MapVerifierjava.lang.NullPointerException: Cannot invoke "Object.toString()" because "idElementValue" is null * Fix for `__elementId__` to field 'accessTypes.roles * Fix for `__elementId__` to field 'accessTypes.roles * Fix for `__elementId__` to field 'accessTypes.roles * Fix Failed FT's * Fix Failed FT's * Ccd 5647 mismatch for CCD-5233 (#1494) * version bump + Missing bits + spelling typo * Change roles to ordered * changed Respondant to Respondent * changed Respondant to Respondent * changed Respondant to Respondent * empty commit to trigger build * channged ordering and caseType name * changed ordering and caseType name * changed ordering and caseType name * empty commit to trigger build * changed ordering and caseType name * changed ordering and caseType name * Use pr-1468 instead of pr-575 and ccd-data-store-api-pr-2462-es-master instead of ccd-data-store-api-pr-1260-es-master * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * ordered ordering changed and outputing env.DEFINITION_STORE_URL_BASE * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * reverted ordering as pipeline complaining * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * added checkstyle * Changing the order * Changing the order * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * revert change to be same as master * use ccd-data-store-api-pr-2472-es-master * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * change order as @F-080 @S-080.1 FT test fails as it is expecting ordered response * change order as @F-080 @S-080.1 FT test fails as it is expecting ordered response * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build --------- Co-authored-by: Dinesh Patel <dinesh1.patel@btinternet.com> Co-authored-by: RebeccaBaker <38425793+RebeccaBaker@users.noreply.github.com> Co-authored-by: bharatkumarpatel1 <Bharatkumar.Patel1@HMCTS.NET>
1 parent 3d55c05 commit 7c9ff69

File tree

15 files changed

+441
-146
lines changed

15 files changed

+441
-146
lines changed

Jenkinsfile_CNP

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def app = "definition-store-api"
1111
def branchesToSync = ['demo', 'ithc', 'perftest', 'develop']
1212

1313
// Variables to switch pipeline logic and wiring per type of build
14-
def definitionStoreDevelopPr = "PR-575" // This doesn't change frequently, but when it does, only change this value.
14+
def definitionStoreDevelopPr = "PR-1468" // This doesn't change frequently, but when it does, only change this value.
1515

1616
def secrets = [
1717
'ccd-${env}': [
@@ -93,6 +93,11 @@ withPipeline(type, product, app) {
9393
disableLegacyDeployment()
9494
enableHighLevelDataSetup()
9595

96+
afterAlways('test') {
97+
// hmcts/cnp-jenkins-library may fail to copy artifacts after checkstyle error so repeat command (see /src/uk/gov/hmcts/contino/GradleBuilder.groovy)
98+
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/checkstyle/*.html'
99+
}
100+
96101
afterAlways('smoketest:preview') {
97102
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/BEFTA Report for Smoke Tests/**/*'
98103
}
@@ -112,4 +117,6 @@ withPipeline(type, product, app) {
112117
afterAlways('functionalTest:aat') {
113118
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/BEFTA Report for Functional Tests/**/*'
114119
}
120+
121+
echo "env.DEFINITION_STORE_URL_BASE = ${env.DEFINITION_STORE_URL_BASE}"
115122
}

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,19 @@ Spring application entry point and configuration.
120120
The functional tests are located in `aat` folder. The tests are written using
121121
befta-fw library. To find out more about BEFTA Framework, see the repository and its README [here](https://github.com/hmcts/befta-fw).
122122

123+
Will run all the FT's:
124+
125+
./gradlew functional
126+
127+
##### Some Functional Tests
128+
Will run both F-105 and F-110:
129+
130+
./gradlew functional -P tags="@F-105 or @F-110"
131+
132+
Will run only S-110.1:
133+
134+
./gradlew functional -P tags="@S-110.1"
135+
123136
## LICENSE
124137

125138
This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details.

aat/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ task smoke(type: Test) {
8787
outputs.upToDateWhen { false }
8888
}
8989

90+
def tags = (findProperty('tags') == null) ? 'not @Ignore' : '(' + findProperty('tags') + ') and not @Ignore'
91+
9092
task functional(type: Test) {
9193
description = 'Executes functional tests against the CCD Definition Store Instance just deployed'
9294
setTestClassesDirs(sourceSets.aat.output.classesDirs)
@@ -112,7 +114,7 @@ task functional(type: Test) {
112114
args = [
113115
'--threads', '1', // current definition-store tests do not support multiple threads
114116
'--plugin', "json:${rootDir}/target/cucumber.json",
115-
'--tags', 'not @Ignore',
117+
'--tags', "${tags}",
116118
'--glue', 'uk.gov.hmcts.befta.player', 'src/aat/resources/features'
117119
]
118120
jvmArgs = [ '--add-opens=java.base/java.lang.reflect=ALL-UNNAMED' ]

aat/src/aat/resources/features/F-080/S-080.1.td.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,13 @@
236236
{
237237
"case_type_id": "FT_CaseAccessCategories",
238238
"disabled": false,
239-
"read_only": true,
240-
"authorisations": "auth1",
239+
"read_only": false,
240+
"authorisations": null,
241241
"access_profiles": "caseworker-befta_master",
242242
"live_from": "[[ANYTHING_PRESENT]]",
243243
"live_to": null,
244-
"role_name": "Role1",
245-
"case_access_categories": "TestValue"
244+
"role_name": "idam:caseworker-befta_master",
245+
"case_access_categories": "Civil/Standard,Criminal/Serious"
246246
},
247247
{
248248
"case_type_id": "FT_CaseAccessCategories",
@@ -258,13 +258,13 @@
258258
{
259259
"case_type_id": "FT_CaseAccessCategories",
260260
"disabled": false,
261-
"read_only": false,
262-
"authorisations": null,
261+
"read_only": true,
262+
"authorisations": "auth1",
263263
"access_profiles": "caseworker-befta_master",
264264
"live_from": "[[ANYTHING_PRESENT]]",
265265
"live_to": null,
266-
"role_name": "idam:caseworker-befta_master",
267-
"case_access_categories": "Civil/Standard,Criminal/Serious"
266+
"role_name": "Role1",
267+
"case_access_categories": "TestValue"
268268
}
269269
],
270270
"searchCriterias": [],

aat/src/aat/resources/features/F-110 Retrieve Organisation Profile/F-110.feature

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,29 @@ Feature: F-110: Retrieve Access Types
1515
And the response has all other details as expected
1616
And the response [contains all accessTypes for organisationProfileId in the response]
1717

18+
@S-110.1a #AC-1a of CCD-5322
19+
Scenario: Successfully return 200 success with content for request access type of the organisation and only latest version of the AccessTypes
20+
Given a user with [an active profile in CCD]
21+
When a request is prepared with appropriate values
22+
And the request [contains correctly configured values]
23+
And the request [contains an organisationProfileId that exists in CCD database]
24+
And the request [contains an organisationProfileId and accessTypes exists in CCD database]
25+
And it is submitted to call the [Retrieve Access Types] operation of [CCD Definition Store]
26+
Then a positive response is received
27+
And the response has all other details as expected
28+
And the response [contains the latest version of the accessTypes for organisationProfileId]
29+
30+
@S-110.1b #AC-1a of CCD-5322
31+
Scenario: Successfully return 200 success multiple jurisdiction and each case type under different jurisdiction will have their only access types
32+
Given a user with [an active profile in CCD]
33+
When a request is prepared with appropriate values
34+
And the request [contains correctly configured values]
35+
And the request [contains an organisationProfileId that exists in CCD database]
36+
And the request [contains an organisationProfileId and accessTypes exists in CCD database]
37+
And it is submitted to call the [Retrieve Access Types] operation of [CCD Definition Store]
38+
Then a positive response is received
39+
And the response [contains the latest version of the accessTypes for all organisations across jurisdictions]
40+
1841
@S-110.2
1942
Scenario: Successfully return 200 success without content for non-existent organisationProfileId
2043
Given a user with [an active profile in CCD]
@@ -57,26 +80,15 @@ Feature: F-110: Retrieve Access Types
5780
Then a negative response is received
5881
And the response [has a status of 401 Unauthorised]
5982

60-
@S-110.6 @Ignore # To be added with multiple Befta Jurisdictions
61-
Scenario: Successfully return 200 success with the latest version of accessTypes for organisationProfileId
83+
@S-110.6 # more than one version of AccessTypeRoles
84+
Scenario: Successfully return 200 success accessTypes of organisationProfileId and only latest version of AccessTypes
6285
Given a user with [an active profile in CCD]
63-
And a pre-condition that multiple versions of AccessTypeRoles exist in the database
86+
And a call [to import definition file, multiple versions] will get the expected response as in [Import_CCD_BEFTA_RM_CT_JURISDICTION1]
6487
When a request is prepared with appropriate values
6588
And the request [contains correctly configured values]
6689
And the request [contains an organisationProfileId that exists in CCD database]
90+
And the request [contains an organisationProfileId and accessTypes exists in CCD database]
6791
And it is submitted to call the [Retrieve Access Types] operation of [CCD Definition Store]
6892
Then a positive response is received
69-
And the response [has a status of 200 success]
70-
And the response [contains the latest version of the accessTypes for organisationProfileId in the response]
93+
And the response [contains the latest version of the accessTypes for organisationProfileId]
7194

72-
@S-110.7 @Ignore # To be added with multiple Befta Jurisdictions
73-
Scenario: Successfully return 200 success with access type of all organisations across jurisdictions
74-
Given a user with [an active profile in CCD]
75-
And a pre-condition that multiple jurisdictions with their own access types exist due to imported definition files
76-
When a request is prepared with appropriate values
77-
And the request [contains correctly configured values]
78-
And the request [does not contain organisationProfileId]
79-
And it is submitted to call the [Retrieve Access Types] operation of [CCD Definition Store]
80-
Then a positive response is received
81-
And the response [has a status of 200 success]
82-
And the response [contains the latest version of the accessTypes for all organisations across jurisdictions]

aat/src/aat/resources/features/F-110 Retrieve Organisation Profile/S-110.1.td.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"__elementId__": "caseTypeId"
4141
},
4242
{
43-
"caseTypeId" : "FT_MasterCaseType",
43+
"caseTypeId" : "FT_CaseAccessGroups",
4444
"organisationalRoleName" : "Role1",
4545
"groupRoleName" : "Role1",
4646
"caseGroupIdTemplate" : "BEFTA_MASTER:$ORGID$",
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{
2+
"_guid_": "S-110.1a",
3+
"_extends_": "F-110_Test_Base_data",
4+
"title": "Successfully retrieve access types for provided organisationProfileIds",
5+
"specs": [
6+
"an active profile in CCD",
7+
"contains correctly configured values",
8+
"contains an organisationProfileId that exists in CCD database",
9+
"contains an organisationProfileId and accessTypes exists in CCD database",
10+
"Retrieve Access Types operation of CCD Data Store",
11+
"contains the latest version of the accessTypes for organisationProfileId"
12+
],
13+
"request": {
14+
"body": {
15+
"organisationProfileIds": [
16+
"OGD_DWP_PROFILE",
17+
"SOLICITOR_PROFILE"
18+
]
19+
}
20+
},
21+
"expectedResponse": {
22+
"_extends_": "Common_200_Response",
23+
"body": {
24+
"jurisdictions": [
25+
{
26+
"jurisdictionId": "BEFTA_JURISDICTION_1",
27+
"jurisdictionName": "BEFTA_JURISDICTION_1",
28+
"accessTypes": [
29+
{
30+
"__ordering__": "unordered",
31+
"__elementId__": "organisationProfileId,accessTypeId, displayOrder"
32+
},
33+
{
34+
"organisationProfileId": "SOLICITOR_PROFILE",
35+
"accessTypeId": "BEFTA_SOLICITOR_1",
36+
"accessMandatory": true,
37+
"accessDefault": true,
38+
"display": true,
39+
"description": "BEFTA Solicitor Profile Respondent for Org description",
40+
"hint": "BEFTA Solicitor Profile Respondent for Org hint",
41+
"displayOrder": 2,
42+
"roles": [
43+
{
44+
"__ordering__": "ordered",
45+
"__elementId__": "caseTypeId"
46+
},
47+
{
48+
"caseTypeId": "CaseAccessGroups_Casetype",
49+
"organisationalRoleName": "Role1",
50+
"groupRoleName": "[[ANY_NULLABLE]]",
51+
"caseGroupIdTemplate": "[[ANY_NULLABLE]]",
52+
"groupAccessEnabled": true
53+
},
54+
{
55+
"caseTypeId": "CaseAccessGroups_Casetype",
56+
"organisationalRoleName": "Role1",
57+
"groupRoleName": "Role1",
58+
"caseGroupIdTemplate": "BEFTA_JURISDICTION_1:$ORGID$",
59+
"groupAccessEnabled": true
60+
}
61+
]
62+
},
63+
{
64+
"organisationProfileId": "OGD_DWP_PROFILE",
65+
"accessTypeId": "BEFTA_SOLICITOR_1",
66+
"accessMandatory": true,
67+
"accessDefault": true,
68+
"display": true,
69+
"description": "BEFTA bulk Solicitor 2 Respondent for Org description2",
70+
"hint": "BEFTA bulk Solicitor 2 Respondent for Org hint2",
71+
"displayOrder": 1,
72+
"roles": [
73+
{
74+
"__ordering__": "ordered",
75+
"__elementId__": "caseTypeId"
76+
},
77+
{
78+
"caseTypeId": "CaseAccessGroups_Casetype",
79+
"organisationalRoleName": "Role1",
80+
"groupRoleName": "[[ANY_NULLABLE]]",
81+
"caseGroupIdTemplate": "[[ANY_NULLABLE]]",
82+
"groupAccessEnabled": true
83+
},
84+
{
85+
"caseTypeId": "CaseAccessGroups_Casetype",
86+
"organisationalRoleName": "Role1",
87+
"groupRoleName": "Role1",
88+
"caseGroupIdTemplate": "BEFTA_JURISDICTION_1:$ORGID$",
89+
"groupAccessEnabled": true
90+
}
91+
]
92+
}
93+
]
94+
},
95+
{
96+
"jurisdictionId": "BEFTA_MASTER",
97+
"jurisdictionName": "BEFTA Master",
98+
"accessTypes": [
99+
{
100+
"__ordering__": "unordered",
101+
"__elementId__": "organisationProfileId,accessTypeId, displayOrder"
102+
},
103+
{
104+
"organisationProfileId": "OGD_DWP_PROFILE",
105+
"accessTypeId": "BEFTA_SOLICITOR_2",
106+
"accessMandatory": true,
107+
"accessDefault": true,
108+
"display": true,
109+
"description": "BEFTA bulk Solicitor Respondent for Org description2",
110+
"hint": "BEFTA bulk Solicitor Respondent for Org hint2",
111+
"displayOrder": 2,
112+
"roles": [
113+
{
114+
"__ordering__": "ordered",
115+
"__elementId__": "caseTypeId"
116+
},
117+
{
118+
"caseTypeId": "FT_CaseAccessGroups",
119+
"organisationalRoleName": "Role1",
120+
"groupRoleName": "[[ANY_NULLABLE]]",
121+
"caseGroupIdTemplate": "[[ANY_NULLABLE]]",
122+
"groupAccessEnabled": true
123+
},
124+
{
125+
"caseTypeId": "FT_CaseAccessGroups",
126+
"organisationalRoleName": "Role1",
127+
"groupRoleName": "Role1",
128+
"caseGroupIdTemplate": "BEFTA_MASTER:$ORGID$",
129+
"groupAccessEnabled": true
130+
}
131+
]
132+
},
133+
{
134+
"organisationProfileId": "SOLICITOR_PROFILE",
135+
"accessTypeId": "BEFTA_SOLICITOR_1",
136+
"accessMandatory": true,
137+
"accessDefault": true,
138+
"display": true,
139+
"description": "BEFTA bulk Solicitor Respondent for Org description",
140+
"hint": "BEFTA bulk Solicitor Respondent for Org hint",
141+
"displayOrder": 1,
142+
"roles": [
143+
{
144+
"caseTypeId": "FT_CaseAccessGroups",
145+
"organisationalRoleName": "Role1",
146+
"groupRoleName": "Role1",
147+
"caseGroupIdTemplate": "BEFTA_MASTER:$ORGID$",
148+
"groupAccessEnabled": true
149+
}
150+
]
151+
}
152+
]
153+
}
154+
]
155+
}
156+
}
157+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"_guid_": "S-110.1b",
3+
"_extends_": "F-110_Test_Base_data",
4+
"title": "Successfully retrieve access types for provided organisationProfileIds",
5+
"specs": [
6+
"an active profile in CCD",
7+
"contains correctly configured values",
8+
"contains an organisationProfileId that exists in CCD database",
9+
"contains an organisationProfileId and accessTypes exists in CCD database",
10+
"Retrieve Access Types operation of CCD Data Store",
11+
"contains the latest version of the accessTypes for all organisations across jurisdictions"
12+
],
13+
"request": {
14+
"body": {
15+
"organisationProfileIds": ["OGD_DWP_PROFILE"]
16+
}
17+
},
18+
"expectedResponse": {
19+
"_extends_": "Common_200_Response",
20+
"body": {
21+
"jurisdictions" : [
22+
{
23+
"__ordering__": "unordered",
24+
"__elementId__": "jurisdictionId"
25+
},
26+
{
27+
"jurisdictionId" : "BEFTA_MASTER",
28+
"jurisdictionName" : "BEFTA Master",
29+
"accessTypes" : [ {
30+
"organisationProfileId" : "OGD_DWP_PROFILE",
31+
"accessTypeId" : "BEFTA_SOLICITOR_2",
32+
"accessMandatory" : true,
33+
"accessDefault" : true,
34+
"display" : true,
35+
"description" : "BEFTA bulk Solicitor Respondent for Org description2",
36+
"hint" : "BEFTA bulk Solicitor Respondent for Org hint2",
37+
"displayOrder" : 2,
38+
"roles" : [
39+
{
40+
"caseTypeId" : "FT_CaseAccessGroup",
41+
"organisationalRoleName" : "Role1",
42+
"groupRoleName" : null,
43+
"caseGroupIdTemplate" : null,
44+
"groupAccessEnabled" : true
45+
}, {
46+
"caseTypeId" : "FT_CaseAccessGroup",
47+
"organisationalRoleName" : "Role1",
48+
"groupRoleName" : "Role1",
49+
"caseGroupIdTemplate" : "BEFTA_MASTER:$ORGID$",
50+
"groupAccessEnabled" : true
51+
} ]
52+
} ]
53+
} ]
54+
}
55+
}
56+
}
57+

0 commit comments

Comments
 (0)