Skip to content

Commit

Permalink
GA-28 Update the common code such that it updates caseAccessGroups fi…
Browse files Browse the repository at this point in the history
…eld (#2385)

* GA-28 Update the common code such that it updates caseAccessGroups field

* Tidying the code.

* check style errors

* changes to fix issues

* GA-28 Update the common code such that it updates caseAccessGroups field

* GA-28 Update the common code such that it updates caseAccessGroups field

* GA-28 replace index idx_case_data_case_access_groups

* unit test failure fix

* fix for Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Found more than one migration with version 20231120.0000 error

* fix for ERROR: CREATE INDEX CONCURRENTLY cannot run inside a transaction block. Fix: https://stackoverflow.com/questions/29614429/flyway-migration-hangs-for-postgres-create-index-concurrently.

* GA-28 ft changes

* GA-28 ft changes

* GA-28 ft changes

* Id now has UUID

* documentation.

* Modified Unit test.

* Added Unit test to increase coverage. Seperated SubmitCaseTransactionTest to SubmitCaseTransactionCaseAccessGroupTest

* Added dataClassification code

* testing dataClassification code

* Integration test fix.

* Pipeline gate error fix

* Pipeline gate error fix. To reduce Cognitive Complexity.

* Pipeline gate error fix. To reduce Cognitive Complexity.

* Pipeline gate error fix. To reduce Cognitive Complexity.

* GA-28 change test def version

* GA-28 functional test amendments

* Changes to cater for classification

* GA-28 functional test amendments

* GA-28 functional test amendments

* GA-28 functional test amendments

* Change to return CaseGroupIds if everything matches and CaseAccessGroups does not exist in the casedetails data.

* GA-28 functional test amendments

* fix json parser error

* fixing classification to use fundtion getDefaultSecurityClassifications from CaseDataServcice

* fixing classification to use fundtion getDefaultSecurityClassifications from CaseDataServcice

* fixing classification to use fundtion getDefaultSecurityClassifications from CaseDataService

* Tiding the code.

* Review comments and changes to FT's

* Review comments.

* Review comments.

* Refactored FT's against the correct AC's and fixed bug.

* GA-28 Update the common code such that it updates caseAccessGroups field

* GA-28 Update the common code such that it updates caseAccessGroups field

* GA-28 Update the common code such that it updates caseAccessGroups field

* Tidying the code.

* check style errors

* changes to fix issues

* GA-28 replace index idx_case_data_case_access_groups

* unit test failure fix

* fix for Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Found more than one migration with version 20231120.0000 error

* fix for ERROR: CREATE INDEX CONCURRENTLY cannot run inside a transaction block. Fix: https://stackoverflow.com/questions/29614429/flyway-migration-hangs-for-postgres-create-index-concurrently.

* Id now has UUID

* GA-28 ft changes

* GA-28 ft changes

* GA-28 ft changes

* documentation.

* Modified Unit test.

* Added Unit test to increase coverage. Seperated SubmitCaseTransactionTest to SubmitCaseTransactionCaseAccessGroupTest

* Added dataClassification code

* testing dataClassification code

* Integration test fix.

* Pipeline gate error fix

* Pipeline gate error fix. To reduce Cognitive Complexity.

* Pipeline gate error fix. To reduce Cognitive Complexity.

* Pipeline gate error fix. To reduce Cognitive Complexity.

* GA-28 change test def version

* Changes to cater for classification

* GA-28 functional test amendments

* GA-28 functional test amendments

* GA-28 functional test amendments

* GA-28 functional test amendments

* GA-28 functional test amendments

* Change to return CaseGroupIds if everything matches and CaseAccessGroups does not exist in the casedetails data.

* fix json parser error

* fixing classification to use fundtion getDefaultSecurityClassifications from CaseDataServcice

* fixing classification to use fundtion getDefaultSecurityClassifications from CaseDataServcice

* fixing classification to use fundtion getDefaultSecurityClassifications from CaseDataService

* Tiding the code.

* Review comments and changes to FT's

* Review comments.

* Review comments.

* Refactored FT's against the correct AC's and fixed bug.

* fix for dataclassification being replaced incorrectly.

* checkstyle whitespace error

* renamed the file

* changes due to review comments

* checking the response has case_data and data_classification updates

* If no CaseAccessGroups in case_data ensure if there is CaseAccessGroups in data_classification then remove.

* changed info to debug

* dataclassification not returned fix and broken FT tests when @compnent added.

* FT's results not same because needs to be enabled"ENABLE_CASE_GROUP_ACCESS_FILTERING=true" so F-1023 can work for GA-28

* Bumping chart version/ fixing aliases

* Unit test for CaseAccessUtils class

* Unit test for CaseAccessUtils class

* Unit test for CaseAccessUtils class tidying

* removed unused function

* review comments

* review comments

* checkstyle build errors.

* GA-28 refactoring (#2389)

* GA-28 Review comment to inject dataservice and caseAccessGroupUtils
---------

Co-authored-by: patelila <[email protected]>

* GA-28 revert to same as master

* Bumping chart version/ fixing aliases

* GA-28 fix after merge with master

* GA-28 fix after merge with master

* GA-28 fix after merge with master

* GA-28 fix after merge with master

* Build error variable caseDetailsJsonParser not required.

* added
{
  "__ordering__": "ordered"
},

* Bumping chart version/ fixing aliases

* Bumping chart version/ fixing aliases

* Ccd 5324 update common code case access groups (#2409)

* FT for testing v1_external#/case-details-endpoint/saveCaseDetailsForCitizenUsingPOST

* FT for testing v1_external#/case-details-endpoint v2_external#/case-controller/createCaseUsingPOST

* Bumping chart version/ fixing aliases

* AC05:Invoke createCaseEventForCaseWorkerUsingPOST and caseGroupId created{}: v1_external#/case-details-endpoint/createCaseEventForCaseWorkerUsingPOST

* AC

* revert change for s-1023.1

* FT for v1_external#/case-details-endpoint/createCaseEventForCaseWorkerUsingPOST and v1_external#/case-details-endpoint/createCaseEventForCitizenUsingPOST

* FT for v2_external#/case-controller/createEventUsingPOST

* removed unnecessary underscore

* Bumping chart version/ fixing aliases

---------

Co-authored-by: hmcts-jenkins-a-to-c <62422075+hmcts-jenkins-a-to-c[bot]@users.noreply.github.com>

* Update Jenkinsfile_CNP

reverted def-store back to develop branch -> PR-575

---------

Co-authored-by: patelila <[email protected]>
Co-authored-by: Ila Patel <[email protected]>
Co-authored-by: hmcts-jenkins-a-to-c <62422075+hmcts-jenkins-a-to-c[bot]@users.noreply.github.com>
Co-authored-by: amoghnaik-hmcts <[email protected]>
Co-authored-by: RebeccaBaker <[email protected]>
Co-authored-by: aminakhatunCGI <[email protected]>
Co-authored-by: dinesh1patel <[email protected]>
  • Loading branch information
8 people committed Jun 19, 2024
1 parent 6af16e7 commit 484119b
Show file tree
Hide file tree
Showing 71 changed files with 4,972 additions and 32 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,22 @@ with their new equivalents using befta fw so that the new ones will be
doing a lot more detailed verifications.

To find out more about BEFTA Framework, see the repository and its README [here](https://github.com/hmcts/befta-fw).
#### To Run the Functional Tests (FT)

##### All Functional Tests
Will run all the FT's:

./gradlew functional

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

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

Will run only S-1023.5:

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


## LICENSE

Expand Down
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ dependencies {
testImplementation group: 'io.rest-assured', name: 'rest-assured', version: '4.3.0'
testImplementation group: 'com.xebialabs.restito', name: 'restito', version: '0.9.3'
testImplementation 'io.github.openfeign:feign-jackson:9.7.0'
testImplementation group: 'org.testcontainers', name: 'elasticsearch', version: '1.18.3'
testImplementation group: 'org.testcontainers', name: 'elasticsearch', version: '1.19.3'
testImplementation group: 'org.testcontainers', name: 'junit-jupiter', version: '1.19.3'
testImplementation 'com.github.hmcts:fortify-client:1.3.0:all'
testImplementation group: 'commons-lang', name: 'commons-lang', version: '2.6'

Expand All @@ -305,7 +306,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.21.13'
testImplementation group: 'com.github.hmcts', name: 'ccd-test-definitions', version: '7.21.22'

testImplementation group: 'com.github.hmcts', name: 'befta-fw', version: beftaFwVersion
testRuntimeOnly group: 'com.github.hmcts', name: 'befta-fw', version: beftaFwVersion
Expand Down Expand Up @@ -861,6 +862,8 @@ task smoke() {
outputs.upToDateWhen { false }
}

def tags = (findProperty('tags') == null) ? 'not @Ignore' : '(' + findProperty('tags') + ') and not @Ignore'

task functional(type: JavaExec) {
description = "Executes functional tests against an the CCD Data Store API instance just deployed"
group = "Verification"
Expand All @@ -875,7 +878,7 @@ task functional(type: JavaExec) {
'--threads', '1',
'--plugin', "json:${rootDir}/target/cucumber.json",
'--plugin', "junit:${buildDir}/test-results/functional/cucumber.xml",
'--tags', 'not @Ignore',
'--tags',"${tags}",
'--glue', 'uk.gov.hmcts.befta.player',
'--glue', 'uk.gov.hmcts.ccd.datastore.befta',
'src/aat/resources/features'
Expand Down
2 changes: 1 addition & 1 deletion charts/ccd-data-store-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description: Helm chart for the HMCTS CCD Data Store
name: ccd-data-store-api
apiVersion: v2
home: https://github.com/hmcts/ccd-data-store-api
version: 2.0.28
version: 2.0.29
maintainers:
- name: HMCTS CCD Dev Team
email: [email protected]
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-1454-java/
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
1 change: 1 addition & 0 deletions charts/ccd-data-store-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ java:
ELASTIC_SEARCH_NODES_DISCOVERY_ENABLED: 'true'
ELASTIC_SEARCH_NODES_DISCOVERY_FREQUENCY_MILLIS: '5000'
ELASTIC_SEARCH_NODES_DISCOVERY_FILTER: '_all'
ENABLE_CASE_GROUP_ACCESS_FILTERING: true

LOG_AND_AUDIT_CASE_ENABLED: false

Expand Down
38 changes: 38 additions & 0 deletions docs/api/case-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,41 @@ A `CaseLink` is a field used to reference another CCD case using its universal 1
}
}
```

### CaseAccessGroups

A CaseAccessGroups field which accepts 'caseAccessGroupType' and 'caseAccessGroupId' as string values.
Also shows the optional required OrganisationPolicyField field.
#### Example JSON String.
```json
{
"CaseAccessGroups": [
{
"id": "652027f5-93db-4251-9cd3-a823516b83ea",
"value": {
"caseAccessGroupId": "BEFTA_MASTER:1OXC2AA",
"caseAccessGroupType": "CCD:all-cases-access"
}
},
{
"id": "e6a7cef1-9af2-42ba-9897-76d7c3f84dbd",
"value": {
"caseAccessGroupId": "BEFTA_MASTER:1OXC2AA",
"caseAccessGroupType": "CCD:all-cases-access"
}
}
],
"OrganisationPolicyField": {
"Organisation": {
"OrganisationID": "1OXC2AA",
"OrganisationName": "groupname1"
},
"LastNoCRequestedBy": null,
"OrgPolicyReference": null,
"PreviousOrganisations": [],
"OrgPolicyCaseAssignedRole": "groupname1",
"PrepopulateToUsersOrganisation": null
}
}
```

4 changes: 4 additions & 0 deletions src/aat/resources/features/F-051 - Get Profile/S-105.td.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@
"searchCriterias": [],
"categories": [],
"roleToAccessProfiles": [],
"accessTypes": [],
"accessTypeRoles": [],
"security_classification": null,
"case_fields": [],
"printable_document_url": null,
Expand Down Expand Up @@ -612,6 +614,8 @@
"categories": [],
"searchCriterias": [],
"roleToAccessProfiles": [],
"accessTypes": [],
"accessTypeRoles": [],
"security_classification": null,
"case_fields": [],
"printable_document_url": null,
Expand Down
4 changes: 4 additions & 0 deletions src/aat/resources/features/F-051 - Get Profile/S-109.td.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@
"searchCriterias" : [],
"categories" : [],
"roleToAccessProfiles": [],
"accessTypes": [],
"accessTypeRoles": [],
"security_classification": null,
"case_fields": [],
"printable_document_url": null,
Expand Down Expand Up @@ -612,6 +614,8 @@
"categories" : [],
"searchCriterias" : [],
"roleToAccessProfiles": [],
"accessTypes": [],
"accessTypeRoles": [],
"security_classification": null,
"case_fields": [],
"printable_document_url": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"searchCriterias" : [],
"categories" : [],
"roleToAccessProfiles": [],
"accessTypes": [],
"accessTypeRoles": [],
"security_classification": null,
"case_fields": [],
"printable_document_url": null,
Expand Down Expand Up @@ -72,6 +74,8 @@
"searchCriterias" : [],
"categories" : [],
"roleToAccessProfiles": [],
"accessTypes": [],
"accessTypeRoles": [],
"security_classification": null,
"case_fields": [],
"printable_document_url": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@
"searchCriterias" : [],
"categories" : [],
"roleToAccessProfiles": [],
"accessTypes": [],
"accessTypeRoles": [],
"security_classification": null,
"case_fields": [],
"printable_document_url": null,
Expand Down Expand Up @@ -572,6 +574,8 @@
"searchCriterias" : [],
"categories" : [],
"roleToAccessProfiles": [],
"accessTypes": [],
"accessTypeRoles": [],
"security_classification": null,
"case_fields": [],
"printable_document_url": null,
Expand Down
Loading

0 comments on commit 484119b

Please sign in to comment.