From aeb560b9eb988960e2964c4e329899723dd70891 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 11 Oct 2021 21:15:58 -0700 Subject: Support Hoopo platform API --- .../traccar/protocol/HoopoProtocolDecoderTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/java/org/traccar/protocol/HoopoProtocolDecoderTest.java (limited to 'src/test') diff --git a/src/test/java/org/traccar/protocol/HoopoProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/HoopoProtocolDecoderTest.java new file mode 100644 index 000000000..37f838dd4 --- /dev/null +++ b/src/test/java/org/traccar/protocol/HoopoProtocolDecoderTest.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 HoopoProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + var decoder = new HoopoProtocolDecoder(null); + + verifyPosition(decoder, request(HttpMethod.POST, "/", + buffer("{ \"deviceId\": \"BCCD0654\", \"assetName\": \"BCCD0654\", \"assetType\": \"???? ?????? - ??? 8\", \"eventData\": { \"latitude\": 31.97498, \"longitude\": 34.80802, \"locationName\": \"\", \"accuracyLevel\": \"High\", \"eventType\": \"Arrival\", \"batteryLevel\": 100, \"receiveTime\": \"2021-09-20T18:52:32Z\" }, \"eventTime\": \"2021-09-20T08:52:02Z\", \"serverReportTime\": \"0001-01-01T00:00:00Z\" }"))); + + } + +} -- cgit v1.2.3