diff --git a/src/test/unit/gov/nist/javax/sip/parser/SupportedParserTest.java b/src/test/unit/gov/nist/javax/sip/parser/SupportedParserTest.java index 233b1daf2..263ae4971 100644 --- a/src/test/unit/gov/nist/javax/sip/parser/SupportedParserTest.java +++ b/src/test/unit/gov/nist/javax/sip/parser/SupportedParserTest.java @@ -24,6 +24,8 @@ */ package test.unit.gov.nist.javax.sip.parser; +import gov.nist.javax.sip.header.Supported; +import gov.nist.javax.sip.header.SupportedList; import gov.nist.javax.sip.parser.SupportedParser; /** @@ -45,5 +47,19 @@ public void testParser() { super.testParser(SupportedParser.class,content); } + + /* + * Test for https://github.com/usnistgov/jsip/issues/53 + * Adding two Supported headers, first one "" causes malformed encoding output: + * + * "Support: ,timer" + */ + public void testMalformedConstruction() { + SupportedList supportedList = new SupportedList(); + supportedList.add(new Supported("")); + supportedList.add(new Supported("timer")); + String encoded = supportedList.encode(); + assertEquals("Supported: timer\r\n", encoded); + } }