From 0ea0026b4ac5a26b2312e329476a632548ad5fee Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 4 Apr 2019 20:34:45 +0300 Subject: Recommendations in feeds --- src/test/java/com/juick/server/tests/ServerTests.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/test') diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index f08c49f5..d4f79f3e 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -1372,14 +1372,16 @@ public class ServerTests { jdbcTemplate.update("INSERT INTO favorites(user_id, user_uri, message_id, like_id, ts) " + "values (0, 'http://example.com/u/test', ?, 1, now())", mid); assertThat(messagesService.getMessage(mid).get().getLikes(), is(4)); - assertThat(CollectionUtils.isEqualCollection(messagesService.getMessageRecommendations(mid) - .stream().map(User::getName).collect(Collectors.toList()), + assertThat(CollectionUtils.isEqualCollection(messagesService.getMessagesRecommendations( + Collections.singletonList(mid)) + .stream().map(p -> p.getRight()).map(User::getName).collect(Collectors.toList()), Arrays.asList("fmap", "ermine", "pogo", "Anonymous")), is(true)); privacyQueriesService.blacklistUser(userService.getUserByName("monstreek"), userService.getUserByName("pogo")); assertThat(messagesService.getMessage(mid).get().getLikes(), is(4)); - assertThat(CollectionUtils.isEqualCollection(messagesService.getMessageRecommendations(mid) - .stream().map(User::getName).collect(Collectors.toList()), + assertThat(CollectionUtils.isEqualCollection(messagesService.getMessagesRecommendations( + Collections.singletonList(mid)) + .stream().map(p -> p.getRight()).map(User::getName).collect(Collectors.toList()), Arrays.asList("fmap", "ermine", "Anonymous")), is(true)); } @Test -- cgit v1.2.3