@Test public void testGetManufacturers() { Response response = resource.getManufacturers(request, DEFAULT_PAGING_PAGE, DEFAULT_PAGING_RECORDS_PER_PAGE); verify(repository).findAll(DEFAULT_PAGING_PAGE, DEFAULT_PAGING_RECORDS_PER_PAGE); assertNotNull(response); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); }
@GET public Response getManufacturers(@Context HttpServletRequest request, @QueryParam(OFFSET_PARAMETER) @DefaultValue(OFFSET_DEFAULT) int offset, @QueryParam(LIMIT_PARAMETER) @DefaultValue(LIMIT_DEFAULT) int limit) { return Response.ok(ResponseBuilder.buildResponse(request, offset, limit, domainService.getTotalNumberOfManufacturers(), domainService.getManufacturers(offset, limit))).build(); }
ManufacturerResource { @GET public Response getManufacturers(@Context HttpServletRequest request, @QueryParam(OFFSET_PARAMETER) @DefaultValue(OFFSET_DEFAULT) int offset, @QueryParam(LIMIT_PARAMETER) @DefaultValue(LIMIT_DEFAULT) int limit) { return Response.ok(ResponseBuilder.buildResponse(request, offset, limit, domainService.getTotalNumberOfManufacturers(), domainService.getManufacturers(offset, limit))).build(); } }
ManufacturerResource { @GET public Response getManufacturers(@Context HttpServletRequest request, @QueryParam(OFFSET_PARAMETER) @DefaultValue(OFFSET_DEFAULT) int offset, @QueryParam(LIMIT_PARAMETER) @DefaultValue(LIMIT_DEFAULT) int limit) { return Response.ok(ResponseBuilder.buildResponse(request, offset, limit, domainService.getTotalNumberOfManufacturers(), domainService.getManufacturers(offset, limit))).build(); }  }
ManufacturerResource { @GET public Response getManufacturers(@Context HttpServletRequest request, @QueryParam(OFFSET_PARAMETER) @DefaultValue(OFFSET_DEFAULT) int offset, @QueryParam(LIMIT_PARAMETER) @DefaultValue(LIMIT_DEFAULT) int limit) { return Response.ok(ResponseBuilder.buildResponse(request, offset, limit, domainService.getTotalNumberOfManufacturers(), domainService.getManufacturers(offset, limit))).build(); }  @POST @Consumes(ApiVersion.V1_JSON) Response createManufacturer(Manufacturer manufacturer); @PUT @Path("/{id: [0-9]+}") @Consumes(ApiVersion.V1_JSON) Response updateManufacturer(@PathParam("id") Long id, Manufacturer manufacturer); @GET Response getManufacturers(@Context HttpServletRequest request, @QueryParam(OFFSET_PARAMETER) @DefaultValue(OFFSET_DEFAULT) int offset, @QueryParam(LIMIT_PARAMETER) @DefaultValue(LIMIT_DEFAULT) int limit); @GET @Path("/{id: [0-9]+}") Response getManufacturer(@PathParam("id") Long id); @DELETE @Path("/{id: [0-9]+}") Response deleteManufacturer(@PathParam("id") Long id); void setDomainService(DomainService domainService); }
ManufacturerResource { @GET public Response getManufacturers(@Context HttpServletRequest request, @QueryParam(OFFSET_PARAMETER) @DefaultValue(OFFSET_DEFAULT) int offset, @QueryParam(LIMIT_PARAMETER) @DefaultValue(LIMIT_DEFAULT) int limit) { return Response.ok(ResponseBuilder.buildResponse(request, offset, limit, domainService.getTotalNumberOfManufacturers(), domainService.getManufacturers(offset, limit))).build(); }  @POST @Consumes(ApiVersion.V1_JSON) Response createManufacturer(Manufacturer manufacturer); @PUT @Path("/{id: [0-9]+}") @Consumes(ApiVersion.V1_JSON) Response updateManufacturer(@PathParam("id") Long id, Manufacturer manufacturer); @GET Response getManufacturers(@Context HttpServletRequest request, @QueryParam(OFFSET_PARAMETER) @DefaultValue(OFFSET_DEFAULT) int offset, @QueryParam(LIMIT_PARAMETER) @DefaultValue(LIMIT_DEFAULT) int limit); @GET @Path("/{id: [0-9]+}") Response getManufacturer(@PathParam("id") Long id); @DELETE @Path("/{id: [0-9]+}") Response deleteManufacturer(@PathParam("id") Long id); void setDomainService(DomainService domainService);  }