@Test(expected = RuntimeException.class) public void updateConnectorThrowsException() { Connector connector = mock(Connector.class); doThrow(mock(PersistenceException.class)).when(domainService).updateConnector(CONNECTOR_ID, EVSE_ID, connector); resource.updateConnector(CHARGING_STATION_TYPE_ID, EVSE_ID, CONNECTOR_ID, connector); }
@PUT @Path("/{id: [0-9]+}") @Consumes(ApiVersion.V1_JSON) public Response updateConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id, Connector connector) { connector.setId(id); return Response.ok(domainService.updateConnector(chargingStationTypeId, evseId, connector)).build(); }
ConnectorResource { @PUT @Path("/{id: [0-9]+}") @Consumes(ApiVersion.V1_JSON) public Response updateConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id, Connector connector) { connector.setId(id); return Response.ok(domainService.updateConnector(chargingStationTypeId, evseId, connector)).build(); } }
ConnectorResource { @PUT @Path("/{id: [0-9]+}") @Consumes(ApiVersion.V1_JSON) public Response updateConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id, Connector connector) { connector.setId(id); return Response.ok(domainService.updateConnector(chargingStationTypeId, evseId, connector)).build(); }  }
ConnectorResource { @PUT @Path("/{id: [0-9]+}") @Consumes(ApiVersion.V1_JSON) public Response updateConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id, Connector connector) { connector.setId(id); return Response.ok(domainService.updateConnector(chargingStationTypeId, evseId, connector)).build(); }  @GET Response getConnectors(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId); @POST @Consumes(ApiVersion.V1_JSON) Response createConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, Connector connector); @PUT @Path("/{id: [0-9]+}") @Consumes(ApiVersion.V1_JSON) Response updateConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id, Connector connector); @GET @Path("/{id: [0-9]+}") Response getConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id); @DELETE @Path("/{id: [0-9]+}") Response deleteConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id); void setDomainService(DomainService domainService); }
ConnectorResource { @PUT @Path("/{id: [0-9]+}") @Consumes(ApiVersion.V1_JSON) public Response updateConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id, Connector connector) { connector.setId(id); return Response.ok(domainService.updateConnector(chargingStationTypeId, evseId, connector)).build(); }  @GET Response getConnectors(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId); @POST @Consumes(ApiVersion.V1_JSON) Response createConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, Connector connector); @PUT @Path("/{id: [0-9]+}") @Consumes(ApiVersion.V1_JSON) Response updateConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id, Connector connector); @GET @Path("/{id: [0-9]+}") Response getConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id); @DELETE @Path("/{id: [0-9]+}") Response deleteConnector(@PathParam("chargingStationTypeId") Long chargingStationTypeId, @PathParam("evseId") Long evseId, @PathParam("id") Long id); void setDomainService(DomainService domainService);  }