### Question:
TransactionResource { @GET public Response getTransactions(@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.getTotalNumberOfTransactions(), service.findAllTransactions(offset, limit))).build(); }  @GET Response getTransactions(@Context HttpServletRequest request, @QueryParam(OFFSET_PARAMETER) @DefaultValue(OFFSET_DEFAULT) int offset, @QueryParam(LIMIT_PARAMETER) @DefaultValue(LIMIT_DEFAULT) int limit); void setService(OperatorApiService service);  }### Answer:
@Test public void testGetTransactions() { Response response = resource.getTransactions(request, ChargingStationTestUtils.OFFSET, ChargingStationTestUtils.LIMIT); verify(service).findAllTransactions(ChargingStationTestUtils.OFFSET, ChargingStationTestUtils.LIMIT); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); }
@Test(expected = RuntimeException.class) public void testGetTransactionsThrowsException() { doThrow(mock(PersistenceException.class)).when(service).findAllTransactions(ChargingStationTestUtils.OFFSET, ChargingStationTestUtils.LIMIT); resource.getTransactions(request, ChargingStationTestUtils.OFFSET, ChargingStationTestUtils.LIMIT); }