aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2023-07-27 09:14:41 -0700
committerGitHub <noreply@github.com>2023-07-27 09:14:41 -0700
commit2561c3340719089518ef095dd7497c660351eb64 (patch)
tree90ab76819e7e3eaa4ea2bb4cda02ffec085868e6 /src/test
parent413d9a49c41a27a221f2350e5cd4864c1231bb50 (diff)
parent1dfc61e3e981a23060d02c46451b19a600a87fa0 (diff)
downloadtrackermap-server-2561c3340719089518ef095dd7497c660351eb64.tar.gz
trackermap-server-2561c3340719089518ef095dd7497c660351eb64.tar.bz2
trackermap-server-2561c3340719089518ef095dd7497c660351eb64.zip
Merge pull request #5144 from seym45/dev
Add rollback command for Gator
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java
new file mode 100644
index 000000000..af6c71e37
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java
@@ -0,0 +1,23 @@
+package org.traccar.protocol;
+
+import org.junit.jupiter.api.Test;
+import org.traccar.ProtocolTest;
+import org.traccar.model.Command;
+import org.traccar.model.Device;
+
+import static org.mockito.Mockito.when;
+
+public class GatorProtocolEncoderTest extends ProtocolTest {
+
+ @Test
+ public void testEncode() throws Exception {
+ var encoder = inject(new GatorProtocolEncoder(null));
+ var device = encoder.getCacheManager().getObject(Device.class, 1);
+ when(device.getUniqueId()).thenReturn("13332082112");
+
+ Command command = new Command();
+ command.setDeviceId(1);
+ command.setType(Command.TYPE_POSITION_SINGLE);
+ verifyCommand(encoder, command, binary("24243000062008958C070D"));
+ }
+}