diff options
author | Vitaly Takmazov | 2021-10-25 01:24:37 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2021-10-25 01:24:37 +0300 |
commit | 2cbaa2dd212bb81d34e7b52eff4d03e4780d02de (patch) | |
tree | 8b9da98161e4b2ec3d042233f08bbd219bd7a7d4 /src/test/java/com/juick | |
parent | 1bca4586c8358ce7cef302c6019f112100b34393 (diff) |
Fix top candidates query and update tests
Diffstat (limited to 'src/test/java/com/juick')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 7 |
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 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<Integer> msgs = messagesService.getUserRecommendations(serviceUser.getUid(), 0); + assertThat(msgs.get(0), is(topmid)); + List<Integer> 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)); |