aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-10-21 20:26:45 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-10-21 20:26:45 -0700
commit36bcdfc80dc19bc932f03bc8a0da056f46023304 (patch)
treecdee146ba681fdaa3ce262026d28cd0d7ba7f550 /src/test/java/org/traccar/protocol
parent7f1cb863872c01aaf7defa8164940b729eb86b77 (diff)
downloadtrackermap-server-36bcdfc80dc19bc932f03bc8a0da056f46023304.tar.gz
trackermap-server-36bcdfc80dc19bc932f03bc8a0da056f46023304.tar.bz2
trackermap-server-36bcdfc80dc19bc932f03bc8a0da056f46023304.zip
Expect TCP JSON data
Diffstat (limited to 'src/test/java/org/traccar/protocol')
-rw-r--r--src/test/java/org/traccar/protocol/HoopoProtocolDecoderTest.java5
-rw-r--r--src/test/java/org/traccar/protocol/JsonFrameDecoderTest.java (renamed from src/test/java/org/traccar/protocol/StbFrameDecoderTest.java)4
2 files changed, 4 insertions, 5 deletions
diff --git a/src/test/java/org/traccar/protocol/HoopoProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/HoopoProtocolDecoderTest.java
index 37f838dd4..35d0f1423 100644
--- a/src/test/java/org/traccar/protocol/HoopoProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/HoopoProtocolDecoderTest.java
@@ -1,6 +1,5 @@
package org.traccar.protocol;
-import io.netty.handler.codec.http.HttpMethod;
import org.junit.Test;
import org.traccar.ProtocolTest;
@@ -11,8 +10,8 @@ public class HoopoProtocolDecoderTest extends ProtocolTest {
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\" }")));
+ verifyPosition(decoder, text(
+ "{ \"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\" }"));
}
diff --git a/src/test/java/org/traccar/protocol/StbFrameDecoderTest.java b/src/test/java/org/traccar/protocol/JsonFrameDecoderTest.java
index 45d998fb1..42777e419 100644
--- a/src/test/java/org/traccar/protocol/StbFrameDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/JsonFrameDecoderTest.java
@@ -3,12 +3,12 @@ package org.traccar.protocol;
import org.junit.Test;
import org.traccar.ProtocolTest;
-public class StbFrameDecoderTest extends ProtocolTest {
+public class JsonFrameDecoderTest extends ProtocolTest {
@Test
public void testDecode() throws Exception {
- var decoder = new StbFrameDecoder();
+ var decoder = new JsonFrameDecoder();
verifyFrame(
binary("7b226465764964223a2243485a4430384b504430323130343235303436222c2264657654797065223a322c226861726456657273696f6e223a224844545456413139222c226d736754797065223a3131302c2270726f746f636f6c56657273696f6e223a225631222c22736f667456657273696f6e223a22332e312e38222c22737769746368436162537461747573223a2231222c2274786e4e6f223a2231363235323132373431353337227d"),