Skip to content

Commit

Permalink
Test for usnistgov#53 Issue usnistgov#53
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirralev committed Jan 6, 2020
1 parent b1a5142 commit 79e3788
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/unit/gov/nist/javax/sip/parser/SupportedParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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);
}

}

0 comments on commit 79e3788

Please sign in to comment.