aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-03-06 19:03:41 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-03-06 19:03:41 -0800
commit4e68a40c77240800dce14094b4cc55907410c208 (patch)
tree3fb0176342a47facfb31e143dcf580036fdba1e2 /test
parent15f0744893304a3f2a77d36734cdc2a2706286dd (diff)
downloadtrackermap-server-4e68a40c77240800dce14094b4cc55907410c208.tar.gz
trackermap-server-4e68a40c77240800dce14094b4cc55907410c208.tar.bz2
trackermap-server-4e68a40c77240800dce14094b4cc55907410c208.zip
Fix OwnTracks decoder
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/ProtocolTest.java1
-rw-r--r--test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java3
2 files changed, 4 insertions, 0 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java
index 181af885d..4d48bb763 100644
--- a/test/org/traccar/ProtocolTest.java
+++ b/test/org/traccar/ProtocolTest.java
@@ -173,6 +173,7 @@ public class ProtocolTest extends BaseTest {
} else {
+ assertNotNull(position.getServerTime());
assertNotNull(position.getFixTime());
assertTrue("year > 1999", position.getFixTime().after(new Date(915148800000L)));
assertTrue("time < +25 hours",
diff --git a/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java b/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java
index 553e7eb16..248920e21 100644
--- a/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java
@@ -12,6 +12,9 @@ public class OwnTracksProtocolDecoderTest extends ProtocolTest {
OwnTracksProtocolDecoder decoder = new OwnTracksProtocolDecoder(null);
verifyPosition(decoder, request(HttpMethod.POST, "/",
+ buffer("{\"_type\":\"location\",\"acc\":15,\"alt\":440,\"batt\":46,\"conn\":\"w\",\"lat\":46.0681247,\"lon\":11.1512805,\"t\":\"u\",\"tid\":\"5t\",\"tst\":1551874878,\"vac\":2,\"vel\":0}")));
+
+ verifyPosition(decoder, request(HttpMethod.POST, "/",
buffer("{\"lon\":2.29513,\"lat\":48.85833,\"tst\":1497349316,\"_type\":\"location\",\"tid\":\"JJ\"}")));
verifyPosition(decoder, request(HttpMethod.POST, "/",