diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/org/traccar/protocol/H02ProtocolEncoderTest.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/org/traccar/protocol/H02ProtocolEncoderTest.java b/test/org/traccar/protocol/H02ProtocolEncoderTest.java index e7b409a88..e022a7b7e 100644 --- a/test/org/traccar/protocol/H02ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolEncoderTest.java @@ -1,16 +1,22 @@ package org.traccar.protocol; -import org.joda.time.DateTime; import org.junit.Test; import org.traccar.ProtocolTest; import org.traccar.model.Command; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneOffset; +import java.util.Date; + import static org.junit.Assert.assertEquals; public class H02ProtocolEncoderTest extends ProtocolTest { private H02ProtocolEncoder encoder = new H02ProtocolEncoder(); - private DateTime time = new DateTime().withHourOfDay(1).withMinuteOfHour(2).withSecondOfMinute(3); + private Date time = Date.from( + LocalDateTime.of(LocalDate.now(), LocalTime.of(1, 2, 3)).atZone(ZoneOffset.systemDefault()).toInstant()); @Test public void testAlarmArmEncode() throws Exception { |