aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src/test/java/com/juick/MessageTest.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-09-29 16:39:37 +0300
committerGravatar Vitaly Takmazov2018-09-29 16:39:37 +0300
commit1621fb481fe91b084a48326419969f3a22ccbbe2 (patch)
treebe6aa4acd21ee5d8e7edf8cde95cffe64590ec0e /juick-common/src/test/java/com/juick/MessageTest.java
parent80f305e6f5d22abc38807fd6fad37b5cb450c249 (diff)
Mentions
Diffstat (limited to 'juick-common/src/test/java/com/juick/MessageTest.java')
-rw-r--r--juick-common/src/test/java/com/juick/MessageTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/juick-common/src/test/java/com/juick/MessageTest.java b/juick-common/src/test/java/com/juick/MessageTest.java
index aaa66af2..d9c83b84 100644
--- a/juick-common/src/test/java/com/juick/MessageTest.java
+++ b/juick-common/src/test/java/com/juick/MessageTest.java
@@ -22,6 +22,8 @@ import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
+import java.util.List;
+
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
@@ -168,4 +170,12 @@ public class MessageTest {
String msg = "[te](http://juick.com/)[st](http://juick.com/)";
assertThat(MessageUtils.stripNonSafeUrls(msg), is(msg));
}
+ @Test
+ public void mentionsCount() {
+ Message msg = new Message();
+ msg.setText("@ugnich go home");
+ List<String> mentions = MessageUtils.getMentions(msg);
+ assertThat(mentions.size(), is(1));
+ assertThat(mentions.get(0), is("@ugnich"));
+ }
}