Add (correct) test for removing double dashes in StructuredSyslogMessage

This commit is contained in:
Jochen Schalanda 2015-05-24 12:31:48 +02:00
parent 583e37b0c9
commit 8d48a0ae3e

View File

@ -269,4 +269,14 @@ public class StructuredSyslogMessageTest extends TestCase
assertTrue((message.getStructuredData().get("data1")).size() == 1);
assertEquals("b", message.getStructuredData().get("data1").get("a"));
}
public void testMessageWithoutIdOrStructuredData()
{
final String messageStr = "- - TEST";
final StructuredSyslogMessage message = StructuredSyslogMessage.fromString(messageStr);
assertEquals("TEST", message.getMessage());
assertNull(message.getMessageId());
assertNull(message.getStructuredData());
}
}