9899100101102103104105106107108
contentType.setBaseType("text"); contentType.setSubType("html"); contentType.setParameter("charset", "utf-8"); assertEquals(contentType.unparse(), "text/html;charset=utf-8"); } @Test public void unparse_no_parameters() throws Exception {
109110111112113114115116117118119
ContentType contentType = new ContentType(); contentType.setBaseType("text"); contentType.setSubType("html"); assertEquals(contentType.unparse(), "text/html"); } @Test public void to_string_is_unparse() {
121122123124125126127128
contentType.setBaseType("text"); contentType.setSubType("html"); contentType.setParameter("charset", "utf-8"); assertEquals(contentType.toString(), contentType.unparse()); } }