diff options
author | Vitaly Takmazov | 2019-04-07 03:49:09 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-04-07 03:49:09 +0300 |
commit | f1278ae7119fcb77326c6d520915ecaa1527d39c (patch) | |
tree | 3d0c5eac7cef2c3e08ab9f5260f2f0dfc14d4532 /src/test/java/com/juick/server/tests | |
parent | 97b37acdaee5d1665c2393254bc764bb4562729c (diff) |
Edit telegram messages
Diffstat (limited to 'src/test/java/com/juick/server/tests')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index cc0044b9..0039d378 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -55,6 +55,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.IteratorUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.text.StringEscapeUtils; import org.junit.After; import org.junit.Assert; @@ -2027,7 +2028,13 @@ public class ServerTests { assertThat(messagesService.getMessageProperty(mid, 0,"tg_id"), is("YO")); messagesService.setMessageProperty(mid, 0,"tg_id", "YO2"); assertThat(messagesService.getMessageProperty(mid, 0,"tg_id"), is("YO2")); + Pair<Integer, Integer> messageId = messagesService.findMessageByProperty("tg_id", "YO2").orElseThrow(); + assertThat(messageId.getLeft(), is(mid)); messagesService.setMessageProperty(mid, 0, "tg_id", ""); assertThat(messagesService.getMessageProperty(mid, 0,"tg_id"), is(StringUtils.EMPTY)); + int rid = messagesService.createReply(mid, 0, ugnich, "EOPLE", null); + messagesService.setMessageProperty(mid, rid, "tg_id", "hrhr"); + Pair<Integer, Integer> replyId = messagesService.findMessageByProperty("tg_id", "hrhr").orElseThrow(); + assertThat(replyId.getRight(), is(rid)); } } |