@Test public void bootNotificationNoAddressVerifyResponse() { when(soapHeaderReader.getChargingStationAddress(any(MessageContext.class))).thenReturn(""); BootNotificationRequest request = new BootNotificationRequest(); BootNotificationResponse response = motownCentralSystemService.bootNotification(request, CHARGING_STATION_ID.getId()); assertEquals(response.getStatus(), RegistrationStatus.REJECTED); assertNotNull(response.getCurrentTime()); assertNotNull(response.getHeartbeatInterval()); }
@Override public BootNotificationResponse bootNotification(BootNotificationRequest request, String chargeBoxIdentity) { ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); String chargingStationAddress = soapHeaderReader.getChargingStationAddress(context.getMessageContext()); if (chargingStationAddress == null || chargingStationAddress.isEmpty()) { BootNotificationResponse response = new BootNotificationResponse(); response.setStatus(RegistrationStatus.REJECTED); response.setHeartbeatInterval(heartbeatIntervalFallback); response.setCurrentTime(new Date()); return response; } AttributeMap<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.CHARGING_STATION_ADDRESS, chargingStationAddress). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, request.getChargePointVendor()). putIfValueNotNull(AttributeMapKeys.MODEL, request.getChargePointModel()). putIfValueNotNull(AttributeMapKeys.CHARGING_STATION_SERIAL_NUMBER, request.getChargePointSerialNumber()). putIfValueNotNull(AttributeMapKeys.CHARGE_BOX_SERIAL_NUMBER, request.getChargeBoxSerialNumber()). putIfValueNotNull(AttributeMapKeys.FIRMWARE_VERSION, request.getFirmwareVersion()). putIfValueNotNull(AttributeMapKeys.ICCID, request.getIccid()). putIfValueNotNull(AttributeMapKeys.IMSI, request.getImsi()). putIfValueNotNull(AttributeMapKeys.METER_TYPE, request.getMeterType()). putIfValueNotNull(AttributeMapKeys.METER_SERIAL_NUMBER, request.getMeterSerialNumber()); BootChargingStationResult result = domainService.bootChargingStation(chargingStationId, PROTOCOL_IDENTIFIER, attributes, addOnIdentity); BootNotificationResponse response = new BootNotificationResponse(); response.setStatus(result.isAccepted() ? RegistrationStatus.ACCEPTED : RegistrationStatus.REJECTED); response.setHeartbeatInterval(result.getHeartbeatInterval()); response.setCurrentTime(result.getTimeStamp()); return response; }
MotownCentralSystemService implements CentralSystemService { @Override public BootNotificationResponse bootNotification(BootNotificationRequest request, String chargeBoxIdentity) { ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); String chargingStationAddress = soapHeaderReader.getChargingStationAddress(context.getMessageContext()); if (chargingStationAddress == null || chargingStationAddress.isEmpty()) { BootNotificationResponse response = new BootNotificationResponse(); response.setStatus(RegistrationStatus.REJECTED); response.setHeartbeatInterval(heartbeatIntervalFallback); response.setCurrentTime(new Date()); return response; } AttributeMap<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.CHARGING_STATION_ADDRESS, chargingStationAddress). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, request.getChargePointVendor()). putIfValueNotNull(AttributeMapKeys.MODEL, request.getChargePointModel()). putIfValueNotNull(AttributeMapKeys.CHARGING_STATION_SERIAL_NUMBER, request.getChargePointSerialNumber()). putIfValueNotNull(AttributeMapKeys.CHARGE_BOX_SERIAL_NUMBER, request.getChargeBoxSerialNumber()). putIfValueNotNull(AttributeMapKeys.FIRMWARE_VERSION, request.getFirmwareVersion()). putIfValueNotNull(AttributeMapKeys.ICCID, request.getIccid()). putIfValueNotNull(AttributeMapKeys.IMSI, request.getImsi()). putIfValueNotNull(AttributeMapKeys.METER_TYPE, request.getMeterType()). putIfValueNotNull(AttributeMapKeys.METER_SERIAL_NUMBER, request.getMeterSerialNumber()); BootChargingStationResult result = domainService.bootChargingStation(chargingStationId, PROTOCOL_IDENTIFIER, attributes, addOnIdentity); BootNotificationResponse response = new BootNotificationResponse(); response.setStatus(result.isAccepted() ? RegistrationStatus.ACCEPTED : RegistrationStatus.REJECTED); response.setHeartbeatInterval(result.getHeartbeatInterval()); response.setCurrentTime(result.getTimeStamp()); return response; } }
MotownCentralSystemService implements CentralSystemService { @Override public BootNotificationResponse bootNotification(BootNotificationRequest request, String chargeBoxIdentity) { ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); String chargingStationAddress = soapHeaderReader.getChargingStationAddress(context.getMessageContext()); if (chargingStationAddress == null || chargingStationAddress.isEmpty()) { BootNotificationResponse response = new BootNotificationResponse(); response.setStatus(RegistrationStatus.REJECTED); response.setHeartbeatInterval(heartbeatIntervalFallback); response.setCurrentTime(new Date()); return response; } AttributeMap<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.CHARGING_STATION_ADDRESS, chargingStationAddress). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, request.getChargePointVendor()). putIfValueNotNull(AttributeMapKeys.MODEL, request.getChargePointModel()). putIfValueNotNull(AttributeMapKeys.CHARGING_STATION_SERIAL_NUMBER, request.getChargePointSerialNumber()). putIfValueNotNull(AttributeMapKeys.CHARGE_BOX_SERIAL_NUMBER, request.getChargeBoxSerialNumber()). putIfValueNotNull(AttributeMapKeys.FIRMWARE_VERSION, request.getFirmwareVersion()). putIfValueNotNull(AttributeMapKeys.ICCID, request.getIccid()). putIfValueNotNull(AttributeMapKeys.IMSI, request.getImsi()). putIfValueNotNull(AttributeMapKeys.METER_TYPE, request.getMeterType()). putIfValueNotNull(AttributeMapKeys.METER_SERIAL_NUMBER, request.getMeterSerialNumber()); BootChargingStationResult result = domainService.bootChargingStation(chargingStationId, PROTOCOL_IDENTIFIER, attributes, addOnIdentity); BootNotificationResponse response = new BootNotificationResponse(); response.setStatus(result.isAccepted() ? RegistrationStatus.ACCEPTED : RegistrationStatus.REJECTED); response.setHeartbeatInterval(result.getHeartbeatInterval()); response.setCurrentTime(result.getTimeStamp()); return response; }  }
MotownCentralSystemService implements CentralSystemService { @Override public BootNotificationResponse bootNotification(BootNotificationRequest request, String chargeBoxIdentity) { ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); String chargingStationAddress = soapHeaderReader.getChargingStationAddress(context.getMessageContext()); if (chargingStationAddress == null || chargingStationAddress.isEmpty()) { BootNotificationResponse response = new BootNotificationResponse(); response.setStatus(RegistrationStatus.REJECTED); response.setHeartbeatInterval(heartbeatIntervalFallback); response.setCurrentTime(new Date()); return response; } AttributeMap<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.CHARGING_STATION_ADDRESS, chargingStationAddress). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, request.getChargePointVendor()). putIfValueNotNull(AttributeMapKeys.MODEL, request.getChargePointModel()). putIfValueNotNull(AttributeMapKeys.CHARGING_STATION_SERIAL_NUMBER, request.getChargePointSerialNumber()). putIfValueNotNull(AttributeMapKeys.CHARGE_BOX_SERIAL_NUMBER, request.getChargeBoxSerialNumber()). putIfValueNotNull(AttributeMapKeys.FIRMWARE_VERSION, request.getFirmwareVersion()). putIfValueNotNull(AttributeMapKeys.ICCID, request.getIccid()). putIfValueNotNull(AttributeMapKeys.IMSI, request.getImsi()). putIfValueNotNull(AttributeMapKeys.METER_TYPE, request.getMeterType()). putIfValueNotNull(AttributeMapKeys.METER_SERIAL_NUMBER, request.getMeterSerialNumber()); BootChargingStationResult result = domainService.bootChargingStation(chargingStationId, PROTOCOL_IDENTIFIER, attributes, addOnIdentity); BootNotificationResponse response = new BootNotificationResponse(); response.setStatus(result.isAccepted() ? RegistrationStatus.ACCEPTED : RegistrationStatus.REJECTED); response.setHeartbeatInterval(result.getHeartbeatInterval()); response.setCurrentTime(result.getTimeStamp()); return response; }  @Override AuthorizeResponse authorize(final AuthorizeRequest request, final String chargeBoxIdentity); @Override BootNotificationResponse bootNotification(BootNotificationRequest request, String chargeBoxIdentity); @Override DiagnosticsStatusNotificationResponse diagnosticsStatusNotification(DiagnosticsStatusNotificationRequest request, String chargeBoxIdentity); @Override FirmwareStatusNotificationResponse firmwareStatusNotification(FirmwareStatusNotificationRequest request, String chargeBoxIdentity); @Override HeartbeatResponse heartbeat(HeartbeatRequest parameters, String chargeBoxIdentity); @Override MeterValuesResponse meterValues(MeterValuesRequest request, String chargeBoxIdentity); @Override StartTransactionResponse startTransaction(final StartTransactionRequest parameters, final String chargeBoxIdentity); @Override StatusNotificationResponse statusNotification(StatusNotificationRequest request, String chargeBoxIdentity); @Override StopTransactionResponse stopTransaction(StopTransactionRequest request, String chargeBoxIdentity); void setDomainService(DomainService domainService); void setContext(WebServiceContext context); void setContinuationTimeout(int continuationTimeout); void setHeartbeatIntervalFallback(int heartbeatIntervalFallback); void setSoapHeaderReader(SoapHeaderReader soapHeaderReader); void setAddOnId(String id); }
MotownCentralSystemService implements CentralSystemService { @Override public BootNotificationResponse bootNotification(BootNotificationRequest request, String chargeBoxIdentity) { ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); String chargingStationAddress = soapHeaderReader.getChargingStationAddress(context.getMessageContext()); if (chargingStationAddress == null || chargingStationAddress.isEmpty()) { BootNotificationResponse response = new BootNotificationResponse(); response.setStatus(RegistrationStatus.REJECTED); response.setHeartbeatInterval(heartbeatIntervalFallback); response.setCurrentTime(new Date()); return response; } AttributeMap<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.CHARGING_STATION_ADDRESS, chargingStationAddress). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, request.getChargePointVendor()). putIfValueNotNull(AttributeMapKeys.MODEL, request.getChargePointModel()). putIfValueNotNull(AttributeMapKeys.CHARGING_STATION_SERIAL_NUMBER, request.getChargePointSerialNumber()). putIfValueNotNull(AttributeMapKeys.CHARGE_BOX_SERIAL_NUMBER, request.getChargeBoxSerialNumber()). putIfValueNotNull(AttributeMapKeys.FIRMWARE_VERSION, request.getFirmwareVersion()). putIfValueNotNull(AttributeMapKeys.ICCID, request.getIccid()). putIfValueNotNull(AttributeMapKeys.IMSI, request.getImsi()). putIfValueNotNull(AttributeMapKeys.METER_TYPE, request.getMeterType()). putIfValueNotNull(AttributeMapKeys.METER_SERIAL_NUMBER, request.getMeterSerialNumber()); BootChargingStationResult result = domainService.bootChargingStation(chargingStationId, PROTOCOL_IDENTIFIER, attributes, addOnIdentity); BootNotificationResponse response = new BootNotificationResponse(); response.setStatus(result.isAccepted() ? RegistrationStatus.ACCEPTED : RegistrationStatus.REJECTED); response.setHeartbeatInterval(result.getHeartbeatInterval()); response.setCurrentTime(result.getTimeStamp()); return response; }  @Override AuthorizeResponse authorize(final AuthorizeRequest request, final String chargeBoxIdentity); @Override BootNotificationResponse bootNotification(BootNotificationRequest request, String chargeBoxIdentity); @Override DiagnosticsStatusNotificationResponse diagnosticsStatusNotification(DiagnosticsStatusNotificationRequest request, String chargeBoxIdentity); @Override FirmwareStatusNotificationResponse firmwareStatusNotification(FirmwareStatusNotificationRequest request, String chargeBoxIdentity); @Override HeartbeatResponse heartbeat(HeartbeatRequest parameters, String chargeBoxIdentity); @Override MeterValuesResponse meterValues(MeterValuesRequest request, String chargeBoxIdentity); @Override StartTransactionResponse startTransaction(final StartTransactionRequest parameters, final String chargeBoxIdentity); @Override StatusNotificationResponse statusNotification(StatusNotificationRequest request, String chargeBoxIdentity); @Override StopTransactionResponse stopTransaction(StopTransactionRequest request, String chargeBoxIdentity); void setDomainService(DomainService domainService); void setContext(WebServiceContext context); void setContinuationTimeout(int continuationTimeout); void setHeartbeatIntervalFallback(int heartbeatIntervalFallback); void setSoapHeaderReader(SoapHeaderReader soapHeaderReader); void setAddOnId(String id);  }