aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-08-27 14:56:45 -0700
committerAnton Tananaev <anton@traccar.org>2023-08-27 14:56:45 -0700
commit88bff45bd959ec932e00db9b3642e337abbcf1be (patch)
treeb4774b0121a01d3ae09d35ccaaf74396752d0e0a /src/test/java/org/traccar
parentf7ad63b6f898a38d97fe2e200c688d04c2b051ff (diff)
downloadtrackermap-server-88bff45bd959ec932e00db9b3642e337abbcf1be.tar.gz
trackermap-server-88bff45bd959ec932e00db9b3642e337abbcf1be.tar.bz2
trackermap-server-88bff45bd959ec932e00db9b3642e337abbcf1be.zip
Positioning Universal PUI Enterprise
Diffstat (limited to 'src/test/java/org/traccar')
-rw-r--r--src/test/java/org/traccar/protocol/PuiProtocolDecoderTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/PuiProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/PuiProtocolDecoderTest.java
new file mode 100644
index 000000000..41568d0c1
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/PuiProtocolDecoderTest.java
@@ -0,0 +1,23 @@
+package org.traccar.protocol;
+
+import io.netty.handler.codec.mqtt.MqttMessageBuilders;
+import io.netty.handler.codec.mqtt.MqttQoS;
+import org.junit.jupiter.api.Test;
+import org.traccar.ProtocolTest;
+
+public class PuiProtocolDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ var decoder = inject(new PuiProtocolDecoder(null));
+
+ verifyNull(decoder, MqttMessageBuilders.connect().clientId(
+ "123456789012345").build());
+
+ verifyPosition(decoder, MqttMessageBuilders.publish().payload(buffer(
+ "{ \"id\": \"015262001044848\", \"ts\": \"20190109T021918.312Z\", \"rpt\": \"hf\", \"location\": { \"lat\": 33.91233, \"lon\": -84.20784 }, \"bear\": 70, \"spd\": 2482, \"ign\": \"on\" }")).qos(MqttQoS.EXACTLY_ONCE).messageId(1).build());
+
+ }
+
+}