diff options
Diffstat (limited to 'src/test/java/org')
-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")); + } +} |