diff options
author | 2018-03-13 15:18:03 +0300 | |
---|---|---|
committer | 2018-03-13 15:18:03 +0300 | |
commit | f010d75872763547ecbe621ae3e8eb967950453f (patch) | |
tree | 385d3f0a960e10c7fd054fcb71ea280142495d31 /juick-core/src/test/java | |
parent | cd7e11563721d223b30f9b9edaa8295c2c97c6f7 (diff) |
core: cleanup unused message properties
Diffstat (limited to 'juick-core/src/test/java')
-rw-r--r-- | juick-core/src/test/java/com/juick/MessageTest.java | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/juick-core/src/test/java/com/juick/MessageTest.java b/juick-core/src/test/java/com/juick/MessageTest.java index 3bdac9be..45c5730c 100644 --- a/juick-core/src/test/java/com/juick/MessageTest.java +++ b/juick-core/src/test/java/com/juick/MessageTest.java @@ -17,11 +17,11 @@ package com.juick; +import com.juick.util.MessageUtils; import org.apache.commons.lang3.RandomUtils; import org.apache.commons.lang3.StringUtils; import org.junit.Test; import rocks.xmpp.addr.Jid; -import rocks.xmpp.core.XmppException; import rocks.xmpp.core.session.Extension; import rocks.xmpp.core.session.XmppSession; import rocks.xmpp.core.session.XmppSessionConfiguration; @@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.*; public class MessageTest { @Test - public void equalsShouldBeReturnCorrectResult() throws Exception { + public void equalsShouldBeReturnCorrectResult() { Message message1 = new Message(); Message message2 = new Message(); @@ -75,7 +75,7 @@ public class MessageTest { } @Test - public void compareShouldBeReturnCorrectResult() throws Exception { + public void compareShouldBeReturnCorrectResult() { Message message1 = new Message(); message1.setMid(RandomUtils.nextInt()); @@ -96,7 +96,7 @@ public class MessageTest { } @Test - public void messageWithGreaterMidShouldBeLessThenMesageWithLessMid() throws Exception { + public void messageWithGreaterMidShouldBeLessThenMesageWithLessMid() { Message message1 = new Message(); message1.setMid(RandomUtils.nextInt()); @@ -112,7 +112,7 @@ public class MessageTest { } @Test - public void messageWithGreaterRidAndEqualsMidShouldBeGreaterThenMessageWithLessRid() throws Exception { + public void messageWithGreaterRidAndEqualsMidShouldBeGreaterThenMessageWithLessRid() { Message message1 = new Message(); message1.setMid(RandomUtils.nextInt()); @@ -128,41 +128,41 @@ public class MessageTest { } @Test - public void tagsStringShouldBeEmptyIfNoTags() throws Exception { + public void tagsStringShouldBeEmptyIfNoTags() { Message message = new Message(); - assertThat(message.getTagsString(), isEmptyString()); + assertThat(MessageUtils.getTagsString(message), isEmptyString()); message.FriendsOnly = true; - assertThat(message.getTagsString(), isEmptyString()); + assertThat(MessageUtils.getTagsString(message), isEmptyString()); message.Hidden = true; message.ReadOnly = true; - assertThat(message.getTagsString(), isEmptyString()); + assertThat(MessageUtils.getTagsString(message), isEmptyString()); - message.parseTags(" "); + message.setTags(MessageUtils.parseTags(" ")); - assertThat(message.getTagsString(), isEmptyString()); + assertThat(MessageUtils.getTagsString(message), isEmptyString()); } @Test - public void tagsStringShouldHasNoTagDuplicates() throws Exception { + public void tagsStringShouldHasNoTagDuplicates() { Message message = new Message(); - message.parseTags("test"); + message.setTags(MessageUtils.parseTags("test")); - assertThat(StringUtils.countMatches(message.getTagsString(), "*test"), equalTo(1)); + assertThat(StringUtils.countMatches(MessageUtils.getTagsString(message), "*test"), equalTo(1)); - message.parseTags("test test"); + message.setTags(MessageUtils.parseTags("test test")); - assertThat(StringUtils.countMatches(message.getTagsString(), "*test"), equalTo(1)); + assertThat(StringUtils.countMatches(MessageUtils.getTagsString(message), "*test"), equalTo(1)); - message.parseTags("test test ab test"); + message.setTags(MessageUtils.parseTags("test test ab test")); - assertThat(StringUtils.countMatches(message.getTagsString(), "*test"), equalTo(1)); - assertThat(StringUtils.countMatches(message.getTagsString(), "*ab"), equalTo(1)); + assertThat(StringUtils.countMatches(MessageUtils.getTagsString(message), "*test"), equalTo(1)); + assertThat(StringUtils.countMatches(MessageUtils.getTagsString(message), "*ab"), equalTo(1)); } @Test public void tagsShouldBeDeserializedFromXml() throws JAXBException { @@ -171,7 +171,7 @@ public class MessageTest { .build(); XmppSession xmpp = new XmppSession("juick.com", configuration) { @Override - public void connect(Jid from) throws XmppException { + public void connect(Jid from) { } |