diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 9a46f691..81718cab 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -1580,27 +1580,25 @@ public class ServerTests { User monstreek = userService.createUser("monstreek", "secret").orElseThrow(IllegalStateException::new); User pogo = userService.createUser("pogo", "secret").orElseThrow(IllegalStateException::new); User fmap = userService.createUser("fmap", "secret").orElseThrow(IllegalStateException::new); - int mid = messagesService.createMessage(monstreek.getUid(), "KURWA", null, Set.of()); + int mid = messagesService.createMessage(fmap.getUid(), "KURWA", null, Set.of()); assertThat(messagesService.recommendMessage(mid, ermine.getUid()), is(MessagesService.RecommendStatus.Added)); - assertThat(messagesService.recommendMessage(mid, fmap.getUid()), - is(MessagesService.RecommendStatus.Added)); assertThat(messagesService.recommendMessage(mid, pogo.getUid()), is(MessagesService.RecommendStatus.Added)); jdbcTemplate.update("INSERT INTO favorites(user_id, user_uri, message_id, like_id, ts) " + "values (0, 'http://example.com/u/test', ?, 1, ?)", mid, Date.from(Instant.now())); - assertThat(messagesService.getMessage(mid).get().getRecommendations().size(), is(4)); + assertThat(messagesService.getMessage(mid).get().getRecommendations().size(), is(3)); assertThat(CollectionUtils.isEqualCollection( - messagesService.getMessagesRecommendations(Collections.singletonList(mid)).stream() + messagesService.getMessagesRecommendations(monstreek.getUid(), Collections.singletonList(mid)).stream() .map(Pair::getRight).map(User::getName).toList(), - Arrays.asList("fmap", "ermine", "pogo", "Anonymous")), is(true)); + Arrays.asList("ermine", "pogo", "Anonymous")), is(true)); privacyQueriesService.blacklistUser(userService.getUserByName("monstreek"), userService.getUserByName("pogo")); assertThat(messagesService.getMessage(mid).get().getRecommendations().size(), is(3)); assertThat(CollectionUtils.isEqualCollection( - messagesService.getMessagesRecommendations(Collections.singletonList(mid)).stream() + messagesService.getMessagesRecommendations(monstreek.getUid(), Collections.singletonList(mid)).stream() .map(Pair::getRight).map(User::getName).toList(), - Arrays.asList("fmap", "ermine", "Anonymous")), is(true)); + Arrays.asList("ermine", "Anonymous")), is(true)); jdbcTemplate.execute("DELETE FROM favorites"); } |