aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/protocol/ValtrackProtocolDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-02-22 08:02:43 -0800
committerAnton Tananaev <anton@traccar.org>2024-02-22 08:02:43 -0800
commitae0e26dde0aca09c4471bb7ec4fa3479bba5d0ad (patch)
tree95ee51496c3bba9f30054fc1ed15895a24cf35a3 /src/test/java/org/traccar/protocol/ValtrackProtocolDecoderTest.java
parent2ab6df0a53e299f5cd6ef880c70054547d07fe42 (diff)
downloadtrackermap-server-ae0e26dde0aca09c4471bb7ec4fa3479bba5d0ad.tar.gz
trackermap-server-ae0e26dde0aca09c4471bb7ec4fa3479bba5d0ad.tar.bz2
trackermap-server-ae0e26dde0aca09c4471bb7ec4fa3479bba5d0ad.zip
Implement Valtrack-V4 protocol
Diffstat (limited to 'src/test/java/org/traccar/protocol/ValtrackProtocolDecoderTest.java')
-rw-r--r--src/test/java/org/traccar/protocol/ValtrackProtocolDecoderTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/ValtrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/ValtrackProtocolDecoderTest.java
new file mode 100644
index 000000000..d526ea850
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/ValtrackProtocolDecoderTest.java
@@ -0,0 +1,19 @@
+package org.traccar.protocol;
+
+import io.netty.handler.codec.http.HttpMethod;
+import org.junit.jupiter.api.Test;
+import org.traccar.ProtocolTest;
+
+public class ValtrackProtocolDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ var decoder = inject(new ValtrackProtocolDecoder(null));
+
+ verifyPositions(decoder, request(HttpMethod.POST, "/", buffer(
+ "{\"resource\":[{\"devid\":\"869731054075783\",\"etype\":\"G_PING\",\"lat\":\"0.000000\",\"lon\":\"0.000000\",\"vbat\":\"12.263848\",\"speed\":\"\",\"nlat\":\"4255.364258\",\"nlon\":\"176.867203\",\"ncsq\":\"16,99\"},{\"devid\":\"869731054075783\",\"etype\":\"G_PING\",\"lat\":\"0.000000\",\"lon\":\"0.000000\",\"vbat\":\"12.263848\",\"speed\":\"\",\"nlat\":\"4255.364258\",\"nlon\":\"176.867203\",\"ncsq\":\"16,99\"},{\"devid\":\"869731054075783\",\"etype\":\"G_PING\",\"lat\":\"0.000000\",\"lon\":\"0.000000\",\"vbat\":\"12.263848\",\"speed\":\"\",\"nlat\":\"4255.364258\",\"nlon\":\"176.867203\",\"ncsq\":\"16,99\"}]}")));
+
+ }
+
+}