MultipartContext { public String getContentType() { return contentType; } MultipartContext(final String contentType, final int contentLength, final String charEncoding); String getContentType(); int getContentLength(); String getCharEncoding(); @Override String toString();  }
@Test public void testGetContentType() throws Exception { MultipartContext multipartContext = new MultipartContext("multipart/mixed;boundary=gc0p4Jq0M2Yt08jU534c0p", 560, "UTF-8"); assertEquals("multipart/mixed;boundary=gc0p4Jq0M2Yt08jU534c0p", multipartContext.getContentType()); log.info("Created multipart context " + multipartContext); Exception expected = null; try{ new MultipartContext("application/json", 560, "UTF-8"); }catch (Exception e){ expected = e; } assertNotNull(expected); assertTrue(expected instanceof IllegalStateException); expected = null; try{ new MultipartContext(null, 560, "UTF-8"); }catch (Exception e){ expected = e; } assertNotNull(expected); assertTrue(expected instanceof IllegalStateException); }