From 2cbaa2dd212bb81d34e7b52eff4d03e4780d02de Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 25 Oct 2021 01:24:37 +0300 Subject: Fix top candidates query and update tests --- src/test/java/com/juick/server/tests/ServerTests.java | 7 +++++++ 1 file changed, 7 insertions(+) (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 267ab9f8..14517a60 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -805,6 +805,13 @@ public class ServerTests { assertThat(messagesService.getPopularCandidates().isEmpty(), is(true)); tagService.updateTags(topmid, Collections.singletonList(juickTag)); assertThat(messagesService.getPopularCandidates().isEmpty(), is(false)); + CommandResult resultRecommend = commandsManager.commandRecommend(serviceUser, URI.create(""), String.valueOf(topmid)); + List msgs = messagesService.getUserRecommendations(serviceUser.getUid(), 0); + assertThat(msgs.get(0), is(topmid)); + List allMsgs = messagesService.getUserBlogWithRecommendations(serviceUser, ugnich, 0, 0); + assertThat(allMsgs.contains(topmid), is(true)); + CommandResult resultUndo = commandsManager.commandRecommend(serviceUser, URI.create(""), String.valueOf(topmid)); + assertThat(messagesService.getPopularCandidates().isEmpty(), is(false)); jdbcTemplate.update("INSERT INTO tags(tag_id, name) VALUES(805, 'NSFW')"); Tag nsfw = tagService.getTag("NSFW", false); assertThat(nsfw.TID, equalTo(805)); -- cgit v1.2.3