Skip to content

Commit 7b7af1f

Browse files
committed
Fix OCPP V2.0 BootNotificationSpec test
Commit 48743c9 changed the serialization of ZonedDateTime objects, losing the timezone information. However, the BootNotification test compares the original object against the serialized and deserialized object, which no longer matches when the test machine is configured to a local timezone other than UTC. Fix the test to take timestamps with UTC timezone so that they can match ZonedDateTime objects resulting from serialization and deserialization.
1 parent b797981 commit 7b7af1f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ocpp-v2_0-test/src/main/java/eu/chargetime/ocpp/test/features/BootNotification.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ of this software and associated documentation files (the "Software"), to deal
3434
import eu.chargetime.ocpp.model.basic.types.BootReasonEnumType;
3535
import eu.chargetime.ocpp.model.basic.types.ChargingStationType;
3636
import eu.chargetime.ocpp.model.basic.types.RegistrationStatusEnumType;
37+
import java.time.ZoneOffset;
3738
import java.time.ZonedDateTime;
3839
import java.util.UUID;
3940

@@ -45,7 +46,7 @@ public BootNotification() {
4546
feature = new BootNotificationFeature(this);
4647

4748
confirmation = new BootNotificationConfirmation();
48-
ZonedDateTime calendar = ZonedDateTime.now();
49+
ZonedDateTime calendar = ZonedDateTime.now(ZoneOffset.UTC);
4950
confirmation.setCurrentTime(calendar);
5051
confirmation.setInterval(42);
5152
confirmation.setStatus(RegistrationStatusEnumType.Accepted);

0 commit comments

Comments
 (0)