diff options
Diffstat (limited to 'src/test/java/com/juick/server')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index dba662b0..d695ffb8 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -732,7 +732,7 @@ public class ServerTests { assertThat(topCandidates.size(), is(1)); assertThat(topCandidates.get(0), is(topmid)); Tag juickTag = tagService.getTag("juick", false); - assertThat(juickTag.TID, is(2)); + assertThat(juickTag.getId(), is(2)); tagService.updateTags(topmid, Collections.singletonList(juickTag)); assertThat(messagesService.getPopularCandidates().isEmpty(), is(true)); tagService.updateTags(topmid, Collections.singletonList(juickTag)); @@ -746,9 +746,7 @@ public class ServerTests { 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)); + Tag nsfw = tagService.getTag("NSFW", true); tagService.updateTags(topmid, Collections.singletonList(nsfw)); assertThat(messagesService.getPopularCandidates().isEmpty(), is(true)); User recommender = userService.createUser("recommender2", "x").orElseThrow(IllegalStateException::new); @@ -1277,8 +1275,8 @@ public class ServerTests { commandsManager.processCommand(ugnich, "BL @freefd", emptyUri); Tag tag = tagService.getTag("linux", true); int freefdMsg = messagesService.createMessage(freefd.getUid(), "sux", null, Set.of(tag)); - assertThat(messagesService.getTag(tag.TID, freefd.getUid(), 0, 10).size(), is(1)); - assertThat(messagesService.getTag(tag.TID, ugnich.getUid(), 0, 10).size(), is(0)); + assertThat(messagesService.getTag(tag.getId(), freefd.getUid(), 0, 10).size(), is(1)); + assertThat(messagesService.getTag(tag.getId(), ugnich.getUid(), 0, 10).size(), is(0)); messagesService.recommendMessage(freefdMsg, serviceUser.getUid()); assertThat(messagesService.getUserBlogWithRecommendations(serviceUser, ugnich, 0, 0) .contains(freefdMsg), |