@@ -33,4 +33,44 @@ public void testOutlookBasicConversions() {
3333 assertThat (normalizeNewlines (msg .getHTMLText ())).isEqualTo ("<div dir=\" auto\" >Just a test to get an email with one cc recipient.</div>\n " );
3434 assertThat (normalizeNewlines (msg .getPlainText ())).isEqualTo ("Just a test to get an email with one cc recipient.\n " );
3535 }
36+
37+ @ Test
38+ public void testOutlookUnicode () {
39+ final Recipient kalejs =
new Recipient (
"[email protected] " ,
"[email protected] " ,
null );
40+ final Recipient dummy =
new Recipient (
"[email protected] " ,
"[email protected] " ,
TO );
41+
42+ @ NotNull Email msg = EmailConverter .outlookMsgToEmail (new File (RESOURCE_FOLDER + "/tst_unicode.msg" ));
43+ EmailAssert .assertThat (msg ).hasFromRecipient (kalejs );
44+ EmailAssert .assertThat (msg ).hasSubject ("Testcase" );
45+ EmailAssert .assertThat (msg ).hasOnlyRecipients (dummy );
46+ EmailAssert .assertThat (msg ).hasNoAttachments ();
47+ assertThat (msg .getPlainText ()).isNotEmpty ();
48+ assertThat (normalizeNewlines (msg .getHTMLText ())).isNotEmpty ();
49+ assertThat (normalizeNewlines (msg .getPlainText ())).isEqualTo ("-/-\n " +
50+ "Char-å-Char\n " +
51+ "-/-\n " +
52+ "Char-Å-Char\n " +
53+ "-/-\n " +
54+ "Char-ø-Char\n " +
55+ "-/-\n " +
56+ "Char-Ø-Char\n " +
57+ "-/-\n " +
58+ "Char-æ-Char\n " +
59+ "-/-\n " +
60+ "Char-Æ-Char\n " +
61+ " \n " );
62+ }
63+
64+ @ Test
65+ public void testOutlookUnsentDraft () {
66+ final Recipient time2talk =
new Recipient (
"[email protected] " ,
"[email protected] " ,
TO );
67+
68+ @ NotNull Email msg = EmailConverter .outlookMsgToEmail (new File (RESOURCE_FOLDER + "/unsent draft.msg" ));
69+ EmailAssert .
assertThat (
msg ).
hasFromRecipient (
new Recipient (
null ,
"[email protected] " ,
null ));
70+ EmailAssert .assertThat (msg ).hasSubject ("MSG Test File" );
71+ EmailAssert .assertThat (msg ).hasOnlyRecipients (time2talk );
72+ EmailAssert .assertThat (msg ).hasNoAttachments ();
73+ assertThat (msg .getPlainText ()).isNotEmpty ();
74+ assertThat (normalizeNewlines (msg .getHTMLText ())).isNotEmpty ();
75+ }
3676}
0 commit comments