From f470a96b9cd20bc42651d99178df1e0ca031ca3e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 30 Nov 2018 17:55:00 +0300 Subject: add incomplete test case for mirroring messages --- src/test/java/com/juick/server/tests/ServerTests.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test/java/com') diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index cc42383b..1aaa578d 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -1842,4 +1842,14 @@ public class ServerTests { .andExpect(status().isOk()) .andExpect(content().string(containsString("XMPP support is disabled"))); } + @Test + public void ActivityPubLikesShouldNotMirrorMessage() throws Exception { + jdbcTemplate.execute("DELETE FROM messages"); + Message msg = commandsManager.processCommand(ugnich, "YO", emptyUri).getNewMessage().get(); + messagesService.likeMessage(msg.getMid(), freefd.getUid(), Reaction.LIKE); + messagesService.likeMessage(msg.getMid(), 0, Reaction.LIKE, "http://localhost:8080/u/test"); + jdbcTemplate.update("UPDATE messages SET popular=1 where message_id=?", msg.getMid()); + List top = messagesService.getMessages(ugnich, messagesService.getPopular(ugnich.getUid(), 0)); + assertThat(top.size(), is(1)); + } } -- cgit v1.2.3