From 50eb6e7ec6364866e4934bb6fd1dd668e8e9fa69 Mon Sep 17 00:00:00 2001 From: Gavriel Fleischer Date: Sun, 13 Jan 2019 22:07:55 +0200 Subject: added test when binary data looks like format string --- test/org/traccar/protocol/WatchProtocolEncoderTest.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/org/traccar/protocol') diff --git a/test/org/traccar/protocol/WatchProtocolEncoderTest.java b/test/org/traccar/protocol/WatchProtocolEncoderTest.java index d7784f50b..9b9e68cdb 100644 --- a/test/org/traccar/protocol/WatchProtocolEncoderTest.java +++ b/test/org/traccar/protocol/WatchProtocolEncoderTest.java @@ -33,6 +33,12 @@ public class WatchProtocolEncoderTest extends ProtocolTest { command.set(Command.KEY_DATA, "3333"); assertEquals("[CS*123456789012345*0005*TK,33]", encoder.encodeCommand(null, command)); + command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_VOICE_MESSAGE); + command.set(Command.KEY_DATA, "2321414d520a2573"); + assertEquals("[CS*123456789012345*000b*TK,#!AMR\n%s]", encoder.encodeCommand(null, command)); + command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_CUSTOM); -- cgit v1.2.3