public class TestMultipartContentBody {
@Test
public void testStringBody() throws Exception {
StringBody b1 = new StringBody("text");
Assert.assertEquals(4, b1.getContentLength());
Charset defCharset = Charset.defaultCharset();
Assert.assertEquals(defCharset.name(), 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());
StringBody b2 = new StringBody("more text", "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());
}