From 8b37cf5abb3fe376490d1deda73b309d1cfee8a6 Mon Sep 17 00:00:00 2001 From: Tim <135014430+nagisa77@users.noreply.github.com> Date: Mon, 1 Sep 2025 15:34:52 +0800 Subject: [PATCH] test: mock PointService in CommentServiceTest --- .../test/java/com/openisle/service/CommentServiceTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/test/java/com/openisle/service/CommentServiceTest.java b/backend/src/test/java/com/openisle/service/CommentServiceTest.java index 9d22c32aa..0e05c052c 100644 --- a/backend/src/test/java/com/openisle/service/CommentServiceTest.java +++ b/backend/src/test/java/com/openisle/service/CommentServiceTest.java @@ -7,6 +7,7 @@ import com.openisle.repository.ReactionRepository; import com.openisle.repository.CommentSubscriptionRepository; import com.openisle.repository.NotificationRepository; import com.openisle.repository.PointHistoryRepository; +import com.openisle.service.PointService; import com.openisle.exception.RateLimitException; import org.junit.jupiter.api.Test; @@ -26,10 +27,11 @@ class CommentServiceTest { CommentSubscriptionRepository subRepo = mock(CommentSubscriptionRepository.class); NotificationRepository nRepo = mock(NotificationRepository.class); PointHistoryRepository pointHistoryRepo = mock(PointHistoryRepository.class); + PointService pointService = mock(PointService.class); ImageUploader imageUploader = mock(ImageUploader.class); CommentService service = new CommentService(commentRepo, postRepo, userRepo, - notifService, subService, reactionRepo, subRepo, nRepo, pointHistoryRepo, imageUploader); + notifService, subService, reactionRepo, subRepo, nRepo, pointHistoryRepo, pointService, imageUploader); when(commentRepo.countByAuthorAfter(eq("alice"), any())).thenReturn(3L);