Skip to content

Commit b66fdbc

Browse files
committed
Add extra success feature tests
1 parent a039833 commit b66fdbc

File tree

1 file changed

+190
-0
lines changed

1 file changed

+190
-0
lines changed

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

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,193 @@ Feature: Create AS Device - success scenarios
111111
| name | value |
112112
| Content-Type | application/json |
113113
| Content-Length | 1720 |
114+
115+
Scenario: Successfully create a AS Device with MHSMessageSet and ASAdditionalInteractions containing no questionnaire responses
116+
Given I have already made a "POST" request with "default" headers to "ProductTeam" with body:
117+
| path | value |
118+
| name | My Great Product Team |
119+
| ods_code | F5H1R |
120+
And I note the response field "$.id" as "product_team_id"
121+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/Epr" with body:
122+
| path | value |
123+
| name | My Great Product |
124+
And I note the response field "$.id" as "product_id"
125+
And I note the response field "$.keys.0.key_type" as "party_key_tag"
126+
And I note the response field "$.keys.0.key_value" as "party_key_tag_value"
127+
When I make a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/MhsMessageSet"
128+
And I note the response field "$.id" as "mhs_message_set_drd_id"
129+
When I make a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/AccreditedSystemsAdditionalInteractions"
130+
And I note the response field "$.id" as "as_message_set_drd_id"
131+
When I make a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/AccreditedSystem" with body:
132+
| path | value |
133+
| questionnaire_responses.spine_as.0.ODS Code | FH15R |
134+
| questionnaire_responses.spine_as.0.Client ODS Codes.0 | FH15R |
135+
| questionnaire_responses.spine_as.0.ASID | Foobar |
136+
| questionnaire_responses.spine_as.0.Party Key | party-key-001 |
137+
| questionnaire_responses.spine_as.0.Approver URP | approver-123 |
138+
| questionnaire_responses.spine_as.0.Date Approved | 2024-01-01 |
139+
| questionnaire_responses.spine_as.0.Requestor URP | requestor-789 |
140+
| questionnaire_responses.spine_as.0.Date Requested | 2024-01-03 |
141+
| questionnaire_responses.spine_as.0.Product Key | product-key-001 |
142+
Then I receive a status code "201" with body
143+
| path | value |
144+
| id | << ignore >> |
145+
| name | F5H1R-850000/ - Accredited System |
146+
| status | active |
147+
| product_id | ${ note(product_id) } |
148+
| product_team_id | ${ note(product_team_id) } |
149+
| ods_code | F5H1R |
150+
| keys | [] |
151+
| created_on | << ignore >> |
152+
| updated_on | << ignore >> |
153+
| deleted_on | << ignore >> |
154+
| questionnaire_responses.spine_as/1.0.id | << ignore >> |
155+
| questionnaire_responses.spine_as/1.0.questionnaire_name | spine_as |
156+
| questionnaire_responses.spine_as/1.0.questionnaire_version | 1 |
157+
| questionnaire_responses.spine_as/1.0.data.ODS Code | FH15R |
158+
| questionnaire_responses.spine_as/1.0.data.Client ODS Codes.0 | FH15R |
159+
| questionnaire_responses.spine_as/1.0.data.ASID | Foobar |
160+
| questionnaire_responses.spine_as/1.0.data.Party Key | party-key-001 |
161+
| questionnaire_responses.spine_as/1.0.data.Approver URP | approver-123 |
162+
| questionnaire_responses.spine_as/1.0.data.Date Approved | 2024-01-01 |
163+
| questionnaire_responses.spine_as/1.0.data.Requestor URP | requestor-789 |
164+
| questionnaire_responses.spine_as/1.0.data.Date Requested | 2024-01-03 |
165+
| questionnaire_responses.spine_as/1.0.data.Product Key | product-key-001 |
166+
| questionnaire_responses.spine_as/1.0.created_on | << ignore >> |
167+
| device_reference_data | << ignore >> |
168+
And the response headers contain:
169+
| name | value |
170+
| Content-Type | application/json |
171+
| Content-Length | 987 |
172+
And I note the response field "$.id" as "device_id"
173+
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/${ note(device_id) }"
174+
Then I receive a status code "200" with body
175+
| path | value |
176+
| id | ${ note(device_id) } |
177+
| name | F5H1R-850000/ - Accredited System |
178+
| status | active |
179+
| product_id | ${ note(product_id) } |
180+
| product_team_id | ${ note(product_team_id) } |
181+
| ods_code | F5H1R |
182+
| created_on | << ignore >> |
183+
| updated_on | << ignore >> |
184+
| deleted_on | << ignore >> |
185+
| keys | [] |
186+
| tags.0.0.0 | ${ note(party_key_tag) } |
187+
| tags.0.0.1 | ${ note(party_key_tag_value) } |
188+
| questionnaire_responses | << ignore >> |
189+
| device_reference_data | << ignore >> |
190+
And the response headers contain:
191+
| name | value |
192+
| Content-Type | application/json |
193+
| Content-Length | 1030 |
194+
195+
Scenario: Successfully create multiple AS Devices
196+
Given I have already made a "POST" request with "default" headers to "ProductTeam" with body:
197+
| path | value |
198+
| name | My Great Product Team |
199+
| ods_code | F5H1R |
200+
| keys.0.key_type | product_team_id_alias |
201+
| keys.0.key_value | FOOBAR |
202+
And I note the response field "$.id" as "product_team_id"
203+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/Epr" with body:
204+
| path | value |
205+
| name | My Great Product |
206+
And I note the response field "$.id" as "product_id"
207+
And I note the response field "$.keys.0.key_type" as "party_key_tag"
208+
And I note the response field "$.keys.0.key_value" as "party_key_tag_value"
209+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/MhsMessageSet" with body:
210+
| path | value |
211+
| questionnaire_responses.spine_mhs_message_sets.0.Interaction ID | urn:nhs:names:services:ers:READ_PRACTITIONER_ROLE_R4_V001 |
212+
| questionnaire_responses.spine_mhs_message_sets.0.MHS SN | urn:nhs:names:services:ers |
213+
| questionnaire_responses.spine_mhs_message_sets.0.MHS IN | READ_PRACTITIONER_ROLE_R4_V001 |
214+
And I note the response field "$.id" as "mhs_message_set_drd_id"
215+
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:
216+
| path | value |
217+
| questionnaire_responses.spine_mhs.0.Address | http://example.com |
218+
| questionnaire_responses.spine_mhs.0.Unique Identifier | 123456 |
219+
| questionnaire_responses.spine_mhs.0.Managing Organization | Example Org |
220+
| questionnaire_responses.spine_mhs.0.MHS Manufacturer Organisation | AAA |
221+
| questionnaire_responses.spine_mhs.0.MHS Party key | party-key-001 |
222+
| questionnaire_responses.spine_mhs.0.MHS CPA ID | cpa-id-001 |
223+
| questionnaire_responses.spine_mhs.0.Approver URP | approver-123 |
224+
| questionnaire_responses.spine_mhs.0.Contract Property Template Key | contract-key-001 |
225+
| questionnaire_responses.spine_mhs.0.Date Approved | 2024-01-01 |
226+
| questionnaire_responses.spine_mhs.0.Date DNS Approved | 2024-01-02 |
227+
| questionnaire_responses.spine_mhs.0.Date Requested | 2024-01-03 |
228+
| questionnaire_responses.spine_mhs.0.DNS Approver | dns-approver-456 |
229+
| questionnaire_responses.spine_mhs.0.Interaction Type | FHIR |
230+
| questionnaire_responses.spine_mhs.0.MHS FQDN | mhs.example.com |
231+
| questionnaire_responses.spine_mhs.0.MHS Is Authenticated | PERSISTENT |
232+
| questionnaire_responses.spine_mhs.0.Product Key | product-key-001 |
233+
| questionnaire_responses.spine_mhs.0.Requestor URP | requestor-789 |
234+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/AccreditedSystemsAdditionalInteractions" with body:
235+
| path | value |
236+
| questionnaire_responses.spine_as_additional_interactions.0.Interaction ID | urn:nhs:names:services:ers:READ_PRACTITIONER_ROLE_R4_V002 |
237+
And I note the response field "$.id" as "as_message_set_drd_id"
238+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/AccreditedSystem" with body:
239+
| path | value |
240+
| questionnaire_responses.spine_as.0.ODS Code | FH15R |
241+
| questionnaire_responses.spine_as.0.Client ODS Codes.0 | FH15R |
242+
| questionnaire_responses.spine_as.0.ASID | Foobar |
243+
| questionnaire_responses.spine_as.0.Party Key | party-key-001 |
244+
| questionnaire_responses.spine_as.0.Approver URP | approver-123 |
245+
| questionnaire_responses.spine_as.0.Date Approved | 2024-01-01 |
246+
| questionnaire_responses.spine_as.0.Requestor URP | requestor-789 |
247+
| questionnaire_responses.spine_as.0.Date Requested | 2024-01-03 |
248+
| questionnaire_responses.spine_as.0.Product Key | product-key-001 |
249+
And I note the response field "$.id" as "device_id"
250+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/AccreditedSystem" with body:
251+
| path | value |
252+
| questionnaire_responses.spine_as.0.ODS Code | F5H1R |
253+
| questionnaire_responses.spine_as.0.Client ODS Codes.0 | F5H1R |
254+
| questionnaire_responses.spine_as.0.ASID | Foobar |
255+
| questionnaire_responses.spine_as.0.Party Key | party-key-001 |
256+
| questionnaire_responses.spine_as.0.Approver URP | approver-123 |
257+
| questionnaire_responses.spine_as.0.Date Approved | 2024-01-01 |
258+
| questionnaire_responses.spine_as.0.Requestor URP | requestor-789 |
259+
| questionnaire_responses.spine_as.0.Date Requested | 2024-01-03 |
260+
| questionnaire_responses.spine_as.0.Product Key | product-key-001 |
261+
And I note the response field "$.id" as "device_id_2"
262+
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/${ note(device_id) }"
263+
Then I receive a status code "200" with body
264+
| path | value |
265+
| id | ${ note(device_id) } |
266+
| name | F5H1R-850000/ - Accredited System |
267+
| status | active |
268+
| product_id | ${ note(product_id) } |
269+
| product_team_id | ${ note(product_team_id) } |
270+
| ods_code | F5H1R |
271+
| created_on | << ignore >> |
272+
| updated_on | << ignore >> |
273+
| deleted_on | << ignore >> |
274+
| keys | [] |
275+
| tags.0.0.0 | ${ note(party_key_tag) } |
276+
| tags.0.0.1 | ${ note(party_key_tag_value) } |
277+
| questionnaire_responses | << ignore >> |
278+
| device_reference_data | << ignore >> |
279+
And the response headers contain:
280+
| name | value |
281+
| Content-Type | application/json |
282+
| Content-Length | 1724 |
283+
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/${ note(device_id_2) }"
284+
Then I receive a status code "200" with body
285+
| path | value |
286+
| id | ${ note(device_id_2) } |
287+
| name | F5H1R-850000/ - Accredited System |
288+
| status | active |
289+
| product_id | ${ note(product_id) } |
290+
| product_team_id | ${ note(product_team_id) } |
291+
| ods_code | F5H1R |
292+
| created_on | << ignore >> |
293+
| updated_on | << ignore >> |
294+
| deleted_on | << ignore >> |
295+
| keys | [] |
296+
| tags.0.0.0 | ${ note(party_key_tag) } |
297+
| tags.0.0.1 | ${ note(party_key_tag_value) } |
298+
| questionnaire_responses | << ignore >> |
299+
| device_reference_data | << ignore >> |
300+
And the response headers contain:
301+
| name | value |
302+
| Content-Type | application/json |
303+
| Content-Length | 1724 |

0 commit comments

Comments
 (0)