aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java/com/juick/server
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/test/java/com/juick/server')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java12
1 files changed, 12 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 71c42b6c..db932dc9 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
@@ -24,6 +24,7 @@ import com.juick.Message;
import com.juick.Tag;
import com.juick.User;
import com.juick.server.*;
+import com.juick.server.component.MessageEvent;
import com.juick.server.helpers.AnonymousUser;
import com.juick.server.helpers.CommandResult;
import com.juick.server.helpers.TagStats;
@@ -123,6 +124,8 @@ public class ServerTests {
private CrosspostService crosspostService;
@Inject
private ImagesService imagesService;
+ @Inject
+ private ServerManager serverManager;
@Value("${hostname:localhost}")
private Jid jid;
@Value("${xmppbot_jid:juick@localhost}")
@@ -627,6 +630,10 @@ public class ServerTests {
subscriptionService.getUsersSubscribedToComments(
messagesService.getMessage(mid),
messagesService.getReply(mid, rid)).size());
+ assertEquals("number of subscribed users should match", 1,
+ subscriptionService.getUsersSubscribedToComments(
+ messagesService.getMessage(mid),
+ messagesService.getReply(mid, rid), true).size());
assertEquals("should be subscribed", "Subscribed to @" + user.getName(),
commandsManager.processCommand(readerUser, "S @" + user.getName(), emptyUri)
.getText());
@@ -777,5 +784,10 @@ public class ServerTests {
.andExpect(content().bytes(IOUtils.toByteArray(
Objects.requireNonNull(getClass().getClassLoader().getResource("Transparent.gif")))));
assertThat(lastRead.apply(ugnich, mid), is(freefdrid));
+ privacyQueriesService.blacklistUser(ugnich, freefd);
+ int newfreefdrid = messagesService.createReply(mid, 0, freefd, "from ban", null);
+ serverManager.onApplicationEvent(new MessageEvent(this, messagesService.getReply(mid, newfreefdrid),
+ Collections.emptyList()));
+ assertThat(lastRead.apply(ugnich, mid), is(newfreefdrid));
}
}