diff --git a/src/main/java/com/listywave/list/application/service/ReplyService.java b/src/main/java/com/listywave/list/application/service/ReplyService.java index 0976ccbe..e5043011 100644 --- a/src/main/java/com/listywave/list/application/service/ReplyService.java +++ b/src/main/java/com/listywave/list/application/service/ReplyService.java @@ -39,13 +39,13 @@ public ReplyCreateResponse create( Long targetCommentId, Long writerId, String content, - List mentionedIds + List mentionIds ) { listRepository.getById(listId); User user = userRepository.getById(writerId); Comment comment = commentRepository.getById(targetCommentId); - List mentions = mentionService.toMentions(mentionedIds); + List mentions = mentionService.toMentions(mentionIds); Reply reply = replyRepository.save(new Reply(comment, user, new CommentContent(content), mentions)); applicationEventPublisher.publishEvent(AlarmEvent.reply(comment, reply)); diff --git a/src/main/java/com/listywave/mention/MentionService.java b/src/main/java/com/listywave/mention/MentionService.java index ccecdbe8..88d51e35 100644 --- a/src/main/java/com/listywave/mention/MentionService.java +++ b/src/main/java/com/listywave/mention/MentionService.java @@ -15,8 +15,8 @@ public class MentionService { private final UserRepository userRepository; @Transactional(readOnly = true) - public List toMentions(List mentionedIds) { - List mentionedUsers = userRepository.findAllById(mentionedIds); + public List toMentions(List mentionIds) { + List mentionedUsers = userRepository.findAllById(mentionIds); return mentionedUsers.stream() .map(Mention::new) .toList(); diff --git a/src/test/java/com/listywave/mention/MentionServiceTest.java b/src/test/java/com/listywave/mention/MentionServiceTest.java index 34fd7450..6a3efa5c 100644 --- a/src/test/java/com/listywave/mention/MentionServiceTest.java +++ b/src/test/java/com/listywave/mention/MentionServiceTest.java @@ -195,12 +195,12 @@ class 멘션_수정 { @Test void 댓글을_수정해_새로운_멘션을_추가한다() { // given - List firstMentionedIds = List.of(js.getId()); - Long commentId = commentService.create(list.getId(), dh.getId(), "댓글이요", firstMentionedIds).id(); + List firstMentionIds = List.of(js.getId()); + Long commentId = commentService.create(list.getId(), dh.getId(), "댓글이요", firstMentionIds).id(); // when - List newMentionedIds = List.of(js.getId(), ej.getId()); - commentService.update(list.getId(), dh.getId(), commentId, "댓글 수정이요", newMentionedIds); + List newMentionIds = List.of(js.getId(), ej.getId()); + commentService.update(list.getId(), dh.getId(), commentId, "댓글 수정이요", newMentionIds); // then CommentFindResponse response = commentService.findCommentBy(list.getId(), 5, null); @@ -231,12 +231,12 @@ class 멘션_수정 { void 답글을_수정해_새로운_멘션을_추가한다() { // given Long commentId = commentService.create(list.getId(), dh.getId(), "댓글이요", EMPTY_LIST).id(); - List firstMentionedIds = List.of(dh.getId()); - Long replyId = replyService.create(list.getId(), commentId, js.getId(), "답글이요", firstMentionedIds).id(); + List firstMentionIds = List.of(dh.getId()); + Long replyId = replyService.create(list.getId(), commentId, js.getId(), "답글이요", firstMentionIds).id(); // when - List newMentionedIds = List.of(dh.getId(), ej.getId()); - ReplyUpdateCommand replyUpdateCommand = new ReplyUpdateCommand(list.getId(), commentId, replyId, "답글 수정이요", newMentionedIds); + List newMentionIds = List.of(dh.getId(), ej.getId()); + ReplyUpdateCommand replyUpdateCommand = new ReplyUpdateCommand(list.getId(), commentId, replyId, "답글 수정이요", newMentionIds); replyService.update(replyUpdateCommand, js.getId()); // then @@ -253,8 +253,8 @@ class 멘션_수정 { void 답글을_수정해_멘션을_제거한다() { // given Long commentId = commentService.create(list.getId(), dh.getId(), "댓글이요", EMPTY_LIST).id(); - List firstMentionedIds = List.of(dh.getId()); - Long replyId = replyService.create(list.getId(), commentId, js.getId(), "답글이요", firstMentionedIds).id(); + List firstMentionIds = List.of(dh.getId()); + Long replyId = replyService.create(list.getId(), commentId, js.getId(), "답글이요", firstMentionIds).id(); // when ReplyUpdateCommand replyUpdateCommand = new ReplyUpdateCommand(list.getId(), commentId, replyId, "답글 수정이요", EMPTY_LIST);