From 1621fb481fe91b084a48326419969f3a22ccbbe2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 29 Sep 2018 16:39:37 +0300 Subject: Mentions --- juick-common/src/test/java/com/juick/MessageTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'juick-common/src/test/java') 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 mentions = MessageUtils.getMentions(msg); + assertThat(mentions.size(), is(1)); + assertThat(mentions.get(0), is("@ugnich")); + } } -- cgit v1.2.3