Skip to content

Commit 0e3f84b

Browse files
committed
release/2024-11-27 Update createDeviceMHS feature test with more success scenarios
1 parent 2e72455 commit 0e3f84b

File tree

1 file changed

+170
-0
lines changed

1 file changed

+170
-0
lines changed

src/api/tests/feature_tests/features/createDeviceMessageHandlingSystem.success.feature

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,173 @@ Feature: Create MHS Device - success scenarios
122122
| ${ note(product_team_id) } | ${ note(party_key) } |
123123
| FOOBAR | ${ note(product_id) } |
124124
| FOOBAR | ${ note(party_key) } |
125+
126+
Scenario Outline: Successfully create a MHS Device with MHSMessageSet containing no questionnaire responses
127+
Given I have already made a "POST" request with "default" headers to "ProductTeam" with body:
128+
| path | value |
129+
| name | My Great Product Team |
130+
| ods_code | F5H1R |
131+
| keys.0.key_type | product_team_id_alias |
132+
| keys.0.key_value | FOOBAR |
133+
And I note the response field "$.id" as "product_team_id"
134+
And I have already made a "POST" request with "default" headers to "ProductTeam/<product_team_id>/Product/Epr" with body:
135+
| path | value |
136+
| name | My Great Product |
137+
And I note the response field "$.id" as "product_id"
138+
And I note the response field "$.keys.0.key_type" as "party_key_tag"
139+
And I note the response field "$.keys.0.key_value" as "party_key_tag_value"
140+
When I make a "POST" request with "default" headers to "ProductTeam/<product_team_id>/Product/${ note(product_id) }/DeviceReferenceData/MhsMessageSet"
141+
And I note the response field "$.id" as "device_reference_data_id"
142+
When I make a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/MessageHandlingSystem" with body:
143+
| path | value |
144+
| questionnaire_responses.spine_mhs.0.Address | http://example.com |
145+
| questionnaire_responses.spine_mhs.0.Unique Identifier | 123456 |
146+
| questionnaire_responses.spine_mhs.0.Managing Organization | Example Org |
147+
| questionnaire_responses.spine_mhs.0.MHS Manufacturer Organisation | AAA |
148+
| questionnaire_responses.spine_mhs.0.MHS Party key | party-key-001 |
149+
| questionnaire_responses.spine_mhs.0.MHS CPA ID | cpa-id-001 |
150+
| questionnaire_responses.spine_mhs.0.Approver URP | approver-123 |
151+
| questionnaire_responses.spine_mhs.0.Contract Property Template Key | contract-key-001 |
152+
| questionnaire_responses.spine_mhs.0.Date Approved | 2024-01-01 |
153+
| questionnaire_responses.spine_mhs.0.Date DNS Approved | 2024-01-02 |
154+
| questionnaire_responses.spine_mhs.0.Date Requested | 2024-01-03 |
155+
| questionnaire_responses.spine_mhs.0.DNS Approver | dns-approver-456 |
156+
| questionnaire_responses.spine_mhs.0.Interaction Type | FHIR |
157+
| questionnaire_responses.spine_mhs.0.MHS FQDN | mhs.example.com |
158+
| questionnaire_responses.spine_mhs.0.MHS Is Authenticated | PERSISTENT |
159+
| questionnaire_responses.spine_mhs.0.Product Key | product-key-001 |
160+
| questionnaire_responses.spine_mhs.0.Requestor URP | requestor-789 |
161+
Then I receive a status code "201" with body
162+
| path | value |
163+
| id | << ignore >> |
164+
| name | F5H1R-850000 - Message Handling System |
165+
| status | active |
166+
| product_id | ${ note(product_id) } |
167+
| product_team_id | ${ note(product_team_id) } |
168+
| ods_code | F5H1R |
169+
| created_on | << ignore >> |
170+
| updated_on | << ignore >> |
171+
| deleted_on | << ignore >> |
172+
| keys | [] |
173+
| questionnaire_responses | << ignore >> |
174+
| device_reference_data | << ignore >> |
175+
And the response headers contain:
176+
| name | value |
177+
| Content-Type | application/json |
178+
| Content-Length | 1245 |
179+
And I note the response field "$.id" as "device_id"
180+
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/${ note(device_id) }"
181+
Then I receive a status code "200" with body
182+
| path | value |
183+
| id | ${ note(device_id) } |
184+
| name | F5H1R-850000 - Message Handling System |
185+
| status | active |
186+
| product_id | ${ note(product_id) } |
187+
| product_team_id | ${ note(product_team_id) } |
188+
| ods_code | F5H1R |
189+
| created_on | << ignore >> |
190+
| updated_on | << ignore >> |
191+
| deleted_on | << ignore >> |
192+
| keys | [] |
193+
| tags.0.0.0 | ${ note(party_key_tag) } |
194+
| tags.0.0.1 | ${ note(party_key_tag_value) } |
195+
| questionnaire_responses.spine_mhs/1.0.id | << ignore >> |
196+
| questionnaire_responses.spine_mhs/1.0.questionnaire_name | spine_mhs |
197+
| questionnaire_responses.spine_mhs/1.0.questionnaire_version | 1 |
198+
| questionnaire_responses.spine_mhs/1.0.created_on | << ignore >> |
199+
| questionnaire_responses.spine_mhs/1.0.data.Address | http://example.com |
200+
| questionnaire_responses.spine_mhs/1.0.data.Unique Identifier | 123456 |
201+
| questionnaire_responses.spine_mhs/1.0.data.Managing Organization | Example Org |
202+
| questionnaire_responses.spine_mhs/1.0.data.MHS Party key | party-key-001 |
203+
| questionnaire_responses.spine_mhs/1.0.data.MHS CPA ID | cpa-id-001 |
204+
| questionnaire_responses.spine_mhs/1.0.data.Approver URP | approver-123 |
205+
| questionnaire_responses.spine_mhs/1.0.data.Contract Property Template Key | contract-key-001 |
206+
| questionnaire_responses.spine_mhs/1.0.data.Date Approved | 2024-01-01 |
207+
| questionnaire_responses.spine_mhs/1.0.data.Date DNS Approved | 2024-01-02 |
208+
| questionnaire_responses.spine_mhs/1.0.data.Date Requested | 2024-01-03 |
209+
| questionnaire_responses.spine_mhs/1.0.data.DNS Approver | dns-approver-456 |
210+
| questionnaire_responses.spine_mhs/1.0.data.Interaction Type | FHIR |
211+
| questionnaire_responses.spine_mhs/1.0.data.MHS FQDN | mhs.example.com |
212+
| questionnaire_responses.spine_mhs/1.0.data.MHS Is Authenticated | PERSISTENT |
213+
| questionnaire_responses.spine_mhs/1.0.data.Product Key | product-key-001 |
214+
| questionnaire_responses.spine_mhs/1.0.data.Requestor URP | requestor-789 |
215+
| questionnaire_responses.spine_mhs/1.0.data.MHS Manufacturer Organisation | AAA |
216+
| device_reference_data | << ignore >> |
217+
And the response headers contain:
218+
| name | value |
219+
| Content-Type | application/json |
220+
| Content-Length | 1288 |
221+
222+
Examples:
223+
| product_team_id | product_id |
224+
| ${ note(product_team_id) } | ${ note(product_id) } |
225+
| ${ note(product_team_id) } | ${ note(party_key) } |
226+
| FOOBAR | ${ note(product_id) } |
227+
| FOOBAR | ${ note(party_key) } |
228+
229+
Scenario Outline: Cannot create a MHS Device with a Product that already has an MHS Device with no questionnaire responses
230+
Given I have already made a "POST" request with "default" headers to "ProductTeam" with body:
231+
| path | value |
232+
| name | My Great Product Team |
233+
| ods_code | F5H1R |
234+
And I note the response field "$.id" as "product_team_id"
235+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/Epr" with body:
236+
| path | value |
237+
| name | My Great Product |
238+
And I note the response field "$.id" as "product_id"
239+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/MhsMessageSet"
240+
And I note the response field "$.id" as "message_set_drd_id"
241+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/MessageHandlingSystem" with body:
242+
| path | value |
243+
| questionnaire_responses.spine_mhs.0.Address | http://example.com |
244+
| questionnaire_responses.spine_mhs.0.Unique Identifier | 123456 |
245+
| questionnaire_responses.spine_mhs.0.Managing Organization | Example Org |
246+
| questionnaire_responses.spine_mhs.0.MHS Manufacturer Organisation | AAA |
247+
| questionnaire_responses.spine_mhs.0.MHS Party key | party-key-001 |
248+
| questionnaire_responses.spine_mhs.0.MHS CPA ID | cpa-id-001 |
249+
| questionnaire_responses.spine_mhs.0.Approver URP | approver-123 |
250+
| questionnaire_responses.spine_mhs.0.Contract Property Template Key | contract-key-001 |
251+
| questionnaire_responses.spine_mhs.0.Date Approved | 2024-01-01 |
252+
| questionnaire_responses.spine_mhs.0.Date DNS Approved | 2024-01-02 |
253+
| questionnaire_responses.spine_mhs.0.Date Requested | 2024-01-03 |
254+
| questionnaire_responses.spine_mhs.0.DNS Approver | dns-approver-456 |
255+
| questionnaire_responses.spine_mhs.0.Interaction Type | FHIR |
256+
| questionnaire_responses.spine_mhs.0.MHS FQDN | mhs.example.com |
257+
| questionnaire_responses.spine_mhs.0.MHS Is Authenticated | PERSISTENT |
258+
| questionnaire_responses.spine_mhs.0.Product Key | product-key-001 |
259+
| questionnaire_responses.spine_mhs.0.Requestor URP | requestor-789 |
260+
And I note the response field "$.id" as "device_id"
261+
When I make a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/MessageHandlingSystem" with body:
262+
| path | value |
263+
| questionnaire_responses.spine_mhs.0.Address | http://example.com |
264+
| questionnaire_responses.spine_mhs.0.Unique Identifier | 123457 |
265+
| questionnaire_responses.spine_mhs.0.Managing Organization | Example Org |
266+
| questionnaire_responses.spine_mhs.0.MHS Manufacturer Organisation | AAA |
267+
| questionnaire_responses.spine_mhs.0.MHS Party key | party-key-003 |
268+
| questionnaire_responses.spine_mhs.0.MHS CPA ID | cpa-id-001 |
269+
| questionnaire_responses.spine_mhs.0.Approver URP | approver-123 |
270+
| questionnaire_responses.spine_mhs.0.Contract Property Template Key | contract-key-001 |
271+
| questionnaire_responses.spine_mhs.0.Date Approved | 2024-01-01 |
272+
| questionnaire_responses.spine_mhs.0.Date DNS Approved | 2024-01-02 |
273+
| questionnaire_responses.spine_mhs.0.Date Requested | 2024-01-03 |
274+
| questionnaire_responses.spine_mhs.0.DNS Approver | dns-approver-456 |
275+
| questionnaire_responses.spine_mhs.0.Interaction Type | FHIR |
276+
| questionnaire_responses.spine_mhs.0.MHS FQDN | mhs.example.com |
277+
| questionnaire_responses.spine_mhs.0.MHS Is Authenticated | PERSISTENT |
278+
| questionnaire_responses.spine_mhs.0.Product Key | product-key-001 |
279+
| questionnaire_responses.spine_mhs.0.Requestor URP | requestor-789 |
280+
Then I receive a status code "400" with body
281+
| path | value |
282+
| errors.0.code | VALIDATION_ERROR |
283+
| errors.0.message | There is already an existing MHS Device for this Product |
284+
And the response headers contain:
285+
| name | value |
286+
| Content-Type | application/json |
287+
| Content-Length | 113 |
288+
289+
Examples:
290+
| product_team_id | product_id |
291+
| ${ note(product_team_id) } | ${ note(product_id) } |
292+
| ${ note(product_team_id) } | ${ note(party_key) } |
293+
| FOOBAR | ${ note(product_id) } |
294+
| FOOBAR | ${ note(party_key) } |

0 commit comments

Comments
 (0)