diff options
author | Vitaly Takmazov | 2023-02-03 01:32:17 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-02-03 03:39:43 +0300 |
commit | d71ce6095b87958d2df4da27b1344ad0e5b77a44 (patch) | |
tree | 1f7cccba70151c86e94620ccc583a5801b273563 /src/test/java/com | |
parent | 17aa96df5776812e2b2fb212b071a821685c9598 (diff) |
top_ignore_tags -> tags.notop
Diffstat (limited to 'src/test/java/com')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 3c37e846..414ad2ab 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -707,8 +707,9 @@ public class ServerTests { List<Integer> topCandidates = messagesService.getPopularCandidates(); assertThat(topCandidates.size(), is(1)); assertThat(topCandidates.get(0), is(topmid)); - Tag juickTag = tagService.getTag("juick", false); - assertThat(juickTag.getId(), is(2)); + Tag juickTag = tagService.getTag("juick", true); + var rowsCount = jdbcTemplate.update("UPDATE tags SET notop=1 WHERE tag_id=?", juickTag.getId()); + assertThat(rowsCount, is(1)); tagService.updateTags(topmid, Collections.singletonList(juickTag)); assertThat(messagesService.getPopularCandidates().isEmpty(), is(true)); tagService.updateTags(topmid, Collections.singletonList(juickTag)); @@ -722,7 +723,9 @@ public class ServerTests { CommandResult resultUndo = commandsManager.commandRecommend(serviceUser, URI.create(""), String.valueOf(topmid)); assertThat(messagesService.getPopularCandidates().isEmpty(), is(false)); - Tag nsfw = tagService.getTag("NSFW", true); + Tag nsfw = tagService.getTag("NOT_SAFE_FOR_WORK", true); + rowsCount = jdbcTemplate.update("UPDATE tags SET notop=1 WHERE tag_id=?", nsfw.getId()); + assertThat(rowsCount, is(1)); tagService.updateTags(topmid, Collections.singletonList(nsfw)); assertThat(messagesService.getPopularCandidates().isEmpty(), is(true)); User recommender = userService.createUser("recommender2", "x").orElseThrow(IllegalStateException::new); |