Skip to content

Commit

Permalink
[DMS-254] - Creation of UpdateValidation.feature file (#322)
Browse files Browse the repository at this point in the history
* [DMS-254] - Creation of UpdateValidation.feature file and fix of the numeration in ExperimentalQueries.feature.disabled

* Etag validation support (#325)

* [DMS-254] - Refactor of etag.feature file

---------

Co-authored-by: Adam Hopkins <[email protected]>
Co-authored-by: Stephen Fuqua <[email protected]>
  • Loading branch information
3 people authored Nov 1, 2024
1 parent 3418b8b commit a3d6db5
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: Experimental / proposed features for enhanced paging
And the response body should match the most recently inserted school

@API-258 @ignore
Scenario: 03 Ensure that clients can perform a DESCending sort by an attribute
Scenario: 02 Ensure that clients can perform a DESCending sort by an attribute
When a GET request is made to "/ed-fi/schools?orderBy=schoolId&direction=desc"
Then it should respond with 200
And the response body is
Expand Down Expand Up @@ -87,7 +87,7 @@ Feature: Experimental / proposed features for enhanced paging
"""

@API-258 @ignore
Scenario: 04 Ensure that clients can perform an ASCending sort by an attribute
Scenario: 03 Ensure that clients can perform an ASCending sort by an attribute
When a GET request is made to "/ed-fi/schools?orderBy=schoolId&direction=asc"
Then it should respond with 200
And the response body is
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Feature: Validates the functionality of the ETag

Background:

Given the system has these "students"
| studentUniqueId | birthDate | firstName | lastSurname |
| 111111 | 2014-08-14 | Russella | Mayers |

@API-260
Scenario: 01 Ensure that clients can retrieve an ETag in the response header
When a GET request is made to "/ed-fi/students/{id}"
Then it should respond with 200
And the response body is
"""
{
"studentUniqueId": "111111",
"birthDate": "2014-08-14",
"firstName": "Russella",
"lastSurname": "Mayers",
"_etag": "{etag}"
}
"""
And the ETag is in the response header

@API-261
Scenario: 02 Ensure that clients can pass an ETag in the request header
When a PUT if-match "{etag}" request is made to "/ed-fi/students/{id}" with
"""
{
"studentUniqueId": "111111",
"birthDate": "2014-08-14",
"firstName": "Russella",
"lastSurname": "Mayorga"
}
"""
Then it should respond with 204

@API-262
Scenario: 03 Ensure that clients cannot pass a different ETag in the If-Match header
When a PUT if-match "0000000000" request is made to "/ed-fi/students/{id}" with
"""
{
"studentUniqueId": "111111",
"birthDate": "2014-08-14",
"firstName": "Russella",
"lastSurname": "Mulligan"
}
"""
Then it should respond with 412
And the response body is
"""
{
"detail": "The item has been modified by another user.",
"type": "urn:ed-fi:api:optimistic-lock-failed",
"title": "Optimistic Lock Failed",
"status": 412,
"correlationId": null,
"errors": [
"The resource item's etag value does not match what was specified in the 'If-Match' request header indicating that it has been modified by another client since it was last retrieved."
]
}
"""





0 comments on commit a3d6db5

Please sign in to comment.