From d71ce6095b87958d2df4da27b1344ad0e5b77a44 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 3 Feb 2023 01:32:17 +0300 Subject: top_ignore_tags -> tags.notop --- src/test/java/com/juick/server/tests/ServerTests.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/test/java/com/juick/server') 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 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); -- cgit v1.2.3