From 3190df1c77db9b17691bfd469c3f92de58ea14ed Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 29 Apr 2019 23:59:55 -0700 Subject: Implement Fifotrack commands --- .../protocol/FifotrackProtocolEncoderTest.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/java/org/traccar/protocol/FifotrackProtocolEncoderTest.java (limited to 'src/test/java/org/traccar') diff --git a/src/test/java/org/traccar/protocol/FifotrackProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/FifotrackProtocolEncoderTest.java new file mode 100644 index 000000000..53ae8510a --- /dev/null +++ b/src/test/java/org/traccar/protocol/FifotrackProtocolEncoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; +import org.traccar.model.Command; + +import static org.junit.Assert.assertEquals; + +public class FifotrackProtocolEncoderTest extends ProtocolTest { + + @Test + public void testEncode() throws Exception { + + FifotrackProtocolEncoder encoder = new FifotrackProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_REQUEST_PHOTO); + + assertEquals("##24,123456789012345,1,D05,3*9F\r\n", encoder.encodeCommand(command)); + + } + +} -- cgit v1.2.3