From 7e2ed343d2a6a03938c3f074417464c63d31fd59 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 17 Sep 2018 15:50:19 +1200 Subject: Remove joda time library --- test/org/traccar/protocol/H02ProtocolEncoderTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test') 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 { -- cgit v1.2.3