-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcreate.feature
More file actions
320 lines (293 loc) · 19.5 KB
/
create.feature
File metadata and controls
320 lines (293 loc) · 19.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
@Create_Feature @functional
Feature: Create the immunization event for a patient
@Delete_cleanUp
Scenario Outline: Verify that the POST Create API for different vaccine types
Given Valid token is generated for the '<Supplier>'
And Valid json payload is created with Patient '<Patient>' and vaccine_type '<vaccine_type>'
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
And The imms event table will be populated with the correct data for 'created' event
And The delta table will be populated with the correct data for created event
And MNS event will be triggered with correct data for created event
Examples:
| Patient | vaccine_type | Supplier |
| Random | COVID | Postman_Auth |
| Random | RSV | RAVS |
| Random | FLU | MAVIS |
| Random | MMR | Postman_Auth |
| Random | MENACWY | TPP |
| Random | 3IN1 | TPP |
| Random | MMRV | EMIS |
| Random | PERTUSSIS | EMIS |
| Random | SHINGLES | EMIS |
| Random | PNEUMOCOCCAL | EMIS |
| Random | 4IN1 | TPP |
| Random | 6IN1 | EMIS |
| Random | HIB | TPP |
| Mod11_NHS | MENB | TPP |
| Invalid_NHS | ROTAVIRUS | MEDICUS |
| Random | HEPB | EMIS |
| Random | BCG | MEDICUS |
@Delete_cleanUp
Scenario Outline: Verify that the POST Create API request with minimal dataset for different vaccine types
Given Valid token is generated for the '<Supplier>'
And Valid json payload is created with Patient '<Patient>' and vaccine_type '<vaccine_type>' with minimal dataset
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
And The imms event table will be populated with the correct data for 'created' event
And The delta table will be populated with the correct data for created event
And MNS event will be triggered with correct data for created event
Examples:
| Patient | vaccine_type | Supplier |
| Random | COVID | Postman_Auth |
| Random | RSV | RAVS |
| Random | FLU | MAVIS |
| Random | MMR | Postman_Auth |
| Random | MENACWY | TPP |
| Random | 3IN1 | TPP |
| Random | MMRV | EMIS |
| Random | PERTUSSIS | EMIS |
| Random | SHINGLES | EMIS |
| Random | PNEUMOCOCCAL | EMIS |
| Random | 4IN1 | TPP |
| Random | 6IN1 | EMIS |
| Random | HIB | TPP |
| Random | MENB | TPP |
| Random | ROTAVIRUS | MEDICUS |
| Random | HEPB | EMIS |
| Random | BCG | MEDICUS |
@Delete_cleanUp @vaccine_type_6IN1 @patient_id_Random @supplier_name_EMIS
Scenario: Verify that VACCINATION_PROCEDURE_TERM, VACCINE_PRODUCT_TERM, SITE_OF_VACCINATION_TERM, ROUTE_OF_VACCINATION_TERM fields are mapped to respective text fields in imms delta table
Given Valid json payload is created where vaccination terms has text field populated
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The terms are mapped to the respective text fields in imms delta table
And MNS event will be triggered with correct data for created event
@Delete_cleanUp @vaccine_type_BCG @patient_id_InvalidInPDS @supplier_name_EMIS
Scenario: Verify that VACCINATION_PROCEDURE_TERM, VACCINE_PRODUCT_TERM , SITE_OF_VACCINATION_TERM, ROUTE_OF_VACCINATION_TERM fields are mapped to first instance of coding.display fields in imms delta table
Given Valid json payload is created where vaccination terms has multiple instances of coding
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The terms are mapped to first instance of coding.display fields in imms delta table
And MNS event will be triggered with correct data for created event
@Delete_cleanUp @vaccine_type_HEPB @patient_id_NullNHS @supplier_name_MEDICUS
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
Given Valid json payload is created where vaccination terms has multiple instance of coding with different coding system
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The terms are mapped to correct instance of coding.display fields in imms delta table
And MNS event will not be triggered for the event
@smoke
@Delete_cleanUp @vaccine_type_PERTUSSIS @patient_id_Random @supplier_name_EMIS
Scenario: Verify that VACCINATION_PROCEDURE_TERM, VACCINE_PRODUCT_TERM, SITE_OF_VACCINATION_TERM, ROUTE_OF_VACCINATION_TERM fields are mapped to coding.display in imms delta table in case of only one instance of coding
Given Valid json payload is created where vaccination terms has one instance of coding with no text or value string field
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The terms are mapped to correct coding.display fields in imms delta table
And MNS event will be triggered with correct data for created event
@smoke
@Delete_cleanUp @vaccine_type_HIB @patient_id_NO_GP_NHS @supplier_name_TPP
Scenario: Verify that VACCINATION_PROCEDURE_TERM, VACCINE_PRODUCT_TERM, SITE_OF_VACCINATION_TERM, ROUTE_OF_VACCINATION_TERM fields are blank in imms delta table if no text or value string or display field is present
Given Valid json payload is created where vaccination terms has no text or value string or display field
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The terms are blank in imms delta table
And MNS event will be triggered with correct data for created event
@smoke
Scenario Outline: Verify that the POST Create API for different supplier fails on access denied
Given Valid token is generated for the '<Supplier>'
And Valid json payload is created with Patient '<Patient>' and vaccine_type '<vaccine_type>'
When Trigger the post create request
Then The request will be unsuccessful with the status code '403'
And The Response JSONs should contain correct error message for 'unauthorized_access' access
Examples:
| Patient | vaccine_type | Supplier |
| Random | COVID | MAVIS |
| Random | RSV | MAVIS |
| Random | RSV | SONAR |
@Delete_cleanUp @supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Mod11_NHS
Scenario: Verify that the POST Create API for invalid but Mod11 compliant NHS Number
Given Valid json payload is created
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
And The imms event table will be populated with the correct data for 'created' event
And The delta table will be populated with the correct data for created event
And MNS event will be triggered with correct data for created event
@smoke
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario Outline: Verify that the POST Create API will fail if doseNumberPositiveInt is not valid
Given Valid json payload is created where doseNumberPositiveInt is '<doseNumberPositiveInt>'
When Trigger the post create request
Then The request will be unsuccessful with the status code '400'
And The Response JSONs should contain correct error message for '<error_type>'
And MNS event will not be triggered for the event
Examples:
| doseNumberPositiveInt | error_type |
| -1 | doseNumberPositiveInt_PositiveInteger |
| 0 | doseNumberPositiveInt_PositiveInteger |
| 10 | doseNumberPositiveInt_ValidRange |
@smoke
@Delete_cleanUp @supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario: Verify that the POST Create API will be successful if all date field has valid past date
Given Valid json payload is created where date fields has past date
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And MNS event will be triggered with correct data for created event
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario Outline: Verify that the POST Create API will fail if occurrenceDateTime has future or invalid formatted date
Given Valid json payload is created where occurrenceDateTime has invalid '<Date>' date
When Trigger the post create request
Then The request will be unsuccessful with the status code '400'
And The Response JSONs should contain correct error message for '<error_type>'
Examples:
| Date | error_type |
| future_occurrence | invalid_OccurrenceDateTime |
| invalid_format | invalid_OccurrenceDateTime |
| nonexistent | invalid_OccurrenceDateTime |
| empty | invalid_OccurrenceDateTime |
| none | empty_OccurrenceDateTime |
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario Outline: Verify that the POST Create API will fail if recorded has future or invalid formatted date
Given Valid json payload is created where recorded has invalid '<Date>' date
When Trigger the post create request
Then The request will be unsuccessful with the status code '400'
And The Response JSONs should contain correct error message for '<error_type>'
Examples:
| Date | error_type |
| future_date | invalid_recorded |
| invalid_format | invalid_recorded |
| nonexistent | invalid_recorded |
| empty | invalid_recorded |
| none | empty_recorded |
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario Outline: Verify that the POST Create API will fail if patient's data of birth has future or invalid formatted date
Given Valid json payload is created where date of birth has invalid '<Date>' date
When Trigger the post create request
Then The request will be unsuccessful with the status code '400'
And The Response JSONs should contain correct error message for '<error_type>'
Examples:
| Date | error_type |
| future_date | future_DateOfBirth |
| invalid_format | invalid_DateOfBirth |
| nonexistent | invalid_DateOfBirth |
| empty | invalid_DateOfBirth |
| none | missing_DateOfBirth |
@smoke
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario Outline: Verify that the POST Create API will fail if expiration date has invalid formatted date
Given Valid json payload is created where expiration date has invalid '<Date>' date
When Trigger the post create request
Then The request will be unsuccessful with the status code '400'
And The Response JSONs should contain correct error message for 'invalid_expirationDate'
Examples:
| Date |
| invalid_format |
| nonexistent |
| empty |
@smoke
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario Outline: Verify that the POST Create API will fail if nhs number is invalid
Given Valid json payload is created where Nhs number is invalid '<invalid_NhsNumber>'
When Trigger the post create request
Then The request will be unsuccessful with the status code '400'
And The Response JSONs should contain correct error message for '<error_type>'
Examples:
| invalid_NhsNumber | error_type |
| 1234567890 | invalid_mod11_nhsnumber |
| 12345678 | invalid_nhsnumber_length |
@smoke
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario Outline: Verify that the POST Create API will fail if patient forename is invalid
Given Valid json payload is created where patient forename is '<forename>'
When Trigger the post create request
Then The request will be unsuccessful with the status code '400'
And The Response JSONs should contain correct error message for '<error_type>'
Examples:
| forename | error_type |
| empty | empty_forename |
| missing | no_forename |
| white_space_array | empty_forename |
| single_value_max_len | max_len_forename |
| max_len_array | max_item_forename |
@smoke
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario Outline: Verify that the POST Create API will fail if patient surname is invalid
Given Valid json payload is created where patient surname is '<surname>'
When Trigger the post create request
Then The request will be unsuccessful with the status code '400'
And The Response JSONs should contain correct error message for '<error_type>'
Examples:
| surname | error_type |
| empty | empty_surname |
| missing | no_surname |
| white_space | empty_surname |
| name_length_36 | max_len_surname |
@smoke
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario: Verify that the POST Create API will fail if patient name is empty
Given Valid json payload is created where patient name is empty
When Trigger the post create request
Then The request will be unsuccessful with the status code '400'
And The Response JSONs should contain correct error message for 'empty_forename_surname'
@supplier_name_Postman_Auth @vaccine_type_RSV @patient_id_Random
Scenario Outline: Verify that the POST Create API will fail if patient gender is invalid
Given Valid json payload is created where patient gender is '<gender>'
When Trigger the post create request
Then The request will be unsuccessful with the status code '400'
And The Response JSONs should contain correct error message for '<error_type>'
Examples:
| gender | error_type |
| random_text | invalid_gender |
| empty | empty_gender |
| number | should_be_string |
| gender_code | invalid_gender |
| missing | missing_gender |
@smoke
@Delete_cleanUp @supplier_name_TPP @vaccine_type_BCG @patient_id_Random
Scenario: Verify that the POST Create API will fail when exiting Unique Id and no_unique_id_uri is used in the request
Given Valid json payload is created
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
And The imms event table will be populated with the correct data for 'created' event
And The delta table will be populated with the correct data for created event
And MNS event will be triggered with correct data for created event
When Trigger another post create request with same unique_id and unique_id_uri
Then The request will be unsuccessful with the status code '422'
And The Response JSONs should contain correct error message for 'duplicate'
And MNS event will not be triggered for the event
@smoke
@Delete_cleanUp @supplier_name_TPP @vaccine_type_BCG @patient_id_Random
Scenario: Verify that the POST Create API will create MNS event when patient is less then 1 year old
Given Valid json payload is created where patient age is less then an year
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
And The imms event table will be populated with the correct data for 'created' event
And The delta table will be populated with the correct data for created event
And MNS event will be triggered with correct data for created event
@smoke
@Delete_cleanUp @supplier_name_TPP @vaccine_type_BCG @patient_id_Random
Scenario: Verify that the POST Create API will create MNS event when patient DOB is in future
Given Valid json payload is created where patient date is greater then vaccination occurrence date
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The X-Request-ID and X-Correlation-ID keys in header will populate correctly
And The imms event table will be populated with the correct data for 'created' event
And The delta table will be populated with the correct data for created event
And MNS event will be triggered with correct data for created event