aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-16 16:26:21 +0300
committerGravatar Vitaly Takmazov2018-03-16 16:26:21 +0300
commit70dd7231b9534b709f0c14317f63bed0c3a296ab (patch)
tree73db73fc97bfbc1bdd87500b4e2ac47541d0675f /juick-server/src/test/java/com/juick/server
parentbffb71b70c6d6ff20b649de986e098ed0e7ddafe (diff)
server: process email only from service user
Diffstat (limited to 'juick-server/src/test/java/com/juick/server')
-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());
+ }
}