.getStart());
Assert.assertEquals("text/xml", multipart.getStartInfo());
Assert.assertEquals(3, multipart.getParts().size());
Iterator<InputPart> inputParts = multipart.getParts().iterator();
Assert.assertEquals(inputParts.next(), multipart.getRootPart());
InputPart rootPart = multipart.getRootPart();
Assert.assertEquals("application", rootPart.getMediaType().getType());
Assert.assertEquals("xop+xml", rootPart.getMediaType().getSubtype());
Assert.assertEquals("UTF-8", rootPart.getMediaType().getParameters()
.get("charset"));
Assert.assertEquals("text/xml", rootPart.getMediaType().getParameters()
.get("type"));
Assert.assertEquals("<mymessage.xml@example.org>", rootPart
.getHeaders().getFirst("Content-ID"));
Assert.assertEquals("8bit", rootPart.getHeaders().getFirst(
"Content-Transfer-Encoding"));
Assert
.assertEquals(
"<m:data xmlns:m='http://example.org/stuff'>"
+ "<m:photo><xop:Include xmlns:xop='http://www.w3.org/2004/08/xop/include' href='cid:http://example.org/me.png'/></m:photo>"
+ "<m:sig><xop:Include xmlns:xop='http://www.w3.org/2004/08/xop/include' href='cid:http://example.org/my.hsh'/></m:sig>"
+ "</m:data>", rootPart.getBodyAsString());
InputPart relatedPart1 = inputParts.next();
Assert.assertEquals("image", relatedPart1.getMediaType().getType());
Assert.assertEquals("png", relatedPart1.getMediaType().getSubtype());
Assert.assertEquals("<http://example.org/me.png>", relatedPart1
.getHeaders().getFirst("Content-ID"));
Assert.assertEquals("binary", relatedPart1.getHeaders().getFirst(
"Content-Transfer-Encoding"));
Assert.assertEquals("// binary octets for png", relatedPart1
.getBodyAsString());
InputPart relatedPart2 = inputParts.next();
Assert.assertEquals("application", relatedPart2.getMediaType()
.getType());
Assert.assertEquals("pkcs7-signature", relatedPart2.getMediaType()
.getSubtype());
Assert.assertEquals("<http://example.org/me.hsh>", relatedPart2
.getHeaders().getFirst("Content-ID"));
Assert.assertEquals("binary", relatedPart2.getHeaders().getFirst(
"Content-Transfer-Encoding"));
Assert.assertEquals("// binary octets for signature", relatedPart2
.getBodyAsString());
}