This repository was archived by the owner on Jan 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
This repository was archived by the owner on Jan 23, 2024. It is now read-only.
Suite testRestrictUriReUseSlug fails if the server DOES NOT create second resource #225
Copy link
Copy link
Open
Description
The test is intended to cover the requirement that LDP servers that allow member creation via POST SHOULD NOT re-use URIs., but fails if the server does not respond 201 Created when requesting a resource with a duplicate Slug.
See:
ldp-testsuite/src/main/java/org/w3/ldp/testsuite/test/CommonContainerTest.java
Lines 907 to 927 in 816e98a
| private void testRestrictUriReUse(String slug) throws URISyntaxException { | |
| skipIfMethodNotAllowed(HttpMethod.POST); | |
| // POST two resources with the same Slug header and content to make sure | |
| // they have different URIs. | |
| Model content = postContent(); | |
| String loc1 = post(content, slug); | |
| // TODO: Test if DELETE is supported before trying to delete the | |
| // resource. | |
| // Delete the resource to make sure the server doesn't reuse the URI | |
| // below. | |
| buildBaseRequestSpecification().expect().statusCode(isSuccessful()).when().delete(loc1); | |
| String loc2 = post(content, slug); | |
| try { | |
| assertNotEquals(loc1, loc2, "Server reused URIs for POSTed resources."); | |
| } finally { | |
| buildBaseRequestSpecification().delete(loc2); | |
| } | |
| } |
The test as written wants to check that the newly created resource has a different URI than the one requested. As far as I can tell, it should also be acceptable to refuse to create the resource. We respond 409 Conflict, which seems to offer greater predictability to clients.
This issue is also documented here: ruby-rdf/rdf-ldp#6 (comment)
Metadata
Metadata
Assignees
Labels
No labels