GlobalPropertyResource { @GET @Timed @UnitOfWork(transactional = false) @Path("{id}") @ApiOperation(value = "Get global property by id", response = GlobalPropertyDomain.class) public Response get(@PathParam("id") final int id) { return Response.ok().entity(service.get(id)).build(); }  @POST @Consumes(MediaType.APPLICATION_JSON) @Timed @UnitOfWork @ApiOperation(value = "Save global property", response = GlobalPropertyDomain.class) Response save(@NotNull @Valid final GlobalPropertyDomain globalProperty); @GET @Timed @UnitOfWork(transactional = false) @Path("{id}") @ApiOperation(value = "Get global property by id", response = GlobalPropertyDomain.class) Response get(@PathParam("id") final int id); @GET @Timed @UnitOfWork(transactional = false) @ApiOperation(value = "Search global property based on name, param", response = Set.class) Response search(@QueryParam("name") final String name, @QueryParam("type") final String propertyType); @DELETE @Timed @UnitOfWork @Path("{id}") @ApiOperation(value = "Soft delete") Response delete(@PathParam("id") final int id);  }
@Test public void testGet() { doReturn(globalProperty).when(service).get(anyInt()); final Response response = resource.get(globalProperty.getId()); Assert.assertEquals(response.getStatus(), 200); Assert.assertEquals(response.getEntity(), globalProperty); }