diff options
Diffstat (limited to 'juick-common/src/test/java/com/juick')
-rw-r--r-- | juick-common/src/test/java/com/juick/MessageTest.java | 10 |
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")); + } } |