aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/traccar')
-rw-r--r--src/test/java/org/traccar/protocol/AppletProtocolDecoderTest.java27
-rw-r--r--src/test/java/org/traccar/protocol/LacakProtocolDecoderTest.java19
2 files changed, 19 insertions, 27 deletions
diff --git a/src/test/java/org/traccar/protocol/AppletProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/AppletProtocolDecoderTest.java
deleted file mode 100644
index 11c9c65d8..000000000
--- a/src/test/java/org/traccar/protocol/AppletProtocolDecoderTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.traccar.protocol;
-
-import io.netty.handler.codec.http.DefaultHttpHeaders;
-import io.netty.handler.codec.http.HttpMethod;
-import org.junit.Test;
-import org.traccar.ProtocolTest;
-
-public class AppletProtocolDecoderTest extends ProtocolTest {
-
- @Test
- public void testDecode() throws Exception {
-
- var decoder = new AppletProtocolDecoder(null);
-
- DefaultHttpHeaders headers = new DefaultHttpHeaders();
-
- headers.add("HOST", "192.168.0.1:8080");
- headers.add("X-Admin-Protocol", "globalplatform-remote-admin/1.0");
- headers.add("X-Admin-From", "8943170080001406197F");
- headers.add("User-Agent", "oma-scws-admin-agent/1.1");
- headers.add("From", "8943170080001406197F");
-
- verifyNull(decoder, request(HttpMethod.POST, "/pli?=", headers));
-
- }
-
-}
diff --git a/src/test/java/org/traccar/protocol/LacakProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/LacakProtocolDecoderTest.java
new file mode 100644
index 000000000..c407d1e64
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/LacakProtocolDecoderTest.java
@@ -0,0 +1,19 @@
+package org.traccar.protocol;
+
+import io.netty.handler.codec.http.HttpMethod;
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class LacakProtocolDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ var decoder = new LacakProtocolDecoder(null);
+
+ verifyPosition(decoder, request(HttpMethod.POST, "/",
+ buffer("{\"location\":{\"event\":\"motionchange\",\"is_moving\":false,\"uuid\":\"0e9a2473-a9a7-4c00-997b-fb97d2154e75\",\"timestamp\":\"2021-07-21T08:06:34.444Z\",\"odometer\":0,\"coords\":{\"latitude\":-6.1148096,\"longitude\":106.6837015,\"accuracy\":3.8,\"speed\":18.67,\"speed_accuracy\":0.26,\"heading\":63,\"heading_accuracy\":0.28,\"altitude\":35.7,\"altitude_accuracy\":3.8},\"activity\":{\"type\":\"still\",\"confidence\":100},\"battery\":{\"is_charging\":false,\"level\":0.79},\"extras\":{}},\"device_id\":\"8737767034\"}")));
+
+ }
+
+}