aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-04-11 17:33:14 -0700
committerAnton Tananaev <anton@traccar.org>2023-04-11 17:33:14 -0700
commitd41d34de83ed755e0a51e5638e121391f84b275f (patch)
treef80cd163aefb85ae13d522a414ebc871284f6c41 /src/test
parentdd8c46eec3282e344eeea5e27d084448c85e1518 (diff)
downloadtrackermap-server-d41d34de83ed755e0a51e5638e121391f84b275f.tar.gz
trackermap-server-d41d34de83ed755e0a51e5638e121391f84b275f.tar.bz2
trackermap-server-d41d34de83ed755e0a51e5638e121391f84b275f.zip
Support Nano firmware update
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/traccar/protocol/Minifinder2ProtocolEncoderTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/Minifinder2ProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/Minifinder2ProtocolEncoderTest.java
new file mode 100644
index 000000000..a3477bfe8
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/Minifinder2ProtocolEncoderTest.java
@@ -0,0 +1,29 @@
+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 Minifinder2ProtocolEncoderTest extends ProtocolTest {
+
+ @Test
+ public void testEncodeNano() throws Exception {
+
+ var encoder = inject(new Minifinder2ProtocolEncoder(null));
+
+ var device = encoder.getCacheManager().getObject(Device.class, 1);
+ when(device.getModel()).thenReturn("Nano");
+
+ Command command = new Command();
+ command.setDeviceId(1);
+ command.setType(Command.TYPE_FIRMWARE_UPDATE);
+ command.set(Command.KEY_DATA, "https://example.com");
+
+ verifyCommand(encoder, command, binary("ab00150018750100143068747470733a2f2f6578616d706c652e636f6d"));
+
+ }
+
+}