Skip to content

CCD-6185 UC : Set the supplementary data (new_case.organisationID) to… #2546

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 18 commits into
base: CCD-5330_Update_elastic_search_query_populate_new_case_data
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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-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.
def definitionStoreDevelopPr = "PR-1536" // This doesn't change frequently, but when it does, only change this value.
def dataStoreApiDevelopPr = "PR-2546" // This doesn't change frequently, but when it does, only change this value.
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
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-1534-java/
DEFINITION_STORE_HOST: http://ccd-definition-store-api-pr-1536-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 @@ -59,7 +59,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 @@ -59,7 +59,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
@@ -0,0 +1,51 @@
@F-144
Feature: F-144: Update Cases Supplementary Data

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

@S-144.1
Scenario: Must return the updated supplementary data values from Data store
Given an appropriate test context as detailed in the test data source,
And a user [Dil - who can create a case],
And a case [C1, which has just been] created as in [F-144_Case_Data_Create_C1],
When a request is prepared with appropriate values,
And it is submitted to call the [Update Cases Supplementary Data] operation of [CCD Data Store api],
Then a positive response is received,
And the response has all the details as expected.

@S-144.2
Scenario: Need to be able to update an existing property for multiple cases
Given an appropriate test context as detailed in the test data source,
And a user [Dil - who can create a case],
And a case [C1, which has just been] created as in [F-144_Case_Data_Create_C1],
And a case [C2, which has just been] created as in [F-144_Case_Data_Create_C2],
When a request is prepared with appropriate values,
And the request [contains updates of a specified value to an existing Supplementary Data property],
And it is submitted to call the [Update Cases Supplementary Data] operation of [CCD Data Store api],
Then a positive response is received,
And the response has all the details as expected.

@S-144.3
Scenario: Need to be able to replace an existing property
Given an appropriate test context as detailed in the test data source,
And a user [Dil - who can create a case],
And a case [C1, which has just been] created as in [F-144_Case_Data_Create_C1],
When a request is prepared with appropriate values,
And the request [replaces the value of an existing supplementary_data property with the provided value],
And it is submitted to call the [Update Cases Supplementary Data] operation of [CCD Data Store api],
Then a positive response is received,
And the response has all the details as expected.

@S-144.4
Scenario: Need to be able to update an existing property for multiple cases with a failure
Given an appropriate test context as detailed in the test data source,
And a user [Dil - who can create a case],
And a case [C1, which has just been] created as in [F-144_Case_Data_Create_C1],
And a case [C3, which has just been] created as in [F-144_Case_Data_Create_C3],
When a request is prepared with appropriate values,
And the request [contains updates of a specified value to an existing Supplementary Data property],
And it is submitted to call the [Update Cases Supplementary Data] operation of [CCD Data Store api],
Then a positive response is received,
And the response has all the details as expected.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"_guid_": "F-144_Case_Data_Create",
"_extends_": "F-144_CreateCasePreRequisiteCaseworker_Multiple_Orgs",
"specs": [
"to create a full case"
],
"users": {
"invokingUser": {
"_extends_": "BeftaMasterCaseworker"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"_guid_": "F-144_Case_Data_Create_C1",
"_extends_": "F-144_Case_Data_Create",
"specs": [
"C1, which has just been"
],
"request": {
"body": {
"event_token": "${[scenarioContext][siblingContexts][F-144_Case_Data_Create_C1_Token_Creation][testData][actualResponse][body][token]}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_guid_": "F-144_Case_Data_Create_C1_Token_Creation",
"_extends_": "S-144_GetCreateToken"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"_guid_": "F-144_Case_Data_Create_C2",
"_extends_": "F-144_Case_Data_Create",
"specs": [
"C2, which has just been"
],
"request": {
"body": {
"event_token": "${[scenarioContext][siblingContexts][F-144_Case_Data_Create_C2_Token_Creation][testData][actualResponse][body][token]}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_guid_": "F-144_Case_Data_Create_C2_Token_Creation",
"_extends_": "S-144_GetCreateToken"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"_guid_": "F-144_Case_Data_Create_C3",
"_extends_": "F-144_Case_Data_Create",
"specs": [
"C3, which has just been"
],
"request": {
"body": {
"event_token": "${[scenarioContext][siblingContexts][F-144_Case_Data_Create_C3_Token_Creation][testData][actualResponse][body][token]}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_guid_": "F-144_Case_Data_Create_C3_Token_Creation",
"_extends_": "S-144_GetCreateToken"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"_guid_": "F-144_CreateCasePreRequisiteCaseworker_Multiple_Orgs",
"_extends_": "Case_Creation_Data_Base",
"specs": [
"to create a case",
"As a prerequisite"
],

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

"users": {
"invokingUser": {
"_extends_": "BeftaMasterCaseworker"
}
},
"request": {
"pathVariables": {
"jid": "BEFTA_MASTER",
"ctid": "FT_NewCaseSupplementry"
},
"body": {
"data": {
"OrganisationPolicyField": {
"newCase": "Yes",
"Organisation": {
"OrganisationID": "orgID1",
"OrganisationName": "orgName1"
}
},
"OrganisationPolicyField3" : {
"newCase": "Yes",
"Organisation": {
"OrganisationID": "orgID3",
"OrganisationName": "orgName3"
}
},
"OrganisationPolicyField5" : {
"newCase" : "no",
"Organisation" : {
"OrganisationID" : "orgID2a",
"OrganisationName" : "orgName2a"
}
},
"OrganisationPolicyField4" : {
"Organisation" : {
"OrganisationID" : "orgID2",
"OrganisationName" : "orgName2"
}
}
},
"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"
}
},
"OrganisationPolicyField3" : {
"Organisation": {
"OrganisationID": "orgID3",
"OrganisationName": "orgName3"
}
},
"OrganisationPolicyField5" : {
"Organisation" : {
"OrganisationID" : "orgID2a",
"OrganisationName" : "orgName2a"
}
},
"OrganisationPolicyField4" : {
"Organisation" : {
"OrganisationID" : "orgID2",
"OrganisationName" : "orgName2"
}
}
},
"data_classification": {
},
"supplementary_data" : {
"new_case" : {
"orgID1" : true,
"orgID3" : true
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_guid_": "F-144_Set_Supplementary_Data_C1",
"_extends_": "F-144_Update_Cases_Supplementary_Data_Base",
"specs": [
"by Dil to update supplementary_data"
],
"request": {
"_extends_": "Common_Request",
"body": {
"cases": ["${[scenarioContext][childContexts][F-144_Case_Data_Create_C1][testData][actualResponse][body][id]}"],
"supplementary_data_updates": {
"$set": {
"new_case.OrgZ": false
}
}
}
},
"expectedResponse": {
"_extends_": "Common_200_Response",
"headers": {
"Content-Length": "[[ANYTHING_PRESENT]]",
"Content-Type": "[[ANYTHING_PRESENT]]",
"Content-Encoding": "gzip"
},
"body": {
"supplementary_data": {
"new_case.OrgZ": false
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"_guid_": "F-144_Test_Data_Base",
"title": "External Elastic Search Endpoint",
"productName": "CCD Data Store Elastic Search API",
"operationName": "external search query",
"method": "POST",
"uri": "/searchCases",
"user" : {
"_extends_": "BeftaMasterCaseworker"
},
"request": {
"_extends_": "Common_Request",
"queryParams": {
"ctid": "FT_NewCaseSupplementry"
}
},

"expectedResponse": {
"_extends_": "Common_200_Response"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"_guid_": "F-144_Update_Cases_Supplementary_Data_Base",
"title": "Update Cases Supplementary Data Base",
"productName": "CCD Data Store",
"operationName": "Update Cases Supplementary Data",
"method": "POST",
"uri": "/cases/supplementary-data",
"users": {
"invokingUser": {
"_extends_": "BeftaCaseworkerCaa"
}
},
"request": {
"_extends_": "Common_Request",
"body": {

}
},
"expectedResponse": {
"headers": {
"_extends_": "Common_Response_Headers",
"Content-Length": "[[ANYTHING_PRESENT]]",
"Content-Type": "[[ANYTHING_PRESENT]]",
"Content-Encoding": "[[ANYTHING_PRESENT]]"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"_guid_": "F-144_Update_Cases_Supplementary_Data_C1",
"_extends_": "F-144_Update_Cases_Supplementary_Data_Base",
"specs": [
"by Dil to update supplementary_data"
],
"request": {
"_extends_": "Common_Request",
"body": {
"cases": [

],
"supplementary_data_updates": {
"$set": {
"new_case.orgID1": false,
"new_case.orgID4": false
}
}
}
},
"expectedResponse": {
"_extends_": "Common_200_Response",
"headers": {
"Content-Length": "[[ANYTHING_PRESENT]]",
"Content-Type": "[[ANYTHING_PRESENT]]",
"Content-Encoding": "gzip"
},
"body": {
"supplementary_data": {
"new_case.orgID1": false
}
}
}
}
Loading