@@ -200,48 +200,48 @@ def test_given_nhs_number_in_path_matches_with_nhs_number_in_headers_and_check_i
200200 audit_data = json .loads (s3_client .get_object (Bucket = audit_bucket , Key = latest_key )["Body" ].read ())
201201
202202 expected_headers = {
203- "x_request_id " : "x_request_id" ,
204- "x_correlation_id " : "x_correlation_id" ,
205- "nhsd_end_user_organisation_ods " : "nhsd_end_user_organisation_ods" ,
206- "nhsd_application_id " : "nhsd_application_id" ,
203+ "xRequestId " : "x_request_id" ,
204+ "xCorrelationId " : "x_correlation_id" ,
205+ "nhsdEndUserOrganisationOds " : "nhsd_end_user_organisation_ods" ,
206+ "nhsdApplicationId " : "nhsd_application_id" ,
207207 }
208- expected_query_params = {"category" : None , "conditions" : None , "include_actions" : "Y" }
209-
210- assert_that (audit_data ["request" ]["request_timestamp" ], is_not (equal_to ("" )))
211- assert_that (audit_data ["request" ]["headers" ], equal_to (expected_headers ))
212- assert_that (audit_data ["request" ]["nhs_number" ], equal_to (persisted_person ))
213- assert_that (audit_data ["request" ]["query_params" ], equal_to (expected_query_params ))
208+ expected_query_params = {"category" : None , "conditions" : None , "includeActions" : "Y" }
214209
215210 expected_conditions = [
216211 {
217- "campaign_id " : campaign_config .id ,
218- "campaign_version " : campaign_config .version ,
219- "iteration_id " : campaign_config .iterations [0 ].id ,
220- "iteration_version " : campaign_config .iterations [0 ].version ,
221- "condition_name " : campaign_config .target ,
212+ "campaignId " : campaign_config .id ,
213+ "campaignVersion " : campaign_config .version ,
214+ "iterationId " : campaign_config .iterations [0 ].id ,
215+ "iterationVersion " : campaign_config .iterations [0 ].version ,
216+ "conditionName " : campaign_config .target ,
222217 "status" : "not_actionable" ,
223- "status_text " : "not_actionable" ,
224- "eligibility_cohorts " : [{"cohort_code " : "cohort_group1" , "cohort_status " : "not_actionable" }],
225- "eligibility_cohort_groups " : [
218+ "statusText " : "not_actionable" ,
219+ "eligibilityCohorts " : [{"cohortCode " : "cohort_group1" , "cohortStatus " : "not_actionable" }],
220+ "eligibilityCohortGroups " : [
226221 {
227- "cohort_code " : "cohort_group1" ,
228- "cohort_text " : "positive_description" ,
229- "cohort_status " : "not_actionable" ,
222+ "cohortCode " : "cohort_group1" ,
223+ "cohortText " : "positive_description" ,
224+ "cohortStatus " : "not_actionable" ,
230225 }
231226 ],
232- "filter_rules " : None ,
233- "suitability_rules " : {
234- "rule_priority " : "10" ,
235- "rule_name " : "Exclude too young less than 75" ,
236- "rule_message " : "Exclude too young less than 75" ,
227+ "filterRules " : None ,
228+ "suitabilityRules " : {
229+ "rulePriority " : "10" ,
230+ "ruleName " : "Exclude too young less than 75" ,
231+ "ruleMessage " : "Exclude too young less than 75" ,
237232 },
238- "action_rule " : None ,
233+ "actionRule " : None ,
239234 "actions" : [],
240235 }
241236 ]
242237
243- assert_that (audit_data ["response" ]["response_id" ], is_not (equal_to ("" )))
244- assert_that (audit_data ["response" ]["last_updated" ], is_not (equal_to ("" )))
238+ assert_that (audit_data ["request" ]["requestTimestamp" ], is_not (equal_to ("" )))
239+ assert_that (audit_data ["request" ]["headers" ], equal_to (expected_headers ))
240+ assert_that (audit_data ["request" ]["nhsNumber" ], equal_to (persisted_person ))
241+ assert_that (audit_data ["request" ]["queryParams" ], equal_to (expected_query_params ))
242+
243+ assert_that (audit_data ["response" ]["responseId" ], is_not (equal_to ("" )))
244+ assert_that (audit_data ["response" ]["lastUpdated" ], is_not (equal_to ("" )))
245245 assert_that (audit_data ["response" ]["condition" ], equal_to (expected_conditions ))
246246
247247
@@ -303,100 +303,100 @@ def test_given_person_has_unique_status_for_different_conditions_with_audit( #
303303 audit_data = json .loads (s3_client .get_object (Bucket = audit_bucket , Key = latest_key )["Body" ].read ())
304304
305305 expected_headers = {
306- "x_request_id " : "x_request_id" ,
307- "x_correlation_id " : "x_correlation_id" ,
308- "nhsd_end_user_organisation_ods " : "nhsd_end_user_organisation_ods" ,
309- "nhsd_application_id " : "nhsd_application_id" ,
306+ "xRequestId " : "x_request_id" ,
307+ "xCorrelationId " : "x_correlation_id" ,
308+ "nhsdEndUserOrganisationOds " : "nhsd_end_user_organisation_ods" ,
309+ "nhsdApplicationId " : "nhsd_application_id" ,
310310 }
311- expected_query_params = {"category" : None , "conditions" : None , "include_actions " : "Y" }
311+ expected_query_params = {"category" : None , "conditions" : None , "includeActions " : "Y" }
312312
313313 rsv_campaign = multiple_campaign_configs [0 ]
314314 covid_campaign = multiple_campaign_configs [1 ]
315315 flu_campaign = multiple_campaign_configs [2 ]
316316
317317 expected_conditions = [
318318 {
319- "campaign_id " : rsv_campaign .id ,
320- "campaign_version " : rsv_campaign .version ,
321- "iteration_id " : rsv_campaign .iterations [0 ].id ,
322- "iteration_version " : rsv_campaign .iterations [0 ].version ,
323- "condition_name " : rsv_campaign .target ,
319+ "campaignId " : rsv_campaign .id ,
320+ "campaignVersion " : rsv_campaign .version ,
321+ "iterationId " : rsv_campaign .iterations [0 ].id ,
322+ "iterationVersion " : rsv_campaign .iterations [0 ].version ,
323+ "conditionName " : rsv_campaign .target ,
324324 "status" : "not_eligible" ,
325- "status_text " : "not_eligible" ,
326- "eligibility_cohorts " : [{"cohort_code " : "cohort_group1" , "cohort_status " : "not_eligible" }],
327- "eligibility_cohort_groups " : [
325+ "statusText " : "not_eligible" ,
326+ "eligibilityCohorts " : [{"cohortCode " : "cohort_group1" , "cohortStatus " : "not_eligible" }],
327+ "eligibilityCohortGroups " : [
328328 {
329- "cohort_code " : "cohort_group1" ,
330- "cohort_text " : "negative_desc_1" ,
331- "cohort_status " : "not_eligible" ,
329+ "cohortCode " : "cohort_group1" ,
330+ "cohortText " : "negative_desc_1" ,
331+ "cohortStatus " : "not_eligible" ,
332332 }
333333 ],
334- "filter_rules " : {"rule_priority " : "10" , "rule_name " : "Exclude too young less than 75" },
335- "suitability_rules " : None ,
336- "action_rule " : None ,
334+ "filterRules " : {"rulePriority " : "10" , "ruleName " : "Exclude too young less than 75" },
335+ "suitabilityRules " : None ,
336+ "actionRule " : None ,
337337 "actions" : [],
338338 },
339339 {
340- "campaign_id " : covid_campaign .id ,
341- "campaign_version " : covid_campaign .version ,
342- "iteration_id " : covid_campaign .iterations [0 ].id ,
343- "iteration_version " : covid_campaign .iterations [0 ].version ,
344- "condition_name " : covid_campaign .target ,
340+ "campaignId " : covid_campaign .id ,
341+ "campaignVersion " : covid_campaign .version ,
342+ "iterationId " : covid_campaign .iterations [0 ].id ,
343+ "iterationVersion " : covid_campaign .iterations [0 ].version ,
344+ "conditionName " : covid_campaign .target ,
345345 "status" : "not_actionable" ,
346- "status_text " : "not_actionable" ,
347- "eligibility_cohorts " : [{"cohort_code " : "cohort_group2" , "cohort_status " : "not_actionable" }],
348- "eligibility_cohort_groups " : [
346+ "statusText " : "not_actionable" ,
347+ "eligibilityCohorts " : [{"cohortCode " : "cohort_group2" , "cohortStatus " : "not_actionable" }],
348+ "eligibilityCohortGroups " : [
349349 {
350- "cohort_code " : "cohort_group2" ,
351- "cohort_text " : "positive_desc_2" ,
352- "cohort_status " : "not_actionable" ,
350+ "cohortCode " : "cohort_group2" ,
351+ "cohortText " : "positive_desc_2" ,
352+ "cohortStatus " : "not_actionable" ,
353353 }
354354 ],
355- "filter_rules " : None ,
356- "suitability_rules " : {
357- "rule_priority " : "10" ,
358- "rule_name " : "Exclude too young less than 75" ,
359- "rule_message " : "Exclude too young less than 75" ,
355+ "filterRules " : None ,
356+ "suitabilityRules " : {
357+ "rulePriority " : "10" ,
358+ "ruleName " : "Exclude too young less than 75" ,
359+ "ruleMessage " : "Exclude too young less than 75" ,
360360 },
361- "action_rule " : None ,
361+ "actionRule " : None ,
362362 "actions" : [],
363363 },
364364 {
365- "campaign_id " : flu_campaign .id ,
366- "campaign_version " : flu_campaign .version ,
367- "iteration_id " : flu_campaign .iterations [0 ].id ,
368- "iteration_version " : flu_campaign .iterations [0 ].version ,
369- "condition_name " : flu_campaign .target ,
365+ "campaignId " : flu_campaign .id ,
366+ "campaignVersion " : flu_campaign .version ,
367+ "iterationId " : flu_campaign .iterations [0 ].id ,
368+ "iterationVersion " : flu_campaign .iterations [0 ].version ,
369+ "conditionName " : flu_campaign .target ,
370370 "status" : "actionable" ,
371- "status_text " : "actionable" ,
372- "eligibility_cohorts " : [{"cohort_code " : "cohort_group3" , "cohort_status " : "actionable" }],
373- "eligibility_cohort_groups " : [
371+ "statusText " : "actionable" ,
372+ "eligibilityCohorts " : [{"cohortCode " : "cohort_group3" , "cohortStatus " : "actionable" }],
373+ "eligibilityCohortGroups " : [
374374 {
375- "cohort_code " : "cohort_group3" ,
376- "cohort_text " : "positive_desc_3" ,
377- "cohort_status " : "actionable" ,
375+ "cohortCode " : "cohort_group3" ,
376+ "cohortText " : "positive_desc_3" ,
377+ "cohortStatus " : "actionable" ,
378378 }
379379 ],
380- "filter_rules " : None ,
381- "suitability_rules " : None ,
382- "action_rule " : {"rule_priority " : "20" , "rule_name " : "In QE1" },
380+ "filterRules " : None ,
381+ "suitabilityRules " : None ,
382+ "actionRule " : {"rulePriority " : "20" , "ruleName " : "In QE1" },
383383 "actions" : [
384384 {
385- "internal_action_code " : "defaultcomms" ,
386- "action_type " : "defaultcomms" ,
387- "action_code " : "action_code" ,
388- "action_description " : None ,
389- "action_url " : None ,
390- "action_url_label " : None ,
385+ "internalActionCode " : "defaultcomms" ,
386+ "actionType " : "defaultcomms" ,
387+ "actionCode " : "action_code" ,
388+ "actionDescription " : None ,
389+ "actionUrl " : None ,
390+ "actionUrlLabel " : None ,
391391 }
392392 ],
393393 },
394394 ]
395395
396- assert_that (audit_data ["request" ]["request_timestamp " ], is_not (equal_to ("" )))
396+ assert_that (audit_data ["request" ]["requestTimestamp " ], is_not (equal_to ("" )))
397397 assert_that (audit_data ["request" ]["headers" ], equal_to (expected_headers ))
398- assert_that (audit_data ["request" ]["nhs_number " ], equal_to (persisted_person_all_cohorts ))
399- assert_that (audit_data ["request" ]["query_params " ], equal_to (expected_query_params ))
400- assert_that (audit_data ["response" ]["response_id " ], is_not (equal_to ("" )))
401- assert_that (audit_data ["response" ]["last_updated " ], is_not (equal_to ("" )))
398+ assert_that (audit_data ["request" ]["nhsNumber " ], equal_to (persisted_person_all_cohorts ))
399+ assert_that (audit_data ["request" ]["queryParams " ], equal_to (expected_query_params ))
400+ assert_that (audit_data ["response" ]["responseId " ], is_not (equal_to ("" )))
401+ assert_that (audit_data ["response" ]["lastUpdated " ], is_not (equal_to ("" )))
402402 assert_that (audit_data ["response" ]["condition" ], contains_inanyorder (* expected_conditions ))
0 commit comments