diff options
Diffstat (limited to 'src/test/java/com/juick/server/tests/ServerTests.java')
-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); |