### Question:
Graphs extends Endpoint<Graphs> { private Future<Response> delete(final Request request) { return consumer -> { final String target=graph(request); if ( target == null ) { request.reply(new Failure() .status(Response.BadRequest) .error("parameter-missing") .notes("missing target graph parameter") ).accept(consumer); } else if ( !updatable(request.roles()) ) { request.reply(response -> response.status(Response.Unauthorized)).accept(consumer); } else { final Resource context=target.isEmpty() ? null : iri(target); graph().exec(connection -> { try { final boolean exists=exists(connection, context); connection.clear(context); request.reply(response -> response.status(exists ? Response.NoContent : Response.NotFound) ).accept(consumer); } catch ( final RepositoryException e ) { logger().warning(this, "unable to update graph "+context, e); request.reply(new Failure() .status(Response.InternalServerError) .error("update-aborted") .notes("unable to delete graph: see server logs for details") ).accept(consumer); } }); } }; } Graphs();   }### Answer:
@Test void testDELETEDefaultPrivateAnonymous() { exec(dflt(First), () -> _private(endpoint()) .handle(anonymous(dflt(delete(request())))) .accept(response -> { assertThat(response) .hasStatus(Response.Unauthorized) .doesNotHaveBody(); assertThat(dflt()) .isIsomorphicTo(First); })); }
@Test void testDELETEDefaultPrivateAuthenticated() { exec(dflt(First), () -> _private(endpoint()) .handle(authenticated(dflt(delete(request())))) .accept(response -> { assertThat(response) .isSuccess() .doesNotHaveBody(); assertThat(dflt()) .isEmpty(); })); }
@Test void testDELETEDefaultPublicAnonymous() { exec(dflt(First), () -> _public(endpoint()) .handle(anonymous(dflt(delete(request())))) .accept(response -> { assertThat(response) .hasStatus(Response.Unauthorized) .doesNotHaveBody(); assertThat(dflt()) .isIsomorphicTo(First); })); }
@Test void testDELETEDefaultPublicAuthenticated() { exec(dflt(First), () -> _public(endpoint()) .handle(authenticated(dflt(delete(request())))) .accept(response -> { assertThat(response) .isSuccess() .doesNotHaveBody(); assertThat(dflt()) .isEmpty(); })); }
@Test void testDELETENamedPrivateAnonymous() { exec(named(First), () -> _private(endpoint()) .handle(anonymous(named(delete(request())))) .accept(response -> { assertThat(response) .hasStatus(Response.Unauthorized) .doesNotHaveBody(); assertThat(named()) .isIsomorphicTo(First); })); }
@Test void testDELETENamedPrivateAuthenticated() { exec(named(First), () -> _private(endpoint()) .handle(authenticated(named(delete(request())))) .accept(response -> { assertThat(response) .isSuccess() .doesNotHaveBody(); assertThat(named()).isEmpty(); })); }
@Test void testDELETENamedPublicAnonymous() { exec(named(First), () -> _public(endpoint()) .handle(anonymous(named(delete(request())))) .accept(response -> { assertThat(response) .hasStatus(Response.Unauthorized) .doesNotHaveBody(); assertThat(named()) .isIsomorphicTo(First); })); }
@Test void testDELETENamedPublicAuthenticated() { exec(named(First), () -> _public(endpoint()) .handle(authenticated(named(delete(request())))) .accept(response -> { assertThat(response) .isSuccess() .doesNotHaveBody(); assertThat(named()).isEmpty(); })); }