@Test(expected = RuntimeException.class) public void testGetChargingStationsThrowsException() { doThrow(mock(PersistenceException.class)).when(service).findAllChargingStations(ChargingStationTestUtils.OFFSET, ChargingStationTestUtils.LIMIT); resource.getChargingStations(request, ChargingStationTestUtils.OFFSET, ChargingStationTestUtils.LIMIT); }
@GET public Response getChargingStations(@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, service.getTotalNumberOfChargingStations(), service.findAllChargingStations(offset, limit))).build(); }
ChargingStationResource { @GET public Response getChargingStations(@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, service.getTotalNumberOfChargingStations(), service.findAllChargingStations(offset, limit))).build(); } }
ChargingStationResource { @GET public Response getChargingStations(@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, service.getTotalNumberOfChargingStations(), service.findAllChargingStations(offset, limit))).build(); }  }
ChargingStationResource { @GET public Response getChargingStations(@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, service.getTotalNumberOfChargingStations(), service.findAllChargingStations(offset, limit))).build(); }  @POST @Path("/{chargingStationId}/commands") @Consumes(ApiVersion.V1_JSON) Response executeCommand(@PathParam("chargingStationId") String chargingStationId, String jsonCommand, @Context SecurityContext securityContext); @GET Response getChargingStations(@Context HttpServletRequest request, @QueryParam(OFFSET_PARAMETER) @DefaultValue(OFFSET_DEFAULT) int offset, @QueryParam(LIMIT_PARAMETER) @DefaultValue(LIMIT_DEFAULT) int limit); void setService(OperatorApiService service); void setCommandService(JsonCommandService commandService); }
ChargingStationResource { @GET public Response getChargingStations(@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, service.getTotalNumberOfChargingStations(), service.findAllChargingStations(offset, limit))).build(); }  @POST @Path("/{chargingStationId}/commands") @Consumes(ApiVersion.V1_JSON) Response executeCommand(@PathParam("chargingStationId") String chargingStationId, String jsonCommand, @Context SecurityContext securityContext); @GET Response getChargingStations(@Context HttpServletRequest request, @QueryParam(OFFSET_PARAMETER) @DefaultValue(OFFSET_DEFAULT) int offset, @QueryParam(LIMIT_PARAMETER) @DefaultValue(LIMIT_DEFAULT) int limit); void setService(OperatorApiService service); void setCommandService(JsonCommandService commandService);  }