-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DMS-254] - Creation of UpdateValidation.feature file (#322)
* [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
1 parent
3418b8b
commit a3d6db5
Showing
2 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/dms/tests/EdFi.DataManagementService.Tests.E2E/Features/Resources/etag.feature.disabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." | ||
] | ||
} | ||
""" | ||
|
||
|
||
|
||
|
||
|