assertSaveMessageWithAttachments(message, 6);
}
@Test
public void recursiveMultipartMessageTest() throws IOException {
Multipart multipart = new MultipartImpl("mixed");
BodyPart att1 = createRandomBinaryAttachment(100);
multipart.addBodyPart(att1);
BodyPart att2 = createRandomBinaryAttachment(133);
multipart.addBodyPart(att2);
Multipart nestedMultipart = new MultipartImpl("mixed");
BodyPart nBody = createTextBody("Some sample text here...?!", "plain", false);
nestedMultipart.addBodyPart(nBody);
BodyPart nAtt1 = createRandomBinaryAttachment(300);
nestedMultipart.addBodyPart(nAtt1);
BodyPart NAtt2 = createRandomBinaryAttachment(100);
nestedMultipart.addBodyPart(NAtt2);
BodyPart nAtt3 = createTextBody("Some other text here...<br>?!", "html", true);
nestedMultipart.addBodyPart(nAtt3);
BodyPart nestedMessage = new BodyPart();
nestedMessage.setMultipart(nestedMultipart);
multipart.addBodyPart(nestedMessage);