aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-01-28 18:24:32 +0300
committerGravatar Vitaly Takmazov2023-01-28 19:07:28 +0300
commit906bf8ef21463f99820764807b656cb617b0aaa2 (patch)
tree542c02066866decfe50c7127578967b3b0b02537 /src/test/java/com/juick/server
parent5700d7c5dd1f578cd52451074ce316e192532ca6 (diff)
Cleanup Tag model
Diffstat (limited to 'src/test/java/com/juick/server')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java10
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),