Skip to content

Commit

Permalink
bbottema#9 Fixed test data
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin committed Oct 12, 2019
1 parent 55bc3a1 commit adb33fe
Show file tree
Hide file tree
Showing 3 changed files with 592 additions and 1,041 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,7 @@ public void testHtmlTestWithReplyToAndAttachmentsPlusEmbeddedImage()
assertThat(normalizeText(msg.getBodyText())).isEqualTo("We should meet up!\n");
// Outlook overrode this value too OR converted the original HTML to RTF, from which OutlookMessageParser derived this HTML
assertThat(normalizeText(msg.getConvertedBodyHTML())).isEqualTo(
"<html><body style=\"font-family:'Courier',monospace;font-size:10pt;\"> \n" +
" <b> We should meet up! </b> <img src=\"cid:thumbsup\">\n" +
" </body></html>");
"<b>We should meet up!</b><img src=\"cid:thumbsup\">");
// the RTF was probably created by Outlook based on the HTML when the message was saved
assertThat(msg.getBodyRTF()).isNotEmpty();
List<OutlookAttachment> outlookAttachments = msg.getOutlookAttachments();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class TestUtils {
public static String classpathFileToString(String classPathFile, Charset charset) {
try {
return new String(Files.readAllBytes(Paths.get(TestUtils.class.getResource(classPathFile).toURI())));
Path path = Paths.get(TestUtils.class.getResource(classPathFile).toURI());
return Files.readString(path, charset);
} catch (IOException | URISyntaxException e) {
throw new RuntimeException(e);
}
Expand Down
Loading

0 comments on commit adb33fe

Please sign in to comment.