Skip to content

Ccd 5330 update elastic search query populate new case data #2543

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 57 commits into
base: CCD-5332_update_supplementary_data_new_case
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
da5643d
CCD-5333 UC : Clear the new cases supplementary data for an organisat…
patelila Feb 6, 2025
976e6e7
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila Feb 6, 2025
a467cd2
Test data and changes for unit tests
patelila Feb 6, 2025
c3523e0
Merge remote-tracking branch 'origin/CCD-5329_CCD-5333_Clear_new_case…
patelila Feb 6, 2025
c3f22fa
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila Feb 6, 2025
eb2cea3
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila Feb 7, 2025
c1ca993
unit test
patelila Feb 7, 2025
f86a6b7
added unit test
patelila Feb 7, 2025
c5bdffe
empty commit to trigger build
patelila Feb 10, 2025
8949b0d
empty commit to trigger build
patelila Feb 10, 2025
1ebcc6a
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila Feb 10, 2025
00fa80a
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila Feb 17, 2025
a33602c
AC 1
patelila Feb 24, 2025
2530d03
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila Feb 24, 2025
c677149
Version of java helm chart below 5.3.0 is deprecated
patelila Feb 24, 2025
c23dd9c
Merge remote-tracking branch 'origin/CCD-5329_CCD-5333_Clear_new_case…
patelila Feb 24, 2025
08ec16b
feature changes
patelila Feb 25, 2025
13231e0
Bumping chart version/ fixing aliases
hmcts-jenkins-a-to-c[bot] Feb 25, 2025
bc95acb
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila Feb 25, 2025
7b20ba6
Modified to comment out the call to clearUserAssignedNewCase as not s…
patelila Feb 25, 2025
39856f7
revert
patelila Feb 25, 2025
e497a4d
changes for new_case
patelila Feb 26, 2025
de290c3
code tidy
patelila Feb 26, 2025
836a11f
checkstyle error
patelila Feb 26, 2025
956cffa
add missing files
patelila Feb 27, 2025
76a0643
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila Feb 28, 2025
b801e6b
Funtional test for CCD-5330
patelila Mar 3, 2025
f588bac
Functional test for CCD-5330
patelila Mar 3, 2025
5fa1b55
Merge branch 'CCD-5329_CCD-5333_Clear_new_cases_supplementary_data-or…
patelila Mar 4, 2025
6fe2747
fix failure in Functional test .3/4 for CCD-5330
patelila Mar 4, 2025
80fc4d9
ccd-test-def version change
patelila Mar 5, 2025
472ff3c
jenkins change
patelila Mar 5, 2025
20dc7ac
use pr-1534
patelila Mar 5, 2025
166ae38
empty commit to trigger build
patelila Mar 5, 2025
c38ff89
use pr-1534
patelila Mar 5, 2025
4735e36
empty commit to trigger build
patelila Mar 5, 2025
038b78e
added FT for multiple organisations
patelila Mar 5, 2025
ec996a1
fix new_case Org value currrently set to be a string instead of boole…
patelila Mar 6, 2025
b35bddc
Checkstyle error fix
patelila Mar 6, 2025
37efea5
extra FT to search New cases from supplementary data where new case v…
patelila Mar 7, 2025
8ac15a7
fix error: actualResponse.body.supplementary_data.new_case contains a…
patelila Mar 7, 2025
336e092
fix errors like : actualResponse.body contains a bad value: arrayInM…
patelila Mar 7, 2025
08fbb4c
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila Mar 7, 2025
51a22cd
empty commit to trigger build
patelila Mar 10, 2025
cd38a30
empty commit to trigger build
patelila Mar 11, 2025
d0abb54
FT-105: S-109/S-105 -failing on State being populated for case of ty…
patelila Mar 11, 2025
b7c6515
empty commit to trigger build
patelila Mar 11, 2025
99feae3
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila Apr 4, 2025
adc6791
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila May 8, 2025
ab7553d
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila May 8, 2025
e6f9eb8
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila May 8, 2025
d9204ec
fix for merge build errors
patelila May 8, 2025
953769e
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila May 9, 2025
6fcfedf
resolving conflicts
patelila May 9, 2025
ed4aa27
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila May 9, 2025
fec4837
resolving conflicts
patelila May 9, 2025
9c20a4d
Merge branch 'CCD-5332_update_supplementary_data_new_case' into CCD-5…
patelila May 9, 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-1529" // This doesn't change frequently, but when it does, only change this value.
def dataStoreApiDevelopPr = "PR-2520" // This doesn't change frequently, but when it does, only change this value.
def definitionStoreDevelopPr = "PR-1534" // This doesn't change frequently, but when it does, only change this value.
def dataStoreApiDevelopPr = "PR-2543" // 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 upon 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
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def versions = [
ext['spring-security.version'] = '5.7.11'
ext['spring-framework.version'] = '5.3.27'
ext['jackson.version'] = '2.16.0'
//overriding for easy access to the version for FT testing
ext['beftaFwVersion'] = '9.2.3'
ext['ccdTestDefinitionVersion'] = '7.26.2-prerelease-CCD-5329'

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-1529-java/
DEFINITION_STORE_HOST: http://ccd-definition-store-api-pr-1534-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
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"supplementary_data" : {
"new_case" : {
"orgID1" : "true"
"orgID1" : true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"supplementary_data": {
"new_case":
{
"orgID1": "true"
"orgID1": true
}
},
"after_submit_callback_response": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
"supplementary_data": {
"new_case":
{
"orgID1" : "true",
"orgID3" : "true"
"orgID1" : true,
"orgID3" : true
}
},
"after_submit_callback_response": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"supplementary_data": {
"new_case": [
{
"orgID1" : "true"
"orgID1" : true
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@
"supplementary_data": {
"new_case":
{
"orgID1" : "true",
"orgID3" : "true"
"orgID1" : true,
"orgID3" : true
}
},
"after_submit_callback_response": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"data_classification" : { },
"supplementary_data" : {
"new_case" : {
"orgID1" : "true"
"orgID1" : true
}
},
"after_submit_callback_response" : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"supplementary_data" : {
"new_case" : {
"orgID1" : "true"
"orgID1" : true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@F-143 @elasticsearch
Feature: F-143 Additional new cases supplementary data property returned by ES Search APIs

Background: Load test data for the scenario
Given an appropriate test context as detailed in the test data source
And a case that has just been created as in [F-143_CreateCasePreRequisiteCaseworker]
And a successful call [to add supplementary data for the case] as in [F-143_Add_Supplementary_Data]
And a wait time of [5] seconds [to allow for Logstash to index the case just created],
And a user with [a valid profile]

@S-143.1 #AC03
Scenario: internal search api usecase request does not return supplementary data by default
Given the request [is configured to search for the previously created case],
And the request [does not explicitly request supplementary_data]
And the request [is using the query parameter use_case=orgcases],
And a request is prepared with appropriate values,
When it is submitted to call the [Internal Elastic Search Endpoint] operation of [CCD Data Store Elastic Search API],
Then the response [contains the previously created case],
Then the response [contains supplementary data],
And the response has all other details as expected.

@S-143.2 #AC01
Scenario: internal search api usecase request does return supplementary data when requested in the request
Given the request [is configured to search for the previously created case],
And the request [is configured to request supplementary_data]
And the request [is using the query parameter use_case=orgcases],
And a request is prepared with appropriate values,
When it is submitted to call the [Internal Elastic Search Endpoint] operation of [CCD Data Store Elastic Search API],
Then the response [contains the previously created case],
Then the response [contains supplementary data],
And the response has all other details as expected.

@S-143.3 #AC04
Scenario: external search api can request sub selection of supplementary data
Given a user with [a valid profile]
When the request [is configured to search for the previously created case],
And the request [requests a subsection of the supplementary data]
And a request is prepared with appropriate values,
And it is submitted to call the [External Elastic Search Endpoint] operation of [CCD Data Store Elastic Search API],
Then the response [contains the previously created case],
Then the response [contains the specified sub section of supplementary data],
And the response has all other details as expected.

@S-143.4 #AC01
Scenario: external search api can request New cases from supplementary data where new case value is true
Given a user with [a valid profile]
When the request [is configured to search for the previously created case],
And the request [requests a subsection of the supplementary data]
And a request is prepared with appropriate values,
And it is submitted to call the [External Elastic Search Endpoint] operation of [CCD Data Store Elastic Search API],
Then the response [contains the previously created case],
Then the response [contains the specified sub section of supplementary data],
And the response has all other details as expected.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"_guid_": "F-143_Add_Supplementary_Data",
"title": "Update Supplementary Data Base",
"productName": "CCD Data Store",
"operationName": "Update Supplementary Data",
"method": "POST",
"uri": "/cases/{caseId}/supplementary-data",
"specs": ["to add supplementary data for the case"],
"users": {
"invokingUser": {
"_extends_": "BeftaCaseworkerCaa"
}
},
"request": {
"_extends_": "Common_Request",
"pathVariables": {
"caseId": "${[scenarioContext][parentContext][childContexts][F-143_CreateCasePreRequisiteCaseworker][testData][actualResponse][body][id]}"
},
"body": {
"supplementary_data_updates": {
"$set": {
"new_case.orgID1": true
}
}
}
},
"expectedResponse": {
"_extends_": "Common_200_Response",
"body": {
"supplementary_data": {
"new_case.orgID1": true
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"_guid_": "F-143_CreateCasePreRequisiteCaseworker",
"_extends_": "Case_Creation_Data_Base",
"specs": [
"to create a case",
"As a prerequisite"
],

"prerequisites" : [ {
"Token_Creation": "S-143_GetCreateToken"
}
],

"users": {
"invokingUser": {
"_extends_": "BeftaMasterCaseworker"
}
},
"request": {
"pathVariables": {
"jid": "BEFTA_MASTER",
"ctid": "FT_NewCaseSupplementry"
},
"body": {
"data": {
"OrganisationPolicyField": {
"newCase": "Yes",
"Organisation": {
"OrganisationID": "orgID1",
"OrganisationName": "orgName1"
}
}
},
"event": {
"id": "createCase",
"summary": "",
"description": ""
},
"event_token": "${[scenarioContext][childContexts][Token_Creation][testData][actualResponse][body][token]}"
}
},

"expectedResponse": {
"body": {
"id": "[[ANYTHING_PRESENT]]",
"jurisdiction": "BEFTA_MASTER",
"state" : "CaseCreated",
"case_type_id": "FT_NewCaseSupplementry",
"created_date": "[[ANYTHING_PRESENT]]",
"last_modified": "[[ANYTHING_PRESENT]]",
"last_state_modified_date": "[[ANYTHING_PRESENT]]",
"security_classification": "PUBLIC",
"case_data": {
"OrganisationPolicyField": {
"Organisation": {
"OrganisationID": "orgID1",
"OrganisationName": "orgName1"
}
}
},
"data_classification": {
},
"supplementary_data" : {
"new_case" : {
"orgID1" : true
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"_guid_": "S-143.1",
"productName": "CCD Data Store Elastic Search API",
"operationName": "Internal Elastic Search Endpoint",
"method": "POST",
"uri": "/internal/searchCases",
"user" : {
"_extends_": "BeftaMasterCaseworker"
},
"specs": [
"a valid profile",
"is configured to search for the previously created case",
"does not explicitly request supplementary_data",
"is using the query parameter use_case=orgcases",
"contains the previously created case",
"contains supplementary data"
],
"request": {
"_extends_": "Common_Request",
"queryParams": {
"ctid": "FT_NewCaseSupplementry",
"use_case": "ORGCASES"
},
"body": {
"native_es_query": {
"query": {
"match": {
"reference": "${[scenarioContext][childContexts][F-143_CreateCasePreRequisiteCaseworker][testData][actualResponse][body][id]}"
}
}
}
}
},

"expectedResponse": {
"_extends_": "Common_200_Response",
"body": {
"headers": [
{
"__ordering__": "ordered"
},
{
"metadata": {
"jurisdiction": "BEFTA_MASTER",
"case_type_id": "FT_NewCaseSupplementry"
},
"fields": [
{
"__operator__": "equivalent",
"__ordering__": "unordered",
"__elementId__": "label"
},
{
"label": "`FixedList` orgcases",
"order": 1,
"metadata": false,
"case_field_id": "FixedListField",
"case_field_type": {
"id": "FixedList-FixedListType",
"type": "FixedList",
"min": null,
"max": null,
"regular_expression": null,
"fixed_list_items": [{
"code" : "VALUE4",
"label" : "Value 4",
"order" : null
},
{
"code": "VALUE3",
"label": "Value 3",
"order": null
},
{
"code": "VALUE2",
"label": "Value 2",
"order": null
},
{
"code": "VALUE1",
"label": "Value 1",
"order": null
}
],
"complex_fields": [],
"collection_field_type": null
},
"display_context_parameter": null
}
],
"cases": "[[ANYTHING_PRESENT]]"
}
],
"cases": [
{
"fields": {
"[JURISDICTION]": "BEFTA_MASTER",
"[LAST_STATE_MODIFIED_DATE]" : "[[ANYTHING_PRESENT]]",
"[CREATED_DATE]": "[[ANYTHING_PRESENT]]",
"[CASE_REFERENCE]": "${[scenarioContext][customValues][caseIdAsStringFrom_F-143_CreateCasePreRequisiteCaseworker]}",
"[STATE]": "CaseCreated",
"[SECURITY_CLASSIFICATION]": "PUBLIC",
"[CASE_TYPE]": "FT_NewCaseSupplementry",
"[LAST_MODIFIED_DATE]": "[[ANYTHING_PRESENT]]"
},
"case_id": "${[scenarioContext][customValues][caseIdAsStringFrom_F-143_CreateCasePreRequisiteCaseworker]}",
"fields_formatted": {
"[JURISDICTION]": "BEFTA_MASTER",
"[LAST_STATE_MODIFIED_DATE]" : "[[ANYTHING_PRESENT]]",
"[CREATED_DATE]": "[[ANYTHING_PRESENT]]",
"[CASE_REFERENCE]": "${[scenarioContext][customValues][caseIdAsStringFrom_F-143_CreateCasePreRequisiteCaseworker]}",
"[STATE]": "CaseCreated",
"[SECURITY_CLASSIFICATION]": "PUBLIC",
"[CASE_TYPE]": "FT_NewCaseSupplementry",
"[LAST_MODIFIED_DATE]": "[[ANYTHING_PRESENT]]"
},
"supplementary_data" : null
}
],
"total": 1
}

}
}
Loading