aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java/com/juick/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/test/java/com/juick/server/tests')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
index 7d25a8ae..99453f32 100644
--- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
@@ -455,4 +455,32 @@ public class ServerTests extends AbstractJUnit4SpringContextTests {
assertEquals("should not have messages", 0, messagesService.getAll(user.getUid(), 0).size());
*/
}
+ @Test
+ public void mailParserTest() throws Exception {
+ String mail = "MIME-Version: 1.0\n" +
+ "Received: by 10.176.0.242 with HTTP; Fri, 16 Mar 2018 05:31:50 -0700 (PDT)\n" +
+ "In-Reply-To: <2891710.100@juick.com>\n" +
+ "References: <2891710.0@juick.com> <2891710.100@juick.com>\n" +
+ "Date: Fri, 16 Mar 2018 15:31:50 +0300\n" +
+ "Delivered-To: vitalyster@gmail.com\n" +
+ "Message-ID: <CAF+0zPD_YLVgYovajLqUFwkRAgJT+FzyQ2EzikQsPKsrnfKv-Q@mail.gmail.com>\n" +
+ "Subject: Re: New reply to TJ\n" +
+ "From: Vitaly Takmazov <vitalyster@gmail.com>\n" +
+ "To: Juick <juick@juick.com>\n" +
+ "Content-Type: multipart/alternative; boundary=\"001a11454886e42be5056786ca70\"\n" +
+ "\n" +
+ "--001a11454886e42be5056786ca70\n" +
+ "Content-Type: text/plain; charset=\"UTF-8\"\n" +
+ "\n" +
+ "s2313334\n" +
+ "\n" +
+ "--001a11454886e42be5056786ca70\n" +
+ "Content-Type: text/html; charset=\"UTF-8\"\n" +
+ "\n" +
+ "<div dir=\"ltr\">s2313334</div>\n" +
+ "\n" +
+ "--001a11454886e42be5056786ca70--";
+ mockMvc.perform(post("/mail").with(httpBasic(juickName, juickPassword)).content(mail))
+ .andExpect(status().isOk());
+ }
}