Skip to content

Commit 8cf92dd

Browse files
committed
Valid nested path params test
1 parent 87cc458 commit 8cf92dd

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

src/test/java/com/typicode/jsonplaceholder/features/Posts.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,10 @@ Feature: Posts Endpoint
222222
When I make a GET request to the Posts endpoint with a "userId" query parameter of 1
223223
And I make a GET request to the Users endpoint with nested path parameters of 1/posts
224224
Then the two response bodies are identical
225+
226+
Scenario: Valid nested path parameters
227+
When I make a GET request to the Posts endpoint with nested path parameters of 1/comments
228+
Then the response has a status code of 200
229+
And the response body follows the "MultipleComments" JSON schema
230+
And the results array contains 5 elements
231+
And the response body matches the "PostComments" expected response
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[
2+
{
3+
"postId": 1,
4+
"id": 1,
5+
"name": "id labore ex et quam laborum",
6+
"email": "Eliseo@gardner.biz",
7+
"body": "laudantium enim quasi est quidem magnam voluptate ipsam eos\ntempora quo necessitatibus\ndolor quam autem quasi\nreiciendis et nam sapiente accusantium"
8+
},
9+
{
10+
"postId": 1,
11+
"id": 2,
12+
"name": "quo vero reiciendis velit similique earum",
13+
"email": "Jayne_Kuhic@sydney.com",
14+
"body": "est natus enim nihil est dolore omnis voluptatem numquam\net omnis occaecati quod ullam at\nvoluptatem error expedita pariatur\nnihil sint nostrum voluptatem reiciendis et"
15+
},
16+
{
17+
"postId": 1,
18+
"id": 3,
19+
"name": "odio adipisci rerum aut animi",
20+
"email": "Nikita@garfield.biz",
21+
"body": "quia molestiae reprehenderit quasi aspernatur\naut expedita occaecati aliquam eveniet laudantium\nomnis quibusdam delectus saepe quia accusamus maiores nam est\ncum et ducimus et vero voluptates excepturi deleniti ratione"
22+
},
23+
{
24+
"postId": 1,
25+
"id": 4,
26+
"name": "alias odio sit",
27+
"email": "Lew@alysha.tv",
28+
"body": "non et atque\noccaecati deserunt quas accusantium unde odit nobis qui voluptatem\nquia voluptas consequuntur itaque dolor\net qui rerum deleniti ut occaecati"
29+
},
30+
{
31+
"postId": 1,
32+
"id": 5,
33+
"name": "vero eaque aliquid doloribus et culpa",
34+
"email": "Hayden@althea.biz",
35+
"body": "harum non quasi et ratione\ntempore iure ex voluptates in ratione\nharum architecto fugit inventore cupiditate\nvoluptates magni quo et"
36+
}
37+
]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"type": "array",
3+
"items": {
4+
"type": "object",
5+
"properties": {
6+
"postId": {
7+
"type": "integer"
8+
},
9+
"id": {
10+
"type": "integer"
11+
},
12+
"name": {
13+
"type": "string"
14+
},
15+
"email": {
16+
"type": "string"
17+
},
18+
"body": {
19+
"type": "string"
20+
}
21+
},
22+
"required": [
23+
"postId",
24+
"id",
25+
"name",
26+
"email",
27+
"body"
28+
],
29+
"additionalProperties": false
30+
},
31+
"additionalProperties": false
32+
}

0 commit comments

Comments
 (0)