aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/ProtocolTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2022-01-15 23:20:48 -0800
committerGitHub <noreply@github.com>2022-01-15 23:20:48 -0800
commit4f30409c3bf1c2ea70823eb45bdf43bc5a4b6ad1 (patch)
treeecdad61979167b4fc605ba2ec4420709b5c1b0fd /src/test/java/org/traccar/ProtocolTest.java
parent839751e76e329adb573150644bd6198beba0d3b6 (diff)
parent0ce163ba62cc991fee56d9c05fca41c9f7a28143 (diff)
downloadtrackermap-server-4f30409c3bf1c2ea70823eb45bdf43bc5a4b6ad1.tar.gz
trackermap-server-4f30409c3bf1c2ea70823eb45bdf43bc5a4b6ad1.tar.bz2
trackermap-server-4f30409c3bf1c2ea70823eb45bdf43bc5a4b6ad1.zip
Merge pull request #4797 from traccar/polling
Implement polling protocol support
Diffstat (limited to 'src/test/java/org/traccar/ProtocolTest.java')
-rw-r--r--src/test/java/org/traccar/ProtocolTest.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/ProtocolTest.java b/src/test/java/org/traccar/ProtocolTest.java
index c40a15dcc..353593c29 100644
--- a/src/test/java/org/traccar/ProtocolTest.java
+++ b/src/test/java/org/traccar/ProtocolTest.java
@@ -4,9 +4,11 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import io.netty.handler.codec.http.DefaultFullHttpRequest;
+import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.DefaultHttpHeaders;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpMethod;
+import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpVersion;
import org.traccar.helper.DataConverter;
import org.traccar.model.CellTower;
@@ -89,6 +91,10 @@ public class ProtocolTest extends BaseTest {
return new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, method, url, Unpooled.buffer(), headers, new DefaultHttpHeaders());
}
+ protected DefaultFullHttpResponse response(ByteBuf data) {
+ return new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, data);
+ }
+
protected void verifyNotNull(BaseProtocolDecoder decoder, Object object) throws Exception {
assertNotNull(decoder.decode(null, null, object));
}