Skip to content

Commit

Permalink
Created integration test to provoke possible bug #71
Browse files Browse the repository at this point in the history
  • Loading branch information
TVolden committed Jul 11, 2018
1 parent 700d51e commit e0f87cc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,17 @@ public void sendRemoteStartTransactionRequest(int connectorId, String idTag) thr
send(request);
}

public void sendRemoteStartTransactionWithProfileRequest(int connectorId, String idTag) throws Exception {
RemoteStartTransactionRequest request = new RemoteStartTransactionRequest();
request.setIdTag(idTag);
request.setConnectorId(connectorId);

ChargingSchedule schedule = new ChargingSchedule(ChargingRateUnitType.A, new ChargingSchedulePeriod[]{new ChargingSchedulePeriod(1, 32d)});
ChargingProfile profile = new ChargingProfile(1, 1, ChargingProfilePurposeType.ChargePointMaxProfile, ChargingProfileKindType.Recurring, schedule);
request.setChargingProfile(profile);
send(request);
}

public boolean hasReceivedRemoteStartTransactionConfirmation(String status) {
boolean result = false;
RemoteStartTransactionConfirmation confirmation = dummyHandlers.getReceivedConfirmation(new RemoteStartTransactionConfirmation());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,21 @@ class JSONRemoteStartTransactionSpec extends JSONBaseSpec {
assert centralSystem.hasReceivedRemoteStartTransactionConfirmation("Accepted")
}
}

def "Central System sends a RemoteStartTransaction with charging profile request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
given:
conditions.eventually {
assert centralSystem.connected()
}

when:
centralSystem.sendRemoteStartTransactionWithProfileRequest(1, "some id")

then:
conditions.eventually {
assert chargePoint.hasHandledRemoteStartTransactionRequest()
assert centralSystem.hasReceivedRemoteStartTransactionConfirmation("Accepted")
}
}
}

0 comments on commit e0f87cc

Please sign in to comment.