aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorseym45 <seym45@gmail.com>2023-08-22 02:11:40 +0400
committerseym45 <seym45@gmail.com>2023-08-22 02:11:53 +0400
commit75064707c6432cc4918eab573ac3ce9d6eee1d94 (patch)
tree2308683dc91b0072cc84f971aae42ce298e069ed /src/test
parent09d4fb4a10a5362191023f5c82327d8d38ae830f (diff)
downloadtrackermap-server-75064707c6432cc4918eab573ac3ce9d6eee1d94.tar.gz
trackermap-server-75064707c6432cc4918eab573ac3ce9d6eee1d94.tar.bz2
trackermap-server-75064707c6432cc4918eab573ac3ce9d6eee1d94.zip
Add command to set speed limit and odometer for Gator
- Add test to verify position retrieval interval settings - Update key name MSG_POSITION_PERIODIC to MSG_SET_POSITION_REQUEST_INTERVAL
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java15
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"));
+ }
}