public class TestMultipartContentBody {
@Test
public void testStringBody() throws Exception {
final StringBody b1 = new StringBody("text", ContentType.DEFAULT_TEXT);
Assert.assertEquals(4, b1.getContentLength());
Assert.assertEquals("ISO-8859-1", b1.getCharset());
Assert.assertNull(b1.getFilename());
Assert.assertEquals("text/plain", b1.getMimeType());
Assert.assertEquals("text", b1.getMediaType());
Assert.assertEquals("plain", b1.getSubType());
Assert.assertEquals(MIME.ENC_8BIT, b1.getTransferEncoding());
final StringBody b2 = new StringBody("more text",
ContentType.create("text/other", MIME.DEFAULT_CHARSET));
Assert.assertEquals(9, b2.getContentLength());
Assert.assertEquals(MIME.DEFAULT_CHARSET.name(), b2.getCharset());
Assert.assertNull(b2.getFilename());
Assert.assertEquals("text/other", b2.getMimeType());
Assert.assertEquals("text", b2.getMediaType());
Assert.assertEquals("other", b2.getSubType());
Assert.assertEquals(MIME.ENC_8BIT, b2.getTransferEncoding());
}