Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.
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

Open
@no-reply

Description

@no-reply

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions