485376 unit test

This commit is contained in:
Greg Wilkins 2016-01-08 11:38:06 +11:00
parent a934db118d
commit 35134e2d05
1 changed files with 13 additions and 0 deletions

View File

@ -235,7 +235,20 @@ public class ResponseTest
response.addHeader("Content-Type","application/json"); response.addHeader("Content-Type","application/json");
response.getWriter(); response.getWriter();
assertEquals("application/json",response.getContentType()); assertEquals("application/json",response.getContentType());
}
@Test
public void testStrangeContentType() throws Exception
{
Response response = newResponse();
assertEquals(null, response.getContentType());
response.recycle();
response.setContentType("text/html;charset=utf-8;charset=UTF-8");
response.getWriter();
assertEquals("text/html;charset=utf-8;charset=UTF-8",response.getContentType());
assertEquals("utf-8",response.getCharacterEncoding().toLowerCase());
} }
@Test @Test