@Test public void testDelete() { Response res = resource.delete(); assertNotNull(res); assertEquals(Status.NO_CONTENT.getStatusCode(), res.getStatus()); Mockito.verify(service).deleteCustom("TEST-ID"); }
@DELETE @Path("/") public Response delete() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().deleteCustom(entityId); return Response.status(Status.NO_CONTENT).build(); }
CustomEntityResource { @DELETE @Path("/") public Response delete() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().deleteCustom(entityId); return Response.status(Status.NO_CONTENT).build(); } }
CustomEntityResource { @DELETE @Path("/") public Response delete() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().deleteCustom(entityId); return Response.status(Status.NO_CONTENT).build(); } CustomEntityResource(final String entityId, final EntityDefinition entityDefinition,
                                final ResourceHelper resourceHelper); }
CustomEntityResource { @DELETE @Path("/") public Response delete() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().deleteCustom(entityId); return Response.status(Status.NO_CONTENT).build(); } CustomEntityResource(final String entityId, final EntityDefinition entityDefinition,
                                final ResourceHelper resourceHelper); @GET @Path("/") Response read(); @PUT @Path("/") Response createOrUpdatePut(final EntityBody customEntity); @POST @Path("/") Response createOrUpdatePost(@Context final UriInfo uriInfo,
                                       final EntityBody customEntity); @DELETE @Path("/") Response delete(); }
CustomEntityResource { @DELETE @Path("/") public Response delete() { if (entityDefinition == null) { return Response.status(Status.NOT_FOUND).build(); } entityDefinition.getService().deleteCustom(entityId); return Response.status(Status.NO_CONTENT).build(); } CustomEntityResource(final String entityId, final EntityDefinition entityDefinition,
                                final ResourceHelper resourceHelper); @GET @Path("/") Response read(); @PUT @Path("/") Response createOrUpdatePut(final EntityBody customEntity); @POST @Path("/") Response createOrUpdatePost(@Context final UriInfo uriInfo,
                                       final EntityBody customEntity); @DELETE @Path("/") Response delete();  }