aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-11-07 09:33:03 +0300
committerGravatar Vitaly Takmazov2021-11-07 09:33:13 +0300
commit8bac426e420e100ff68f0d9bf3a6be3f3f53ffb0 (patch)
tree4f1e0ac792a4fd8e6c805030114c501b6e4a3271 /src/test/java/com/juick/server
parent6c3cc808f7358e19aa41db585e8450798e729499 (diff)
Fix top query
Diffstat (limited to 'src/test/java/com/juick/server')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java7
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 9ed4b727..252fa432 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -819,6 +819,13 @@ public class ServerTests {
assertThat(nsfw.TID, equalTo(805));
tagService.updateTags(topmid, Collections.singletonList(nsfw));
assertThat(messagesService.getPopularCandidates().isEmpty(), is(true));
+ User recommender = userService.createUser("recommender", "x").orElseThrow(IllegalStateException::new);
+ int anotherMid = messagesService.createMessage(ugnich.getUid(), "top2", null, null);
+ messagesService.recommendMessage(anotherMid, freefd.getUid());
+ messagesService.recommendMessage(anotherMid, recommender.getUid());
+ assertThat(messagesService.getPopularCandidates().get(0), is(anotherMid));
+ messagesService.recommendMessage(anotherMid, serviceUser.getUid());
+ assertThat(messagesService.getPopularCandidates().isEmpty(), is(true));
}
@Test