Пример #1
0
  @Test
  public void unparse_with_parameters() throws Exception {
    ContentType contentType = new ContentType();

    contentType.setBaseType("text");
    contentType.setSubType("html");
    contentType.setParameter("charset", "utf-8");

    assertEquals(contentType.unparse(), "text/html;charset=utf-8");
  }
Пример #2
0
  @Test
  public void to_string_is_unparse() {
    ContentType contentType = new ContentType();

    contentType.setBaseType("text");
    contentType.setSubType("html");
    contentType.setParameter("charset", "utf-8");

    assertEquals(contentType.toString(), contentType.unparse());
  }