Skip to content

Commit a026995

Browse files
committed
Test invalid nested path parameters
1 parent 3797f81 commit a026995

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,32 @@ Feature: Posts Endpoint
244244
| photos | MultiplePhotos | 5000 | AllPhotos |
245245
| todos | MultipleToDos | 200 | AllToDos |
246246
| users | MultipleUsers | 10 | AllUsers |
247+
248+
Scenario Outline: Invalid post ID in nested parameters - <ID>
249+
When I make a GET request to the Posts endpoint with nested path parameters of <ID>/comments
250+
Then the response has a status code of 200
251+
And the response body follows the "MultipleComments" JSON schema
252+
And the results array contains 0 elements
253+
Examples:
254+
| ID |
255+
| 0 |
256+
| 101 |
257+
| -1 |
258+
259+
Scenario: Non-existent nested endpoint parameter
260+
When I make a GET request to the Posts endpoint with nested path parameters of 1/dummy
261+
Then the response has a status code of 404
262+
And the response body is an empty JSON object
263+
264+
Scenario Outline: Invalid post ID and endpoint in nested parameters
265+
When I make a GET request to the Posts endpoint with nested path parameters of <ID>/albums
266+
Then the response has a status code of 200
267+
And the response body follows the "MultipleAlbums" JSON schema
268+
And the results array contains 100 elements
269+
And the response body matches the "AllAlbums" expected response
270+
Examples:
271+
| ID |
272+
| 0 |
273+
| 101 |
274+
| -1 |
275+

0 commit comments

Comments
 (0)