@Test public void testCreateChargingStationType() { ChargingStationType chargingStationType = mock(ChargingStationType.class); Response response = resource.createChargingStationType(chargingStationType); verify(repository).createOrUpdate(chargingStationType); assertNotNull(response); assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); }
@POST @Consumes(ApiVersion.V1_JSON) public Response createChargingStationType(ChargingStationType chargingStationType) { chargingStationType.setId(null); for(Evse evse:chargingStationType.getEvses()) { evse.setId(null); for(Connector connector:evse.getConnectors()) { connector.setId(null); } } return Response.status(Response.Status.CREATED).entity(domainService.createChargingStationType(chargingStationType)).build(); }
ChargingStationTypeResource { @POST @Consumes(ApiVersion.V1_JSON) public Response createChargingStationType(ChargingStationType chargingStationType) { chargingStationType.setId(null); for(Evse evse:chargingStationType.getEvses()) { evse.setId(null); for(Connector connector:evse.getConnectors()) { connector.setId(null); } } return Response.status(Response.Status.CREATED).entity(domainService.createChargingStationType(chargingStationType)).build(); } }
ChargingStationTypeResource { @POST @Consumes(ApiVersion.V1_JSON) public Response createChargingStationType(ChargingStationType chargingStationType) { chargingStationType.setId(null); for(Evse evse:chargingStationType.getEvses()) { evse.setId(null); for(Connector connector:evse.getConnectors()) { connector.setId(null); } } return Response.status(Response.Status.CREATED).entity(domainService.createChargingStationType(chargingStationType)).build(); }  }
ChargingStationTypeResource { @POST @Consumes(ApiVersion.V1_JSON) public Response createChargingStationType(ChargingStationType chargingStationType) { chargingStationType.setId(null); for(Evse evse:chargingStationType.getEvses()) { evse.setId(null); for(Connector connector:evse.getConnectors()) { connector.setId(null); } } return Response.status(Response.Status.CREATED).entity(domainService.createChargingStationType(chargingStationType)).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); }
ChargingStationTypeResource { @POST @Consumes(ApiVersion.V1_JSON) public Response createChargingStationType(ChargingStationType chargingStationType) { chargingStationType.setId(null); for(Evse evse:chargingStationType.getEvses()) { evse.setId(null); for(Connector connector:evse.getConnectors()) { connector.setId(null); } } return Response.status(Response.Status.CREATED).entity(domainService.createChargingStationType(chargingStationType)).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);  }