Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <[email protected]>
  • Loading branch information
jbescos committed Mar 8, 2024
1 parent 7849e77 commit 956ce9b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions api/src/test/java/jakarta/mail/PartTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,22 @@ public void specifySession2() throws MessagingException {
assertEquals(SESSION_2.getStreamProvider(), multipart.getStreamProvider());
}

@Test
public void multipartBodyPart() throws Exception {
MimeMessage m = new MimeMessage(SESSION_2);
MimeMultipart mmp = new MimeMultipart("mixed");
MimeBodyPart mbp = new MimeBodyPart();
mbp.setDisposition(Part.INLINE);
mbp.setText("none");
mmp.addBodyPart(mbp);
m.setContent(mmp);

StreamProvider root = SESSION_2.getStreamProvider();
assertEquals(root, m.getStreamProvider());
assertEquals(root, mmp.getStreamProvider());
assertEquals(root, mbp.getStreamProvider());
}

public static class CustomStreamProvider implements StreamProvider {

@Override
Expand Down

0 comments on commit 956ce9b

Please sign in to comment.