diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2023-07-27 09:14:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 09:14:41 -0700 |
commit | 2561c3340719089518ef095dd7497c660351eb64 (patch) | |
tree | 90ab76819e7e3eaa4ea2bb4cda02ffec085868e6 /src/test | |
parent | 413d9a49c41a27a221f2350e5cd4864c1231bb50 (diff) | |
parent | 1dfc61e3e981a23060d02c46451b19a600a87fa0 (diff) | |
download | trackermap-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.java | 23 |
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")); + } +} |