aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-05-21 06:41:44 -0700
committerAnton Tananaev <anton@traccar.org>2024-05-21 06:41:44 -0700
commitc2c27617fa4392c3a25a6c4ad62bd24060f1c0c1 (patch)
tree537f577aa32a5e7c484b4afb0b5c02c1b35eaab3 /src/test/java
parent445a2c5d0763bb42880ff1f9db93d755f6fdfa62 (diff)
downloadtrackermap-server-c2c27617fa4392c3a25a6c4ad62bd24060f1c0c1.tar.gz
trackermap-server-c2c27617fa4392c3a25a6c4ad62bd24060f1c0c1.tar.bz2
trackermap-server-c2c27617fa4392c3a25a6c4ad62bd24060f1c0c1.zip
Handle Snapper protocol ping
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/traccar/protocol/SnapperFrameDecoderTest.java23
-rw-r--r--src/test/java/org/traccar/protocol/SnapperProtocolDecoderTest.java3
2 files changed, 26 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/SnapperFrameDecoderTest.java b/src/test/java/org/traccar/protocol/SnapperFrameDecoderTest.java
new file mode 100644
index 000000000..260a18032
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/SnapperFrameDecoderTest.java
@@ -0,0 +1,23 @@
+package org.traccar.protocol;
+
+import org.junit.jupiter.api.Test;
+import org.traccar.ProtocolTest;
+
+public class SnapperFrameDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ var decoder = inject(new SnapperFrameDecoder());
+
+ verifyFrame(
+ binary("4b0341a6b0c608000040000005000000000000007d5e14010068656c6c6f"),
+ decoder.decode(null, null, binary("4b0341a6b0c608000040000005000000000000007d5e14010068656c6c6f")));
+
+ verifyFrame(
+ binary("5012"),
+ decoder.decode(null, null, binary("5012")));
+
+ }
+
+}
diff --git a/src/test/java/org/traccar/protocol/SnapperProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/SnapperProtocolDecoderTest.java
index bb79194eb..43df24316 100644
--- a/src/test/java/org/traccar/protocol/SnapperProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/SnapperProtocolDecoderTest.java
@@ -22,6 +22,9 @@ public class SnapperProtocolDecoderTest extends ProtocolTest {
verifyPosition(decoder, binary(
"4b044daff87aff5b8aad0000430100000000bb870c005b37000500210008003e0100ffffffff7f2300190000007f000000018080000002deff080003404000000400000034008c007b2273223a22303034303438222c226332223a2230303030303030303030303030303030222c226132223a2230303030303030303030303030303030222c226f223a2230303030222c2274223a2230303030222c227a223a223030222c2277223a223030222c2272223a222d222c226d223a223030303030303030222c2262223a223030303030303030227d320079007b2266223a224445222c2274223a22303832303335222c2264223a22313730343234222c226c61223a22353334312e34323635222c226c6f223a2230303935342e30373935222c2261223a22362e32222c2273223a22322e3237222c2263223a2233302e3135222c227376223a223038222c2270223a22227d330007007b2262223a5d7d"));
+ verifyNull(decoder, binary(
+ "5003"));
+
}
}