aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/test/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-01-05 11:44:40 +0300
committerGravatar Vitaly Takmazov2018-01-05 11:44:40 +0300
commit4f2f63dbda970c06e63f444e11e29da483961843 (patch)
treef14238dc6debe5f8fa9a4907df536b5fa70dce2e /juick-api/src/test/java/com/juick
parentd5a737bd5b1155cdbb80ab3d2927113c0d385bd6 (diff)
email: parse In-Reply-To
Diffstat (limited to 'juick-api/src/test/java/com/juick')
-rw-r--r--juick-api/src/test/java/com/juick/api/tests/MessagesTests.java10
1 files changed, 10 insertions, 0 deletions
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));
+ }
}