@Nonnull public final Response delete(@Nonnull AbstractRestRequest request) { return buildRequest(checkNotNull(request, "request")).delete(buildUrl(request)); }
@Override public void perform() { given(). then(). statusCode(Status.UNAUTHORIZED.getStatusCode()). when(). delete(testURL.toExternalForm()); } }).inspect(new SetupAuth(null));
@Override public void perform() { given(). then(). statusCode(Status.OK.getStatusCode()). when(). delete(testURL.toExternalForm()); } }).inspect(new SetupAuth(new User("testuser")));
protected static void deleteUserFromCredentials(String userId, String username, String password) { given() .header("X-Requested-With", "XMLHttpRequest") .auth() .preemptive() .basic(username, password) .contentType("application/json;charset=UTF-8") .accept("application/json") .expect() .when() .delete(getHost() + CONTEXT_PATH + MONITORING_PATH + userId); }
@Test @InSequence(10) public void shouldBeAbleToDeleteSession() throws Exception { assertNotNull("Previous step failed", uri_sessionInstance); given(). then(). statusCode(Status.NO_CONTENT.getStatusCode()). when(). delete(uri_sessionInstance); }
@Test @InSequence(3) public void shouldBeAbleToRemoveRelation() throws Exception { given(). contentType(BASE_JSON_MEDIA_TYPE). body(new ResourceLink("test", URI.create("http://test.org/api/test/" + TARGET_ID + "/"))). then(). statusCode(Status.NO_CONTENT.getStatusCode()). when(). delete(baseURL + "api/rel/{sourceObj}/{source}/{rel}/{targetObj}/", "sourceobject", SOURCE_ID, type, "targetobject"); }
@Test @InSequence(12) public void shouldBeAbleToDeleteConference() throws Exception { assertNotNull("Previous step failed", uri_conferenceInstance); given(). then(). statusCode(Status.NO_CONTENT.getStatusCode()). when(). delete(uri_conferenceInstance); }
/** * Tests that LDP servers do not reuse URIs after deleting resources. * * @param slug the slug header for the request or null if no slug * @throws URISyntaxException on bad URIs * @see #testRestrictUriReUseSlug() * @see #testRestrictUriReUseNoSlug() */ 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); } }
@Test @InSequence(10) public void shouldBeAbleToDeleteUser() throws Exception { assertNotNull("Previous step failed", uri_userInstance); given(). then(). statusCode(Status.NO_CONTENT.getStatusCode()). when(). delete(uri_userInstance); }
@Test @InSequence(10) public void shouldBeAbleToDeleteAttachment() throws Exception { assertNotNull("Previous step failed", uri_attachmentInstance); given(). then(). statusCode(Status.NO_CONTENT.getStatusCode()). when(). delete(uri_attachmentInstance); }
@Test public void shouldReturnNotFoundOnDELETEMissingResource() throws Exception { given(). contentType(getBaseMediaType()). then(). statusCode(Response.Status.NOT_FOUND.getStatusCode()). when(). delete(createRootURL() + "/{id}", "MISSING"); }
.statusCode(isSuccessful()) .when() .delete(location);
@Test( groups = {SHOULD}, dependsOnMethods = {"testPutToCreate"}, description = "LDP servers that allow LDPR creation via PUT SHOULD NOT " + "re-use URIs. For RDF representations (LDP-RSs),the created " + "resource can be thought of as an RDF named graph [rdf11-concepts].") @SpecTest( specRefUri = LdpTestSuite.SPEC_URI + "#ldpc-put-create", testMethod = METHOD.AUTOMATED, approval = STATUS.WG_APPROVED) public void testRestrictPutReUseUri() { String location = putToCreate(); // Delete the resource. buildBaseRequestSpecification() .expect() .statusCode(isSuccessful()) .when() .delete(location); // Try to put to the same URI again. It should fail. Model content = postContent(); buildBaseRequestSpecification() .given() .contentType(TEXT_TURTLE) .body(content, new RdfObjectMapper(location)) .expect() .statusCode(not(isSuccessful())) .when() .put(location); }
.statusCode(isSuccessful()) .when() .delete(location);
buildBaseRequestSpecification().expect().statusCode(isSuccessful()).when().delete(location);
statusCode(200). when(). delete("/config/data/mykey");
expect().statusCode(200).when().delete(resource1.stringValue()); given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(404).when().get(resource1.stringValue());