|
19 | 19 | package de.rwth.idsg.steve.certification.ocpp16; |
20 | 20 |
|
21 | 21 | import de.rwth.idsg.steve.ocpp.OcppVersion; |
| 22 | +import de.rwth.idsg.steve.utils.Helpers; |
22 | 23 | import de.rwth.idsg.steve.utils.OcppJsonChargePoint; |
23 | 24 | import de.rwth.idsg.steve.utils.__DatabasePreparer__; |
24 | 25 | import de.rwth.idsg.steve.web.dto.RestCallback; |
|
38 | 39 | import ocpp.cs._2015._10.StopTransactionRequest; |
39 | 40 | import org.jetbrains.annotations.Nullable; |
40 | 41 | import org.joda.time.DateTime; |
| 42 | +import org.springframework.beans.factory.annotation.Autowired; |
| 43 | +import org.springframework.boot.web.server.autoconfigure.ServerProperties; |
41 | 44 |
|
42 | 45 | import java.util.List; |
43 | 46 | import java.util.concurrent.CompletableFuture; |
|
51 | 54 | @Slf4j |
52 | 55 | public abstract class AbstractOcpp16JsonCsms { |
53 | 56 |
|
54 | | - static final String PATH = "ws://localhost:8080/steve/websocket/CentralSystemService/"; |
55 | | - |
56 | 57 | static final String REGISTERED_CHARGE_BOX_ID = __DatabasePreparer__.getRegisteredChargeBoxId(); |
57 | 58 | static final String REGISTERED_OCPP_TAG = __DatabasePreparer__.getRegisteredOcppTag(); |
58 | 59 |
|
59 | 60 | static final String CPO_NAME = "SteVe-CPO"; |
60 | 61 |
|
| 62 | + @Autowired |
| 63 | + ServerProperties serverProperties; |
| 64 | + |
61 | 65 | static BootNotificationRequest bootNotification() { |
62 | 66 | return new BootNotificationRequest() |
63 | 67 | .withChargePointVendor(getRandomString()) |
@@ -183,8 +187,8 @@ static StartTransactionResponse enterChargingState(OcppJsonChargePoint chargePoi |
183 | 187 | return startTransactionResponse; |
184 | 188 | } |
185 | 189 |
|
186 | | - static OcppJsonChargePoint defaultStation() { |
187 | | - return new OcppJsonChargePoint(OcppVersion.V_16, REGISTERED_CHARGE_BOX_ID, PATH); |
| 190 | + OcppJsonChargePoint defaultStation() { |
| 191 | + return new OcppJsonChargePoint(OcppVersion.V_16, REGISTERED_CHARGE_BOX_ID, Helpers.getJsonPath(serverProperties)); |
188 | 192 | } |
189 | 193 |
|
190 | 194 | @FunctionalInterface |
|
0 commit comments