Skip to content

Commit 5415e01

Browse files
FimranNHSdlzhry2nhsmotolaamarauzomaavshetty1980
authored
VED-1098 - MNS event automation tests (#1307)
* VED-981 Add base infrastructure for the MNS Publisher feature (#1191) * VED-981 (Part 2) Add DLQ, redrive policy, and encryption to queues (#1203) * VED-982: Create POST MNS Notification (#1211) * build base schema * VED-000: Refactor Api_clients Authentication (#1278) * Modify mns publisher infra to account properly for test queue (#1288) * remove default apigee env (#1297) * added tests and refactored calculate age for vaccination from bday (#1306) * initial commit * VED-982: Consolidate MNS Staging and Master (#1300) * Staging/group all bumps * updating tests and fix formatting issue * updated e2e ymal with aws account id variable to pass to tests * final test update * updated the message read time * update * add try catch in purge all queues * update nhs number from testdata file * fix broken tests * fix broken tests * fix broken tests * removed unnecessary dead letter validation --------- Co-authored-by: Daniel Yip <daniel.yip4@nhs.net> Co-authored-by: Akinola Olutola <akinola.olutola1@nhs.net> Co-authored-by: amarauzoma <amara.uzoma1@nhs.net> Co-authored-by: Akshay Shetty <akshay.shetty1@nhs.net>
1 parent 7a2a83a commit 5415e01

17 files changed

Lines changed: 2440 additions & 1049 deletions

File tree

.github/workflows/run-e2e-automation-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ jobs:
234234
SONAR_client_Secret: ${{ secrets.SONAR_client_Secret }}
235235
MEDICUS_client_Id: ${{ secrets.MEDICUS_client_Id }}
236236
MEDICUS_client_Secret: ${{ secrets.MEDICUS_client_Secret }}
237-
aws_token_refresh: "False"
237+
aws_account_id: ${{ vars.AWS_ACCOUNT_ID }}
238238
TEST_PATH: ${{ inputs.service_under_test == 'batch' && 'features/batchTests' || inputs.service_under_test == 'fhir_api' && 'features/APITests' || 'features' }}
239239
TEST_FILTER: ${{ inputs.suite_to_run == 'proxy_smoke' && 'Status_feature' || inputs.suite_to_run }}
240240
run: poetry run pytest "$TEST_PATH" -m "$TEST_FILTER" --junitxml=output/test-results.xml --alluredir=output/allure-results

lambdas/mns_publisher/tests/test_sqs_dynamo_utils.py

Whitespace-only changes.

tests/e2e_automation/features/APITests/create.feature

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,27 @@ Feature: Create the immunization event for a patient
1111
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
1212
And The imms event table will be populated with the correct data for 'created' event
1313
And The delta table will be populated with the correct data for created event
14+
And MNS event will be triggered with correct data for created event
1415

1516
Examples:
16-
| Patient | vaccine_type | Supplier |
17-
| Random | COVID | Postman_Auth |
18-
| Random | RSV | RAVS |
19-
| Random | FLU | MAVIS |
20-
| Random | MMR | Postman_Auth |
21-
| Random | MENACWY | TPP |
22-
| Random | 3IN1 | TPP |
23-
| Random | MMRV | EMIS |
24-
| Random | PERTUSSIS | EMIS |
25-
| Random | SHINGLES | EMIS |
26-
| Random | PNEUMOCOCCAL | EMIS |
27-
| Random | 4IN1 | TPP |
28-
| Random | 6IN1 | EMIS |
29-
| Random | HIB | TPP |
30-
| Random | MENB | TPP |
31-
| Random | ROTAVIRUS | MEDICUS |
32-
| Random | HEPB | EMIS |
33-
| Random | BCG | MEDICUS |
17+
| Patient | vaccine_type | Supplier |
18+
| Random | COVID | Postman_Auth |
19+
| Random | RSV | RAVS |
20+
| Random | FLU | MAVIS |
21+
| Random | MMR | Postman_Auth |
22+
| Random | MENACWY | TPP |
23+
| Random | 3IN1 | TPP |
24+
| Random | MMRV | EMIS |
25+
| Random | PERTUSSIS | EMIS |
26+
| Random | SHINGLES | EMIS |
27+
| Random | PNEUMOCOCCAL | EMIS |
28+
| Random | 4IN1 | TPP |
29+
| Random | 6IN1 | EMIS |
30+
| Random | HIB | TPP |
31+
| Mod11_NHS | MENB | TPP |
32+
| Invalid_NHS | ROTAVIRUS | MEDICUS |
33+
| Random | HEPB | EMIS |
34+
| Random | BCG | MEDICUS |
3435

3536
@Delete_cleanUp
3637
Scenario Outline: Verify that the POST Create API request with minimal dataset for different vaccine types
@@ -42,6 +43,7 @@ Feature: Create the immunization event for a patient
4243
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
4344
And The imms event table will be populated with the correct data for 'created' event
4445
And The delta table will be populated with the correct data for created event
46+
And MNS event will be triggered with correct data for created event
4547

4648
Examples:
4749
| Patient | vaccine_type | Supplier |
@@ -70,6 +72,7 @@ Feature: Create the immunization event for a patient
7072
Then The request will be successful with the status code '201'
7173
And The location key and Etag in header will contain the Immunization Id and version
7274
And The terms are mapped to the respective text fields in imms delta table
75+
And MNS event will be triggered with correct data for created event
7376

7477
@Delete_cleanUp @vaccine_type_BCG @patient_id_Random @supplier_name_EMIS
7578
Scenario: Verify that VACCINATION_PROCEDURE_TERM, VACCINE_PRODUCT_TERM fields are mapped to first instance of coding.display fields in imms delta table
@@ -78,6 +81,7 @@ Feature: Create the immunization event for a patient
7881
Then The request will be successful with the status code '201'
7982
And The location key and Etag in header will contain the Immunization Id and version
8083
And The terms are mapped to first instance of coding.display fields in imms delta table
84+
And MNS event will be triggered with correct data for created event
8185

8286
@Delete_cleanUp @vaccine_type_HEPB @patient_id_Random @supplier_name_MEDICUS
8387
Scenario: Verify that VACCINATION_PROCEDURE_TERM, VACCINE_PRODUCT_TERM, SITE_OF_VACCINATION_TERM, ROUTE_OF_VACCINATION_TERM fields are mapped to correct instance of coding.display fields in imms delta table
@@ -86,6 +90,7 @@ Feature: Create the immunization event for a patient
8690
Then The request will be successful with the status code '201'
8791
And The location key and Etag in header will contain the Immunization Id and version
8892
And The terms are mapped to correct instance of coding.display fields in imms delta table
93+
And MNS event will be triggered with correct data for created event
8994

9095
@smoke
9196
@Delete_cleanUp @vaccine_type_PERTUSSIS @patient_id_Random @supplier_name_EMIS
@@ -95,6 +100,7 @@ Feature: Create the immunization event for a patient
95100
Then The request will be successful with the status code '201'
96101
And The location key and Etag in header will contain the Immunization Id and version
97102
And The terms are mapped to correct coding.display fields in imms delta table
103+
And MNS event will be triggered with correct data for created event
98104

99105
@smoke
100106
@Delete_cleanUp @vaccine_type_HIB @patient_id_Random @supplier_name_TPP
@@ -104,6 +110,7 @@ Feature: Create the immunization event for a patient
104110
Then The request will be successful with the status code '201'
105111
And The location key and Etag in header will contain the Immunization Id and version
106112
And The terms are blank in imms delta table
113+
And MNS event will be triggered with correct data for created event
107114

108115
@smoke
109116
Scenario Outline: Verify that the POST Create API for different supplier fails on access denied
@@ -127,6 +134,7 @@ Feature: Create the immunization event for a patient
127134
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
128135
And The imms event table will be populated with the correct data for 'created' event
129136
And The delta table will be populated with the correct data for created event
137+
And MNS event will be triggered with correct data for created event
130138

131139
@smoke
132140
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
@@ -135,6 +143,7 @@ Feature: Create the immunization event for a patient
135143
When Trigger the post create request
136144
Then The request will be unsuccessful with the status code '400'
137145
And The Response JSONs should contain correct error message for '<error_type>'
146+
And MNS event will not be triggered for the event
138147
Examples:
139148
| doseNumberPositiveInt | error_type |
140149
| -1 | doseNumberPositiveInt_PositiveInteger |
@@ -148,6 +157,7 @@ Feature: Create the immunization event for a patient
148157
When Trigger the post create request
149158
Then The request will be successful with the status code '201'
150159
And The location key and Etag in header will contain the Immunization Id and version
160+
And MNS event will be triggered with correct data for created event
151161

152162

153163
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
@@ -278,6 +288,20 @@ Feature: Create the immunization event for a patient
278288
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
279289
And The imms event table will be populated with the correct data for 'created' event
280290
And The delta table will be populated with the correct data for created event
291+
And MNS event will be triggered with correct data for created event
281292
When Trigger another post create request with same unique_id and unique_id_uri
282293
Then The request will be unsuccessful with the status code '422'
283294
And The Response JSONs should contain correct error message for 'duplicate'
295+
And MNS event will not be triggered for the event
296+
297+
@smoke
298+
@Delete_cleanUp @supplier_name_TPP @vaccine_type_BCG @patient_id_Random
299+
Scenario: Verify that the POST Create API will create MNS event when patient is less then 1 year old
300+
Given Valid json payload is created where patient age is less then an year
301+
When Trigger the post create request
302+
Then The request will be successful with the status code '201'
303+
And The location key and Etag in header will contain the Immunization Id and version
304+
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
305+
And The imms event table will be populated with the correct data for 'created' event
306+
And The delta table will be populated with the correct data for created event
307+
And MNS event will be triggered with correct data for created event

tests/e2e_automation/features/APITests/search.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Feature: Search the immunization of a patient
5757
And The occurrenceDateTime of the immunization events should be within the Date From and Date To range
5858
Examples:
5959
| NHSNumber | vaccine_type | DateFrom | DateTo |
60-
| 9728403348 | FLU | 2023-01-01 | 2023-06-04 |
60+
| 9461267665 | FLU | 2023-01-01 | 2023-06-04 |
6161

6262
# Negative Scenarios
6363
@supplier_name_Postman_Auth
@@ -86,7 +86,7 @@ Feature: Search the immunization of a patient
8686
And The Search Response JSONs should contain correct error message for invalid include
8787
Examples:
8888
| NHSNumber | vaccine_type | include |
89-
| 9728403348 | COVID | abc |
89+
| 9461267665 | COVID | abc |
9090

9191
@smoke
9292
@supplier_name_Postman_Auth
@@ -99,10 +99,10 @@ Feature: Search the immunization of a patient
9999
And The Search Response JSONs should contain correct error message for invalid Date From, Date To and include
100100
Examples:
101101
| NHSNumber | vaccine_type | DateFrom | DateTo | include |
102-
| 9728403348 | COVID | 999-06-01 | 999-06-01 | abc |
103-
| 9728403348 | COVID | 2025-13-01 | 2025-12-01 | abc |
104-
| 9728403348 | COVID | 2025-05-12 | 2025-05-12 | abc |
105-
| 9728403348 | COVID | 999-06-01 | 999-06-01 | Immunization:patient |
102+
| 9461267665 | COVID | 999-06-01 | 999-06-01 | abc |
103+
| 9461267665 | COVID | 2025-13-01 | 2025-12-01 | abc |
104+
| 9461267665 | COVID | 2025-05-12 | 2025-05-12 | abc |
105+
| 9461267665 | COVID | 999-06-01 | 999-06-01 | Immunization:patient |
106106

107107
@smoke
108108
@supplier_name_Postman_Auth
@@ -318,7 +318,7 @@ Feature: Search the immunization of a patient
318318
@smoke
319319
@Delete_cleanUp @supplier_name_TPP
320320
Scenario: Verify that immunization events retrieved by target-disease search are within Date From and Date To range
321-
Given Valid vaccination record is created for '9728403348' and Disease Type 'SHINGLES' with recorded date as '2023-01-15'
321+
Given Valid vaccination record is created for '9727805493' and Disease Type 'SHINGLES' with recorded date as '2023-01-15'
322322
When Send a search request with GET method using target-disease and Date From and Date To for Immunization event created
323323
Then The request will be successful with the status code '200'
324324
And The occurrenceDateTime of the immunization events should be within the Date From and Date To range

0 commit comments

Comments
 (0)