Skip to content

Commit b683646

Browse files
committed
Added connection check to integration test.
1 parent fc5cdc7 commit b683646

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/FakeCentralSystem.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
import eu.chargetime.ocpp.model.Confirmation;
1212
import eu.chargetime.ocpp.model.Request;
1313
import eu.chargetime.ocpp.model.core.*;
14-
import eu.chargetime.ocpp.model.smartcharging.SetChargingProfileConfirmation;
15-
import eu.chargetime.ocpp.model.smartcharging.SetChargingProfileRequest;
1614

1715
import java.util.Calendar;
1816
import java.util.UUID;
@@ -72,6 +70,10 @@ private <T extends Confirmation> T failurePoint(T confirmation) {
7270
return confirmation;
7371
}
7472

73+
public boolean connected() {
74+
return currentIdentifier != null;
75+
}
76+
7577
public enum serverType {JSON, SOAP}
7678

7779
public void started() throws Exception

ocpp-v1_6-test/src/test/groovy/eu/chargetime/ocpp/test/core/json/JSONRemoteStartTransactionSpec.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ class JSONRemoteStartTransactionSpec extends Specification {
2727

2828
def "Central System sends a RemoteStartTransaction request and receives a response"() {
2929
def conditions = new PollingConditions(timeout: 1)
30+
given:
31+
conditions.eventually {
32+
assert centralSystem.connected()
33+
}
34+
3035
when:
3136
centralSystem.sendRemoteStartTransactionRequest(1, "some id")
3237

ocpp-v1_6-test/src/test/groovy/eu/chargetime/ocpp/test/core/json/JSONRemoteStopTransactionSpec.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ class JSONRemoteStopTransactionSpec extends Specification {
2727

2828
def "Central System sends a RemoteStopTransaction request and receives a response"() {
2929
def conditions = new PollingConditions(timeout: 1)
30+
given:
31+
conditions.eventually {
32+
assert centralSystem.connected()
33+
}
34+
3035
when:
3136
centralSystem.sendRemoteStopTransactionRequest(0)
3237

0 commit comments

Comments
 (0)