aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
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"));
+
+ }
+
+}