Skip to content

Commit 3a460b4

Browse files
committed
[release/2024-10-16] fix-forward: update read device ref data tests
1 parent 6a3445c commit 3a460b4

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Feature: Read Device Reference Data - failure scenarios
2+
These scenarios demonstrate failure reading Device Reference Data
3+
4+
Background:
5+
Given "default" request headers:
6+
| name | value |
7+
| version | 1 |
8+
| Authorization | letmein |
9+
10+
Scenario: Read a deleted Product's DeviceReferenceData
11+
Given I have already made a "POST" request with "default" headers to "ProductTeam" with body:
12+
| path | value |
13+
| name | My Great Product Team |
14+
| ods_code | F5H1R |
15+
And I note the response field "$.id" as "product_team_id"
16+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product" with body:
17+
| path | value |
18+
| product_name | My Great Product |
19+
And I note the response field "$.id" as "product_id"
20+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData" with body:
21+
| path | value |
22+
| name | My Device Reference Data |
23+
And I note the response field "$.id" as "device_reference_data_id"
24+
And I have already made a "DELETE" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }"
25+
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/${ note(device_reference_data_id) }"
26+
Then I receive a status code "404" with body
27+
| path | value |
28+
| errors.0.code | RESOURCE_NOT_FOUND |
29+
| errors.0.message | Could not find CpmProduct for key ('${ note(product_team_id) }', '${ note(product_id) }') |
30+
And the response headers contain:
31+
| name | value |
32+
| Content-Type | application/json |
33+
| Content-Length | 152 |
34+
35+
Scenario: Read an unknown product teams DeviceReferenceData
36+
Given I have already made a "POST" request with "default" headers to "ProductTeam" with body:
37+
| path | value |
38+
| name | My Great Product Team |
39+
| ods_code | F5H1R |
40+
And I note the response field "$.id" as "product_team_id"
41+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product" with body:
42+
| path | value |
43+
| product_name | My Great Product |
44+
And I note the response field "$.id" as "product_id"
45+
And I have already made a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData" with body:
46+
| path | value |
47+
| name | My Device Reference Data |
48+
And I note the response field "$.id" as "device_reference_data_id"
49+
When I make a "GET" request with "default" headers to "ProductTeam/F5H1R.f63ba1d2-99b3-4e7f-83b4-a98178f1e4fe/Product/${ note(product_id) }/DeviceReferenceData/${ note(device_reference_data_id) }"
50+
Then I receive a status code "404" with body
51+
| path | value |
52+
| errors.0.code | RESOURCE_NOT_FOUND |
53+
| errors.0.message | Could not find ProductTeam for key ('F5H1R.f63ba1d2-99b3-4e7f-83b4-a98178f1e4fe') |
54+
And the response headers contain:
55+
| name | value |
56+
| Content-Type | application/json |
57+
| Content-Length | 140 |

0 commit comments

Comments
 (0)