aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/test/java')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
index af5b20ec5..3fc56af7d 100644
--- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
@@ -903,6 +903,7 @@ public class ServerTests {
@Test
public void lastReadTests() throws Exception {
+ assertThat(userService.isInBLAny(ugnich.getUid(), freefd.getUid()), is(false));
int mid = messagesService.createMessage(ugnich.getUid(), "to be watched", null, null);
subscriptionService.subscribeMessage(messagesService.getMessage(mid), ugnich);
messagesService.createReply(mid, 0, freefd, "new reply", null);
@@ -928,6 +929,7 @@ public class ServerTests {
int newfreefdrid = messagesService.createReply(mid, 0, freefd, "from ban", null);
serverManager.processMessageEvent(new MessageEvent(this, messagesService.getReply(mid, newfreefdrid),
Collections.emptyList()));
+ assertThat(userService.isReplyToBL(ugnich, messagesService.getReply(mid, newfreefdrid)), is(true));
assertThat(lastRead.apply(ugnich, mid), is(newfreefdrid));
privacyQueriesService.blacklistUser(ugnich, freefd);
newfreefdrid = messagesService.createReply(mid, 0, freefd, "after ban", null);
@@ -1055,6 +1057,8 @@ public class ServerTests {
commandsManager.processCommand(juick, String.format("#%d/1 ban for a hour!", mid), emptyUri);
commandsManager.processCommand(juick, String.format("#%d freefd is here but it is hidden from you", mid), emptyUri);
assertThat(messagesService.getMessage(mid).getReplies(), is(3));
+ Message reply = messagesService.getReply(mid, 3);
+ assertThat(userService.isReplyToBL(ugnich, reply), is(false));
List<Message> replies = messagesService.getReplies(ugnich, mid);
assertThat(replies.size(), is(1));
commandsManager.processCommand(freefd, String.format("#%d/3 hahaha!", mid), emptyUri);
@@ -1064,6 +1068,10 @@ public class ServerTests {
commandsManager.processCommand(juick, String.format("#%d/4 mmm?!", mid), emptyUri);
assertThat(messagesService.getMessage(mid).getReplies(), is(5));
replies = messagesService.getReplies(ugnich, mid);
+ reply = messagesService.getReply(mid, 5);
+ assertThat(userService.isReplyToBL(ugnich, reply), is(true));
assertThat(replies.size(), is(1));
+ commandsManager.processCommand(ugnich, "BL @freefd", emptyUri);
+ messagesService.setLastReadComment(ugnich, mid, 5);
}
}