From 70dd7231b9534b709f0c14317f63bed0c3a296ab Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 16 Mar 2018 16:26:21 +0300 Subject: server: process email only from service user --- .../java/com/juick/server/tests/ServerTests.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'juick-server/src/test/java/com/juick/server/tests/ServerTests.java') 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: \n" + + "Subject: Re: New reply to TJ\n" + + "From: Vitaly Takmazov \n" + + "To: Juick \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" + + "
s2313334
\n" + + "\n" + + "--001a11454886e42be5056786ca70--"; + mockMvc.perform(post("/mail").with(httpBasic(juickName, juickPassword)).content(mail)) + .andExpect(status().isOk()); + } } -- cgit v1.2.3