ComputationResource { @DELETE @Timed @Path("{tenant}/{internalId}") @UnitOfWork @UserRequired @ApiOperation(value = "Soft delete computation") public Response delete(@PathParam("tenant") final String tenant, @PathParam("internalId") final int id) { service.delete(tenant, id); return Response.ok().build(); }  @UserRequired @POST @Timed @Consumes(MediaType.APPLICATION_JSON) @UnitOfWork @Path("{tenant}") @ApiOperation(value = "Save/update computation, basically creates a new version", response = ComputationDomain.class) Response saveOrUpdate(@PathParam("tenant") final String tenant, @Valid final ComputationDomain computation); @GET @Timed @UnitOfWork(transactional = false) @Path("{tenant}/{name}") @ApiOperation(value = "Get latest computation based on name and version(optional)", response = ComputationDomain.class) Response getLatestByName(@PathParam("tenant") final String tenant, @PathParam("name") final String name,
            @QueryParam("version") final Integer version); @GET @Timed @UnitOfWork(transactional = false) @Path("{tenant}") @ApiOperation(value = "Search computation based on params", response = List.class) Response search(@PathParam("tenant") final String tenant,
                           @QueryParam("name") final String name,
                           @QueryParam("version") final Integer version,
                           @QueryParam("latest") @DefaultValue("true") final Boolean latest); @DELETE @Timed @Path("{tenant}/{internalId}") @UnitOfWork @UserRequired @ApiOperation(value = "Soft delete computation") Response delete(@PathParam("tenant") final String tenant, @PathParam("internalId") final int id); @GET @Timed @Path(("{tenant}/id/{internalId}")) @UnitOfWork(transactional = false) Response get(@PathParam("tenant") final String tenant, @PathParam("internalId") final int id);  }
@Test public void testDeleteById() { doNothing().when(service).delete(anyString(), anyInt()); final Response response = resource.delete(tenant, 1); Assert.assertEquals(response.getStatus(), 200); }