Skip to content

Commit

Permalink
Refactor(#18): 테스트 코드 페이지, 사이즈 파라미터 추가 (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
giwoong01 authored Sep 2, 2024
1 parent 9df438b commit ec7c956
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ void setUp(RestDocumentationContextProvider restDocumentation) {
given(blockService.findForBlockByProgress(anyString(), anyLong(), anyString(), any())).willReturn(response);

// when & then
mockMvc.perform(get(String.format("/api/blocks?dashboardId=%d&progress=%s", 1L, progressString))
.header("Authorization", "Bearer valid-token")
.accept(MediaType.APPLICATION_JSON))
mockMvc.perform(
get(String.format("/api/blocks?dashboardId=%d&progress=%s&page=%d&size=%d", 1L, progressString, 0, 10))
.header("Authorization", "Bearer valid-token")
.accept(MediaType.APPLICATION_JSON))
.andDo(print())
.andDo(document("block/findByBlockWithProgress",
preprocessRequest(prettyPrint()),
Expand All @@ -326,7 +327,11 @@ void setUp(RestDocumentationContextProvider restDocumentation) {
parameterWithName("dashboardId")
.description("대시보드 아이디"),
parameterWithName("progress")
.description("블록 상태 문자열(NOT_STARTED, IN_PROGRESS, COMPLETED)")
.description("블록 상태 문자열(NOT_STARTED, IN_PROGRESS, COMPLETED)"),
parameterWithName("page")
.description("페이지 번호"),
parameterWithName("size")
.description("페이지 크기")
),
responseFields(
fieldWithPath("statusCode").description("상태 코드"),
Expand Down Expand Up @@ -411,5 +416,5 @@ void setUp(RestDocumentationContextProvider restDocumentation) {
))
.andExpect(status().isOk());
}

}

0 comments on commit ec7c956

Please sign in to comment.