diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java b/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java index c11670cae..30ae95d03 100644 --- a/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java @@ -1,5 +1,6 @@ package org.traccar.protocol; +import org.jboss.netty.handler.codec.http.HttpMethod; import org.junit.Test; import org.traccar.ProtocolTest; @@ -10,16 +11,11 @@ public class OwnTracksProtocolDecoderTest extends ProtocolTest { OwnTracksProtocolDecoder decoder = new OwnTracksProtocolDecoder(new OwnTracksProtocol()); -/* - * I don'w know how to get JSON into that ... - * - verifyNull(decoder, request( - "{ \"id\" : \"hello\" }")); + verifyPosition(decoder, request(HttpMethod.POST, "/", + buffer(text("{\"lon\":2.29513,\"lat\":48.85833,\"tst\":1497349316,\"_type\":\"location\",\"tid\":\"JJ\"}")))); - verifyPosition(decoder, request( - "{\"cog\":271,\"lon\":2.29513,\"acc\":5,\"vel\":61,\"vac\":21,\"lat\":48.85833,\"tst\":1497349316,\"alt\":167,\"_type\":\"location\",\"tid\":\"JJ\"}")); - -*/ + verifyPosition(decoder, request(HttpMethod.POST, "/", + buffer(text("{\"cog\":271,\"lon\":2.29513,\"acc\":5,\"vel\":61,\"vac\":21,\"lat\":48.85833,\"tst\":1497349316,\"alt\":167,\"_type\":\"location\",\"tid\":\"JJ\",\"t\":\"u\",\"batt\":67}")))); } |