@Test public void getChargePointInfoSubscriptionValidateResponse() { subscribeTestSubscriber(); chargingStationRepository.createOrUpdate(new ChargingStation(CHARGING_STATION_ID.getId())); chargingStationRepository.createOrUpdate(new ChargingStation("SECOND_CS")); GetChargePointInfoRequest request = new GetChargePointInfoRequest(); GetChargePointInfoResponse response = service.getChargePointInfo(request, SUBSCRIBER_IDENTITY); assertEquals(2, response.getChargePoints().size()); }
@Override public GetChargePointInfoResponse getChargePointInfo(@WebParam(partName = "parameters", name = "getChargePointInfoRequest", targetNamespace = VAS_NAMESPACE) GetChargePointInfoRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity) { LOG.info("GetChargePointInfo {}", subscriberIdentity); GetChargePointInfoResponse response = new GetChargePointInfoResponse(); if (!subscriptionRepository.findBySubscriberIdentity(subscriberIdentity).isEmpty()) { List<ChargePoint> chargePoints = response.getChargePoints(); for (ChargingStation chargingStation : chargingStationRepository.findAll()) { chargePoints.add(vasConversionService.getVasRepresentation(chargingStation)); } } return response; }
MotownVasPublisherService implements VasPublisherService { @Override public GetChargePointInfoResponse getChargePointInfo(@WebParam(partName = "parameters", name = "getChargePointInfoRequest", targetNamespace = VAS_NAMESPACE) GetChargePointInfoRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity) { LOG.info("GetChargePointInfo {}", subscriberIdentity); GetChargePointInfoResponse response = new GetChargePointInfoResponse(); if (!subscriptionRepository.findBySubscriberIdentity(subscriberIdentity).isEmpty()) { List<ChargePoint> chargePoints = response.getChargePoints(); for (ChargingStation chargingStation : chargingStationRepository.findAll()) { chargePoints.add(vasConversionService.getVasRepresentation(chargingStation)); } } return response; } }
MotownVasPublisherService implements VasPublisherService { @Override public GetChargePointInfoResponse getChargePointInfo(@WebParam(partName = "parameters", name = "getChargePointInfoRequest", targetNamespace = VAS_NAMESPACE) GetChargePointInfoRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity) { LOG.info("GetChargePointInfo {}", subscriberIdentity); GetChargePointInfoResponse response = new GetChargePointInfoResponse(); if (!subscriptionRepository.findBySubscriberIdentity(subscriberIdentity).isEmpty()) { List<ChargePoint> chargePoints = response.getChargePoints(); for (ChargingStation chargingStation : chargingStationRepository.findAll()) { chargePoints.add(vasConversionService.getVasRepresentation(chargingStation)); } } return response; }  }
MotownVasPublisherService implements VasPublisherService { @Override public GetChargePointInfoResponse getChargePointInfo(@WebParam(partName = "parameters", name = "getChargePointInfoRequest", targetNamespace = VAS_NAMESPACE) GetChargePointInfoRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity) { LOG.info("GetChargePointInfo {}", subscriberIdentity); GetChargePointInfoResponse response = new GetChargePointInfoResponse(); if (!subscriptionRepository.findBySubscriberIdentity(subscriberIdentity).isEmpty()) { List<ChargePoint> chargePoints = response.getChargePoints(); for (ChargingStation chargingStation : chargingStationRepository.findAll()) { chargePoints.add(vasConversionService.getVasRepresentation(chargingStation)); } } return response; }  @Override SubscribeResponse subscribe(@WebParam(partName = "parameters", name = "subscribeRequest", targetNamespace = VAS_NAMESPACE) SubscribeRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity); @Override GetChargePointInfoResponse getChargePointInfo(@WebParam(partName = "parameters", name = "getChargePointInfoRequest", targetNamespace = VAS_NAMESPACE) GetChargePointInfoRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity); @Override UnsubscribeResponse unsubscribe(@WebParam(partName = "parameters", name = "unsubscribeRequest", targetNamespace = VAS_NAMESPACE) UnsubscribeRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity); void setSubscriptionRepository(SubscriptionRepository subscriptionRepository); void setChargingStationRepository(ChargingStationRepository chargingStationRepository); void setVasConversionService(VasConversionService vasConversionService); }
MotownVasPublisherService implements VasPublisherService { @Override public GetChargePointInfoResponse getChargePointInfo(@WebParam(partName = "parameters", name = "getChargePointInfoRequest", targetNamespace = VAS_NAMESPACE) GetChargePointInfoRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity) { LOG.info("GetChargePointInfo {}", subscriberIdentity); GetChargePointInfoResponse response = new GetChargePointInfoResponse(); if (!subscriptionRepository.findBySubscriberIdentity(subscriberIdentity).isEmpty()) { List<ChargePoint> chargePoints = response.getChargePoints(); for (ChargingStation chargingStation : chargingStationRepository.findAll()) { chargePoints.add(vasConversionService.getVasRepresentation(chargingStation)); } } return response; }  @Override SubscribeResponse subscribe(@WebParam(partName = "parameters", name = "subscribeRequest", targetNamespace = VAS_NAMESPACE) SubscribeRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity); @Override GetChargePointInfoResponse getChargePointInfo(@WebParam(partName = "parameters", name = "getChargePointInfoRequest", targetNamespace = VAS_NAMESPACE) GetChargePointInfoRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity); @Override UnsubscribeResponse unsubscribe(@WebParam(partName = "parameters", name = "unsubscribeRequest", targetNamespace = VAS_NAMESPACE) UnsubscribeRequest parameters, @WebParam(partName = "SubscriberIdentity", name = "subscriberIdentity", targetNamespace = VAS_NAMESPACE, header = true) String subscriberIdentity); void setSubscriptionRepository(SubscriptionRepository subscriptionRepository); void setChargingStationRepository(ChargingStationRepository chargingStationRepository); void setVasConversionService(VasConversionService vasConversionService); static final String VAS_NAMESPACE; }