### Question:
ChargingStationTypeResource { @GET @Path("/{id: [0-9]+}") public Response getChargingStationType(@PathParam("id") Long id) { return Response.ok(domainService.getChargingStationType(id)).build(); }  @POST @Consumes(ApiVersion.V1_JSON) Response createChargingStationType(ChargingStationType chargingStationType); @PUT @Path("/{id: [0-9]+}") @Consumes(ApiVersion.V1_JSON) Response updateChargingStationType(@PathParam("id") Long id, ChargingStationType chargingStationType); @GET Response getChargingStationTypes(@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 getChargingStationType(@PathParam("id") Long id); @DELETE @Path("/{id: [0-9]+}") Response deleteChargingStationType(@PathParam("id") Long id); void setDomainService(DomainService domainService);  }### Answer:
@Test public void testGetChargingStationType() { Response response = resource.getChargingStationType(anyLong()); verify(repository).findOne(anyLong()); assertNotNull(response); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); }
@Test(expected = RuntimeException.class) public void testGetChargingStationTypeThrowsException() { when(repository.findOne(anyLong())).thenThrow(mock(EntityNotFoundException.class)); resource.getChargingStationType(anyLong()); }