diff --git a/src/test/java/tavebalak/OTTify/user/controller/UserControllerTest.java b/src/test/java/tavebalak/OTTify/user/controller/UserControllerTest.java index a83236a..ba2a963 100644 --- a/src/test/java/tavebalak/OTTify/user/controller/UserControllerTest.java +++ b/src/test/java/tavebalak/OTTify/user/controller/UserControllerTest.java @@ -242,4 +242,30 @@ public void findUserReviews() throws Exception { .andExpect(jsonPath("$.data").isNotEmpty()) .andExpect(jsonPath("$.data", response).exists()); } + + @Test + @DisplayName("유저는 좋아요한 리뷰 목록을 조회할 수 있다.") + public void findUserLikedReviews() throws Exception { + // given + List reviewTagNames1 = new ArrayList<>(Arrays.asList("극장에서 또 보고 싶어요")); + MyReviewDto reviewDto1 = new MyReviewDto(6L, LocalDateTime.now(), "https://ottify-s3-bucket.s3.ap-northeast-2.amazonaws.com/profile-images/813f55bc-8900-49e3-8e6b-98cc85f2fa0d.jpg", + "닉네임1", "어벤져스: 인피니티 워", 3.5, reviewTagNames1, "액션 그 자체 난 아직도 이때가 그립다", 3); + + List reviewTagNames2 = new ArrayList<>(Arrays.asList("극장에서 또 보고 싶어요")); + MyReviewDto reviewDto2 = new MyReviewDto(7L, LocalDateTime.now(), "https://ottify-s3-bucket.s3.ap-northeast-2.amazonaws.com/profile-images/813f55bc-8900-49e3-8e6b-98cc85f2fa0d.jpg", + "닉네임2", "어벤져스", 4.5, reviewTagNames1, "그 시절 나는 슈퍼 hero 였다 ...", 3); + + List response = new ArrayList<>(Arrays.asList(reviewDto1, reviewDto2)); + + // when + when(userService.getLikedReview(any(Pageable.class))).thenReturn(response); + + ResultActions result = mockMvc.perform(get(BASE_URL + "/likedReviews")); + + // then + result.andExpect(status().isOk()) + .andExpect(jsonPath("$.data").isNotEmpty()) + .andExpect(jsonPath("$.data", response).exists()); + + } } \ No newline at end of file