2525import static org .assertj .core .data .MapEntry .entry ;
2626import static org .simplejavamail .converter .EmailConverter .mimeMessageToEmail ;
2727import static org .simplejavamail .converter .EmailConverter .mimeMessageToEmailBuilder ;
28- import static testutil . EmailHelper . normalizeText ;
28+ import static org . simplejavamail . internal . util . MiscUtil . normalizeNewlines ;
2929import static testutil .EmailHelper .readOutlookMessage ;
3030
3131@ SuppressWarnings ("unused" )
@@ -86,10 +86,12 @@ public void createMailSession_OutlookMessageTest()
8686 // Outlook overrode this when saving the .email to match the mail account
8787 EmailAssert .
assertThat (
email ).
hasRecipients (
new Recipient (
"Bottema, Benny" ,
"[email protected] " ,
TO ));
8888 EmailAssert .
assertThat (
email ).
hasReplyToRecipient (
new Recipient (
"lollypop-replyto" ,
"[email protected] " ,
null ));
89- assertThat (normalizeText (email .getPlainText ())).isEqualTo ("We should meet up!\n " );
89+ assertThat (normalizeNewlines (email .getPlainText ())).isEqualTo ("We should meet up!\n " );
9090 // Outlook overrode this value too OR converted the original HTML to RTF, from which OutlookMessageParser derived this HTML
91- assertThat (normalizeText (email .getHTMLText ())).contains (
92- "<html><body style=\" font-family:'Courier',monospace;font-size:10pt;\" > <br/> <br/> <b> We should meet up! <br/> </b> <br/> <img src=\" cid:thumbsup\" > <br/> " );
91+ assertThat (normalizeNewlines (email .getHTMLText ())).contains (
92+ "<html><body style=\" font-family:'Courier',monospace;font-size:10pt;\" > <br/> \n " +
93+ " <br/> <b> We should meet up! <br/> </b> <br/> <img src=\" cid:thumbsup\" >\n " +
94+ " <br/> </body></html>" );
9395 // the RTF was probably created by Outlook based on the HTML when the message was saved
9496 assertThat (email .getAttachments ()).hasSize (2 );
9597 assertThat (email .getEmbeddedImages ()).hasSize (1 );
@@ -100,9 +102,9 @@ public void createMailSession_OutlookMessageTest()
100102 assertAttachmentMetadata (attachment1 , "text/plain" , "dresscode.txt" );
101103 assertAttachmentMetadata (attachment2 , "text/plain" , "location.txt" );
102104 assertAttachmentMetadata (embeddedImg , "image/png" , "thumbsup" );
103-
104- assertThat (normalizeText (attachment1 .readAllData ())).isEqualTo ("Black Tie Optional" );
105- assertThat (normalizeText (attachment2 .readAllData ())).isEqualTo ("On the moon!" );
105+
106+ assertThat (normalizeNewlines (attachment1 .readAllData ())).isEqualTo ("Black Tie Optional" );
107+ assertThat (normalizeNewlines (attachment2 .readAllData ())).isEqualTo ("On the moon!" );
106108 }
107109
108110 private Email assertSendingEmail (final EmailPopulatingBuilder originalEmailPopulatingBuilder , boolean compensateForDresscodeAttachmentNameOverrideErasure )
0 commit comments