FilePart extends AbstractPart { @Override public ContentType getContentType() { return contentType; } FilePart(File file);  FilePart(String name, File file);  FilePart(String name, File file, ContentType contentType); @Override ContentType getContentType(); @Override InputStream getContent(); String getFilename();  }
@Test public void shouldReturnOctetStreamWhenContentTypeIsNull() { ContentType expected = ContentType.createContentType("application/octet-stream"); Part part = new FilePart("name", file, null ); assertThat(part.getContentType() , is(expected)); }
@Test public void shouldReturnSameContentType() { ContentType contentType = ContentType.CONTENT_TYPE_TEXT_JSON; Part part = new FilePart(name, file, contentType); ContentType returnContentType = part.getContentType(); assertThat(contentType, is(returnContentType)); }