aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'juick-api/src/test')
-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));
+ }
}