@@ -19,79 +19,33 @@ Feature: Max depth handling
19
19
Then the response status code should be 201
20
20
And the response should be in JSON
21
21
And the header "Content-Type" should be equal to "application/hal+json; charset=utf-8"
22
- And the JSON should be equal to:
23
- """
24
- {
25
- "_links": {
26
- "self": {
27
- "href": "/max_depth_eager_dummies/1"
28
- },
29
- "child": {
30
- "href": "/max_depth_eager_dummies/2"
31
- }
32
- },
33
- "_embedded": {
34
- "child": {
35
- "_links": {
36
- "self": {
37
- "href": "/max_depth_eager_dummies/2"
38
- }
39
- },
40
- "id": 2,
41
- "name": "level 2"
42
- }
43
- },
44
- "id": 1,
45
- "name": "level 1"
46
- }
47
- """
22
+ Then the JSON node "_embedded" should exist
23
+ Then the JSON node "_embedded.child" should exist
24
+ Then the JSON node "_embedded.child._embedded" should not exist
48
25
49
- Scenario : Add a 2nd level of descendants
26
+ Scenario : Create a resource with 2 levels of descendants
50
27
When I add "Accept" header equal to "application/hal+json"
51
28
And I add "Content-Type" header equal to "application/json"
52
- And I send a "PUT " request to "max_depth_eager_dummies/1 " with body:
29
+ And I send a "POST " request to "/max_depth_eager_dummies " with body:
53
30
"""
54
31
{
55
- "id ": "/max_depth_eager_dummies/ 1",
32
+ "name ": "level 1",
56
33
"child": {
57
- "id ": "/max_depth_eager_dummies/ 2",
34
+ "name ": "level 2",
58
35
"child": {
59
36
"name": "level 3"
60
37
}
61
38
}
62
39
}
63
40
"""
64
- And the response status code should be 200
41
+ And the response status code should be 201
65
42
And the response should be in JSON
66
43
And the header "Content-Type" should be equal to "application/hal+json; charset=utf-8"
67
- And the JSON should be equal to:
68
- """
69
- {
70
- "_links": {
71
- "self": {
72
- "href": "/max_depth_eager_dummies/1"
73
- },
74
- "child": {
75
- "href": "/max_depth_eager_dummies/2"
76
- }
77
- },
78
- "_embedded": {
79
- "child": {
80
- "_links": {
81
- "self": {
82
- "href": "/max_depth_eager_dummies/2"
83
- }
84
- },
85
- "id": 2,
86
- "name": "level 2"
87
- }
88
- },
89
- "id": 1,
90
- "name": "level 1"
91
- }
92
- """
44
+ Then the JSON node "_embedded" should exist
45
+ Then the JSON node "_embedded.child" should exist
46
+ Then the JSON node "_embedded.child._embedded" should not exist
93
47
94
- Scenario : Add a 2nd level of descendants when eager fetching is disabled
48
+ Scenario : Create a resource with 1 levels of descendants then add a 2nd level of descendants when eager fetching is disabled
95
49
Given there is a max depth dummy with 1 level of descendants
96
50
When I add "Accept" header equal to "application/hal+json"
97
51
And I add "Content-Type" header equal to "application/json"
@@ -110,29 +64,6 @@ Feature: Max depth handling
110
64
Then the response status code should be 200
111
65
And the response should be in JSON
112
66
And the header "Content-Type" should be equal to "application/hal+json; charset=utf-8"
113
- And the JSON should be equal to:
114
- """
115
- {
116
- "_links": {
117
- "self": {
118
- "href": "/max_depth_dummies/1"
119
- },
120
- "child": {
121
- "href": "/max_depth_dummies/2"
122
- }
123
- },
124
- "_embedded": {
125
- "child": {
126
- "_links": {
127
- "self": {
128
- "href": "/max_depth_dummies/2"
129
- }
130
- },
131
- "id": 2,
132
- "name": "level 2"
133
- }
134
- },
135
- "id": 1,
136
- "name": "level 1"
137
- }
138
- """
67
+ Then the JSON node "_embedded" should exist
68
+ Then the JSON node "_embedded.child" should exist
69
+ Then the JSON node "_embedded.child._embedded" should not exist
0 commit comments