Skip to content

Commit 722f18c

Browse files
committed
release/2024-11-27 Move failure scenario
1 parent 0e3f84b commit 722f18c

File tree

2 files changed

+60
-67
lines changed

2 files changed

+60
-67
lines changed

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,63 @@ Feature: Create MHS Device - failure scenarios
314314
| name | value |
315315
| Content-Type | application/json |
316316
| Content-Length | 113 |
317+
318+
Scenario: Cannot create a MHS Device with a Product that already has an MHS Device with no questionnaire responses
319+
Given I have already made a "POST" request with "default" headers to "ProductTeam" with body:
320+
| path | value |
321+
| name | My Great Product Team |
322+
| ods_code | F5H1R |
323+
And I note the response field "$.id" as "product_team_id"
324+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/Epr" with body:
325+
| path | value |
326+
| name | My Great Product |
327+
And I note the response field "$.id" as "product_id"
328+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/MhsMessageSet"
329+
And I note the response field "$.id" as "message_set_drd_id"
330+
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:
331+
| path | value |
332+
| questionnaire_responses.spine_mhs.0.Address | http://example.com |
333+
| questionnaire_responses.spine_mhs.0.Unique Identifier | 123456 |
334+
| questionnaire_responses.spine_mhs.0.Managing Organization | Example Org |
335+
| questionnaire_responses.spine_mhs.0.MHS Manufacturer Organisation | AAA |
336+
| questionnaire_responses.spine_mhs.0.MHS Party key | party-key-001 |
337+
| questionnaire_responses.spine_mhs.0.MHS CPA ID | cpa-id-001 |
338+
| questionnaire_responses.spine_mhs.0.Approver URP | approver-123 |
339+
| questionnaire_responses.spine_mhs.0.Contract Property Template Key | contract-key-001 |
340+
| questionnaire_responses.spine_mhs.0.Date Approved | 2024-01-01 |
341+
| questionnaire_responses.spine_mhs.0.Date DNS Approved | 2024-01-02 |
342+
| questionnaire_responses.spine_mhs.0.Date Requested | 2024-01-03 |
343+
| questionnaire_responses.spine_mhs.0.DNS Approver | dns-approver-456 |
344+
| questionnaire_responses.spine_mhs.0.Interaction Type | FHIR |
345+
| questionnaire_responses.spine_mhs.0.MHS FQDN | mhs.example.com |
346+
| questionnaire_responses.spine_mhs.0.MHS Is Authenticated | PERSISTENT |
347+
| questionnaire_responses.spine_mhs.0.Product Key | product-key-001 |
348+
| questionnaire_responses.spine_mhs.0.Requestor URP | requestor-789 |
349+
And I note the response field "$.id" as "device_id"
350+
When I make a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/MessageHandlingSystem" with body:
351+
| path | value |
352+
| questionnaire_responses.spine_mhs.0.Address | http://example.com |
353+
| questionnaire_responses.spine_mhs.0.Unique Identifier | 123457 |
354+
| questionnaire_responses.spine_mhs.0.Managing Organization | Example Org |
355+
| questionnaire_responses.spine_mhs.0.MHS Manufacturer Organisation | AAA |
356+
| questionnaire_responses.spine_mhs.0.MHS Party key | party-key-003 |
357+
| questionnaire_responses.spine_mhs.0.MHS CPA ID | cpa-id-001 |
358+
| questionnaire_responses.spine_mhs.0.Approver URP | approver-123 |
359+
| questionnaire_responses.spine_mhs.0.Contract Property Template Key | contract-key-001 |
360+
| questionnaire_responses.spine_mhs.0.Date Approved | 2024-01-01 |
361+
| questionnaire_responses.spine_mhs.0.Date DNS Approved | 2024-01-02 |
362+
| questionnaire_responses.spine_mhs.0.Date Requested | 2024-01-03 |
363+
| questionnaire_responses.spine_mhs.0.DNS Approver | dns-approver-456 |
364+
| questionnaire_responses.spine_mhs.0.Interaction Type | FHIR |
365+
| questionnaire_responses.spine_mhs.0.MHS FQDN | mhs.example.com |
366+
| questionnaire_responses.spine_mhs.0.MHS Is Authenticated | PERSISTENT |
367+
| questionnaire_responses.spine_mhs.0.Product Key | product-key-001 |
368+
| questionnaire_responses.spine_mhs.0.Requestor URP | requestor-789 |
369+
Then I receive a status code "400" with body
370+
| path | value |
371+
| errors.0.code | VALIDATION_ERROR |
372+
| errors.0.message | There is already an existing MHS Device for this Product |
373+
And the response headers contain:
374+
| name | value |
375+
| Content-Type | application/json |
376+
| Content-Length | 113 |

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

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -225,70 +225,3 @@ Feature: Create MHS Device - success scenarios
225225
| ${ note(product_team_id) } | ${ note(party_key) } |
226226
| FOOBAR | ${ note(product_id) } |
227227
| 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)