From f1278ae7119fcb77326c6d520915ecaa1527d39c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 7 Apr 2019 03:49:09 +0300 Subject: Edit telegram messages --- src/test/java/com/juick/server/tests/ServerTests.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/test/java') 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 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 replyId = messagesService.findMessageByProperty("tg_id", "hrhr").orElseThrow(); + assertThat(replyId.getRight(), is(rid)); } } -- cgit v1.2.3