aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/ProtocolDecoderTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar/ProtocolDecoderTest.java')
-rw-r--r--test/org/traccar/ProtocolDecoderTest.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/org/traccar/ProtocolDecoderTest.java b/test/org/traccar/ProtocolDecoderTest.java
index f58de880a..03e8314d6 100644
--- a/test/org/traccar/ProtocolDecoderTest.java
+++ b/test/org/traccar/ProtocolDecoderTest.java
@@ -79,7 +79,8 @@ public class ProtocolDecoderTest {
Position position = new Position();
if (time != null) {
- DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
position.setTime(dateFormat.parse(time));
}
position.setValid(valid);
@@ -136,10 +137,7 @@ public class ProtocolDecoderTest {
Position position = (Position) decodedObject;
if (expected.getFixTime() != null) {
- DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
- Assert.assertEquals("time",
- dateFormat.format(expected.getFixTime()), dateFormat.format(position.getFixTime()));
+ Assert.assertEquals("time", expected.getFixTime(), position.getFixTime());
}
Assert.assertEquals("valid", expected.getValid(), position.getValid());
Assert.assertEquals("latitude", expected.getLatitude(), position.getLatitude(), 0.00001);