diff options
Diffstat (limited to 'juick-server/src')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/Post.java | 2 | ||||
-rw-r--r-- | juick-server/src/test/java/com/juick/server/tests/ServerTests.java | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Post.java b/juick-server/src/main/java/com/juick/server/api/Post.java index 2e1ca6d7..3b022aae 100644 --- a/juick-server/src/main/java/com/juick/server/api/Post.java +++ b/juick-server/src/main/java/com/juick/server/api/Post.java @@ -278,7 +278,7 @@ public class Post { throw new HttpForbiddenException(); } - MessagesService.RecommendStatus recommendStatus = messagesService.likeMessage(mid,msg.getUser().getUid(), + MessagesService.RecommendStatus recommendStatus = messagesService.likeMessage(mid,visitor.getUid(), reactionId); return recommendStatus == MessagesService.RecommendStatus.Error ? Status.ERROR :Status.OK; diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java index 575bc7d1..0902eb8f 100644 --- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java +++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java @@ -813,15 +813,13 @@ public class ServerTests { public void likesTests() throws Exception{ int user_id = userService.createUser("dsds", "secret"); String freefdHash = userService.getHashByUID(freefd.getUid()); - System.out.println("user_id"+ user_id); - String userIdHash = userService.getHashByUID(user_id); int mid1 = messagesService.createMessage(user_id, "yo", null, new ArrayList<>()); mockMvc.perform(post("/react?mid=" + mid1 + "&hash=" + freefdHash+ "&reactionId=2")) .andExpect(status().isOk()); Message msg4 = messagesService.getMessage(mid1); - System.out.println("msg4"+msg4); + assertThat(msg4.getLikes(), is(0)); Assert.assertEquals(1, msg4.getReactions().stream().filter(r -> r.getId() == 2) .findFirst().orElseThrow(IllegalStateException::new).getCount()); } |