Skip to content
This repository has been 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

Open
no-reply opened this issue Jul 27, 2015 · 0 comments

Comments

@no-reply
Copy link

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:

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant