From d41d34de83ed755e0a51e5638e121391f84b275f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 11 Apr 2023 17:33:14 -0700 Subject: Support Nano firmware update --- .../protocol/Minifinder2ProtocolEncoderTest.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/test/java/org/traccar/protocol/Minifinder2ProtocolEncoderTest.java (limited to 'src/test/java/org/traccar/protocol') 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")); + + } + +} -- cgit v1.2.3