diff options
Diffstat (limited to 'test/org')
-rw-r--r-- | test/org/traccar/protocol/Tk103ProtocolEncoderTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java index 25968a0fe..34b2acf86 100644 --- a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java @@ -221,6 +221,20 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { } @Test + public void testEncodeCustom() throws Exception { + + Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_CUSTOM); + command.set(Command.KEY_DATA, "AA00"); + + assertEquals("(123456789012345AA00)", encoder.encodeCommand(command)); + + } + + @Test public void testEncodeCustomAlternative() throws Exception { Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(true); |