aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-10-08 17:47:34 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-10-08 17:47:34 -0700
commit8f8d013c9d871eba003bcf34cb62f9d48fb3ee20 (patch)
tree84e98ba73b05841ed9f9f0660c0b1b24024fb8c9 /src/test/java/org/traccar
parent60811fc34a6cc4f27f4a59f9e2df027268ada6c7 (diff)
downloadtrackermap-server-8f8d013c9d871eba003bcf34cb62f9d48fb3ee20.tar.gz
trackermap-server-8f8d013c9d871eba003bcf34cb62f9d48fb3ee20.tar.bz2
trackermap-server-8f8d013c9d871eba003bcf34cb62f9d48fb3ee20.zip
Implement Polte API support
Diffstat (limited to 'src/test/java/org/traccar')
-rw-r--r--src/test/java/org/traccar/protocol/PolteProtocolDecoderTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/PolteProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/PolteProtocolDecoderTest.java
new file mode 100644
index 000000000..61ee6771f
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/PolteProtocolDecoderTest.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 PolteProtocolDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ PolteProtocolDecoder decoder = new PolteProtocolDecoder(null);
+
+ verifyPosition(decoder, request(HttpMethod.POST, "/",
+ buffer("{\"_id\":\"5f75cf7b02c5023bfc0beaf7\",\"location\":{\"LocationMetrics\":{\"EnvironmentDensity\":1,\"LocationType\":2,\"carrierInfo\":{\"aux\":{\"PLMN\":\"310410\",\"country\":\"United States\",\"name\":\"ATT Wireless Inc\"},\"crs\":{\"PLMN\":\"310410\",\"country\":\"United States\",\"name\":\"ATT Wireless Inc\"}},\"hdop\":1850000,\"leversion\":\"2.2.18-20200729T140651\",\"towercount\":1},\"altitude\":0.0011297669261693954,\"confidence\":783.7972188868215,\"detected_at\":1601556342,\"latitude\":29.77368956725161,\"longitude\":-98.26530342694024,\"towerDB\":\"default\",\"ueToken\":\"ALT12503DE04336CB2E3A4A113FCDE05DF05A6F\",\"uid\":\"WZuDMv5Je\"},\"report\":{\"battery\":{\"count\":555,\"level\":100,\"voltage\":3.52},\"event\":3,\"time\":\"2020-10-01T12:45:48.207Z\"},\"time\":\"2020-10-01T12:45:42Z\",\"ueToken\":\"ALT12503DE04336CB2E3A4A113FCDE05DF05A6F\",\"uid\":\"WZuDMv5Je\"}")));
+
+ }
+
+}