File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
modules/simple-java-mail/src/test
java/org/simplejavamail/converter
resources/secure-testdata Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -92,4 +92,30 @@ public void accept(final Properties passwords) {
9292 }
9393 });
9494 }
95+
96+ @ Test
97+ public void testMimeMessageWithNestedMessages ()
98+ throws Exception {
99+ SecureTestDataHelper .runTestWithSecureTestData (new SecureTestDataHelper .PasswordsConsumer () {
100+ @ Override
101+ public void accept (final Properties passwords ) {
102+ String fileNameMsg = RESOURCES + "/secure-testdata/secure-testdata/nested-mimemessages-without-name-email/4990344.eml" ;
103+ Email email = EmailConverter .emlToEmail (new File (fileNameMsg ));
104+ assertThat (email .getAttachments ()).extracting ("name" ).containsExactly ("ForwardedMessage.eml" , "ForwardedMessage.eml" );
105+ }
106+ });
107+ }
108+
109+ @ Test
110+ public void testOutlookMessageWithNestedMessages ()
111+ throws Exception {
112+ SecureTestDataHelper .runTestWithSecureTestData (new SecureTestDataHelper .PasswordsConsumer () {
113+ @ Override
114+ public void accept (final Properties passwords ) {
115+ String fileNameMsg = RESOURCES + "/secure-testdata/secure-testdata/nested-mimemessages-without-name-email/4990344.msg" ;
116+ Email email = EmailConverter .outlookMsgToEmail (new File (fileNameMsg ));
117+ assertThat (email .getAttachments ()).extracting ("name" ).containsExactly ("NDPB.eml" , "Voicemail .eml" );
118+ }
119+ });
120+ }
95121}
You can’t perform that action at this time.
0 commit comments