@Test public void unlockConnectorVerifyServiceCall() { when(chargePointService.unlockConnector(any(UnlockConnectorRequest.class), eq(CHARGING_STATION_ID.getId()))).thenReturn(getUnlockConnectorResponse(UnlockStatus.ACCEPTED)); ArgumentCaptor<UnlockConnectorRequest> unlockConnectorArgument = ArgumentCaptor.forClass(UnlockConnectorRequest.class); client.unlockConnector(CHARGING_STATION_ID, EVSE_ID); verify(chargePointService).unlockConnector(unlockConnectorArgument.capture(), eq(CHARGING_STATION_ID.getId())); assertEquals(Integer.parseInt(EVSE_ID.getId()), unlockConnectorArgument.getValue().getConnectorId()); }
@Override public RequestResult unlockConnector(ChargingStationId id, EvseId evseId) { LOG.debug("Unlocking of connector {} on {}", evseId, id); ChargePointService chargePointService = this.createChargingStationService(id); UnlockConnectorRequest request = new UnlockConnectorRequest(); request.setConnectorId(evseId.getNumberedId()); UnlockConnectorResponse response = chargePointService.unlockConnector(request, id.getId()); if (UnlockStatus.ACCEPTED.equals(response.getStatus())) { LOG.info("Unlocking of connector {} on {} has been accepted", evseId, id); return RequestResult.SUCCESS; } else { LOG.warn("Unlocking of connector {} on {} has been rejected", evseId, id); return RequestResult.FAILURE; } }
ChargingStationOcpp12SoapClient implements ChargingStationOcpp12Client { @Override public RequestResult unlockConnector(ChargingStationId id, EvseId evseId) { LOG.debug("Unlocking of connector {} on {}", evseId, id); ChargePointService chargePointService = this.createChargingStationService(id); UnlockConnectorRequest request = new UnlockConnectorRequest(); request.setConnectorId(evseId.getNumberedId()); UnlockConnectorResponse response = chargePointService.unlockConnector(request, id.getId()); if (UnlockStatus.ACCEPTED.equals(response.getStatus())) { LOG.info("Unlocking of connector {} on {} has been accepted", evseId, id); return RequestResult.SUCCESS; } else { LOG.warn("Unlocking of connector {} on {} has been rejected", evseId, id); return RequestResult.FAILURE; } } }
ChargingStationOcpp12SoapClient implements ChargingStationOcpp12Client { @Override public RequestResult unlockConnector(ChargingStationId id, EvseId evseId) { LOG.debug("Unlocking of connector {} on {}", evseId, id); ChargePointService chargePointService = this.createChargingStationService(id); UnlockConnectorRequest request = new UnlockConnectorRequest(); request.setConnectorId(evseId.getNumberedId()); UnlockConnectorResponse response = chargePointService.unlockConnector(request, id.getId()); if (UnlockStatus.ACCEPTED.equals(response.getStatus())) { LOG.info("Unlocking of connector {} on {} has been accepted", evseId, id); return RequestResult.SUCCESS; } else { LOG.warn("Unlocking of connector {} on {} has been rejected", evseId, id); return RequestResult.FAILURE; } }  }
ChargingStationOcpp12SoapClient implements ChargingStationOcpp12Client { @Override public RequestResult unlockConnector(ChargingStationId id, EvseId evseId) { LOG.debug("Unlocking of connector {} on {}", evseId, id); ChargePointService chargePointService = this.createChargingStationService(id); UnlockConnectorRequest request = new UnlockConnectorRequest(); request.setConnectorId(evseId.getNumberedId()); UnlockConnectorResponse response = chargePointService.unlockConnector(request, id.getId()); if (UnlockStatus.ACCEPTED.equals(response.getStatus())) { LOG.info("Unlocking of connector {} on {} has been accepted", evseId, id); return RequestResult.SUCCESS; } else { LOG.warn("Unlocking of connector {} on {} has been rejected", evseId, id); return RequestResult.FAILURE; } }  @Override boolean startTransaction(ChargingStationId id, IdentifyingToken identifyingToken, EvseId evseId); @Override boolean stopTransaction(ChargingStationId id, int transactionId); @Override boolean softReset(ChargingStationId id); @Override boolean hardReset(ChargingStationId id); @Override RequestResult unlockConnector(ChargingStationId id, EvseId evseId); @Override RequestResult changeAvailabilityToInoperative(ChargingStationId id, EvseId evseId); @Override RequestResult changeAvailabilityToOperative(ChargingStationId id, EvseId evseId); @Override boolean changeConfiguration(ChargingStationId id, ConfigurationItem configurationItem); @Override String getDiagnostics(ChargingStationId id, DiagnosticsUploadSettings diagnosticsUploadSettings); @Override boolean clearCache(ChargingStationId id); @Override void updateFirmware(ChargingStationId id, String downloadLocation, Date retrieveDate, Integer numRetries, Integer retryInterval); void setDomainService(DomainService domainService); void setChargingStationProxyFactory(ChargingStationProxyFactory chargingStationProxyFactory); }
ChargingStationOcpp12SoapClient implements ChargingStationOcpp12Client { @Override public RequestResult unlockConnector(ChargingStationId id, EvseId evseId) { LOG.debug("Unlocking of connector {} on {}", evseId, id); ChargePointService chargePointService = this.createChargingStationService(id); UnlockConnectorRequest request = new UnlockConnectorRequest(); request.setConnectorId(evseId.getNumberedId()); UnlockConnectorResponse response = chargePointService.unlockConnector(request, id.getId()); if (UnlockStatus.ACCEPTED.equals(response.getStatus())) { LOG.info("Unlocking of connector {} on {} has been accepted", evseId, id); return RequestResult.SUCCESS; } else { LOG.warn("Unlocking of connector {} on {} has been rejected", evseId, id); return RequestResult.FAILURE; } }  @Override boolean startTransaction(ChargingStationId id, IdentifyingToken identifyingToken, EvseId evseId); @Override boolean stopTransaction(ChargingStationId id, int transactionId); @Override boolean softReset(ChargingStationId id); @Override boolean hardReset(ChargingStationId id); @Override RequestResult unlockConnector(ChargingStationId id, EvseId evseId); @Override RequestResult changeAvailabilityToInoperative(ChargingStationId id, EvseId evseId); @Override RequestResult changeAvailabilityToOperative(ChargingStationId id, EvseId evseId); @Override boolean changeConfiguration(ChargingStationId id, ConfigurationItem configurationItem); @Override String getDiagnostics(ChargingStationId id, DiagnosticsUploadSettings diagnosticsUploadSettings); @Override boolean clearCache(ChargingStationId id); @Override void updateFirmware(ChargingStationId id, String downloadLocation, Date retrieveDate, Integer numRetries, Integer retryInterval); void setDomainService(DomainService domainService); void setChargingStationProxyFactory(ChargingStationProxyFactory chargingStationProxyFactory);  }