Assert.assertTrue(blob.getParameter().containsKey("other"));
Assert.assertEquals("test", blob.getParameter().get("other"));
}
@Test
public void testIllegalFormatedParameter() throws IOException {
Blob blob = createBlob(createContentSource("text/plain;=UTF-8"));
Assert.assertEquals("text/plain", blob.getMimeType());
Assert.assertTrue(blob.getParameter().isEmpty());
blob = createBlob(createContentSource("text/plain;charset=UTF-8;=illegal"));
Assert.assertEquals("text/plain", blob.getMimeType());
Assert.assertEquals(blob.getParameter().size(),1);
Assert.assertTrue(blob.getParameter().containsKey("charset"));
Assert.assertEquals("UTF-8", blob.getParameter().get("charset"));
blob = createBlob(createContentSource("text/plain;=illegal;charset=UTF-8"));
Assert.assertEquals("text/plain", blob.getMimeType());
Assert.assertEquals(blob.getParameter().size(),1);
Assert.assertTrue(blob.getParameter().containsKey("charset"));
Assert.assertEquals("UTF-8", blob.getParameter().get("charset"));
blob = createBlob(createContentSource("text/plain;charset="));
Assert.assertEquals("text/plain", blob.getMimeType());
Assert.assertTrue(blob.getParameter().isEmpty());
blob = createBlob(createContentSource("text/plain;charset"));
Assert.assertEquals("text/plain", blob.getMimeType());
Assert.assertTrue(blob.getParameter().isEmpty());
blob = createBlob(createContentSource("text/plain;charset=UTF-8;test="));
Assert.assertEquals("text/plain", blob.getMimeType());
Assert.assertEquals(blob.getParameter().size(),1);
Assert.assertTrue(blob.getParameter().containsKey("charset"));
Assert.assertEquals("UTF-8", blob.getParameter().get("charset"));
blob = createBlob(createContentSource("text/plain;charset=UTF-8;test"));
Assert.assertEquals("text/plain", blob.getMimeType());
Assert.assertEquals(blob.getParameter().size(),1);
Assert.assertTrue(blob.getParameter().containsKey("charset"));
Assert.assertEquals("UTF-8", blob.getParameter().get("charset"));
blob = createBlob(createContentSource("text/plain;test;charset=UTF-8;"));
Assert.assertEquals("text/plain", blob.getMimeType());
Assert.assertEquals(blob.getParameter().size(),1);
Assert.assertTrue(blob.getParameter().containsKey("charset"));
Assert.assertEquals("UTF-8", blob.getParameter().get("charset"));
}