diff options
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java index af6c71e37..7938ab630 100644 --- a/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java +++ b/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java @@ -20,4 +20,19 @@ public class GatorProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_POSITION_SINGLE); verifyCommand(encoder, command, binary("24243000062008958C070D")); } + + @Test + public void testEncodePeriodicPositionRetrievalIntervalSet() throws Exception { + var encoder = inject(new GatorProtocolEncoder(null)); + var device = encoder.getCacheManager().getObject(Device.class, 1); + when(device.getUniqueId()).thenReturn("13088005658"); + + Command command = new Command(); + command.setDeviceId(1); + command.set("heartbeat_interval", 120); + command.set("engine_off_interval", 5); + command.set("engine_on_interval", 5); + command.setType(Command.TYPE_POSITION_PERIODIC); + verifyCommand(encoder, command, binary("242434000b5800383a00050005781d0d")); + } } |