Skip to content

Commit

Permalink
test : 주변 식당 리뷰 조회 기능 유저 토큰 시나리오 테스트 코드 입력
Browse files Browse the repository at this point in the history
  • Loading branch information
Qbeom0925 committed Jan 24, 2024
1 parent 60d14df commit ecd2180
Showing 1 changed file with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,34 @@ void getStoreDetail() throws Exception {
@Test
void getStoreReviews() throws Exception {
// given
Long storeIdx = 1L;
Long index = 1L;
int offset = 0;
int limit = 10;

// when then
mockMvc.perform(
get("/api/v1/stores/{index}/reviews", index)
.param("offset", String.valueOf(offset))
.param("limit", String.valueOf(limit)))
.andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(jsonPath("$.message").value("OK"));
}

@DisplayName("가게 리뷰 목록 조회 - 유저 존재")
@Test
void getStoreReviewsUser() throws Exception {
// given
Long index = 1L;
int offset = 0;
int limit = 10;

given(userJwtResolver.resolveArgument(any(), any(), any(), any()))
.willReturn(AuthenticatedUser.builder().idx(1L).build());

// when then
mockMvc.perform(
get("/api/v1/stores/{storeIdx}/reviews", storeIdx)
get("/api/v1/stores/{index}/reviews", index)
.param("offset", String.valueOf(offset))
.param("limit", String.valueOf(limit)))
.andDo(MockMvcResultHandlers.print())
Expand Down

0 comments on commit ecd2180

Please sign in to comment.