From 4f2f63dbda970c06e63f444e11e29da483961843 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 5 Jan 2018 11:44:40 +0300 Subject: email: parse In-Reply-To --- juick-api/src/test/java/com/juick/api/tests/MessagesTests.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'juick-api/src/test/java/com/juick/api') diff --git a/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java b/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java index 0022c966..a270a120 100644 --- a/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java +++ b/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java @@ -52,6 +52,7 @@ import javax.inject.Inject; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Scanner; import java.util.stream.IntStream; import static org.hamcrest.MatcherAssert.assertThat; @@ -310,4 +311,13 @@ public class MessagesTests extends AbstractJUnit4SpringContextTests { .andExpect(status().isOk()) .andExpect(jsonPath("$", hasSize(0))); } + @Test + public void inReplyToScannerTest() { + String header = "<123456.56@juick.com>"; + Scanner headerScanner = new Scanner(header).useDelimiter("\\.|@|<"); + int mid = Integer.parseInt(headerScanner.next()); + int rid = Integer.parseInt(headerScanner.next()); + assertThat(mid, equalTo(123456)); + assertThat(rid, equalTo(56)); + } } -- cgit v1.2.3