Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
[BM-289] ✅ offset, limit 실패테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
waterfogSW committed Aug 9, 2022
1 parent b653db2 commit 5458440
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,25 @@ void ItResponse404(long offset) throws Exception {
}
}

@Nested
@DisplayName("offset 이 숫자가 아닐 경우")
class ContextWithNonNumberOffset {

@Test
@DisplayName("404를 응답한다")
void ItResponse404() throws Exception {
MockHttpServletRequestBuilder request = RestDocumentationRequestBuilders
.get(REQUEST_URI)
.queryParam("offset", "test")
.queryParam("limit", "1");

ResultActions response = mockMvc.perform(request);

//then
response.andExpect(status().isBadRequest());
}
}

@Nested
@DisplayName("limit 양수가 아닐 경우")
class ContextWithNonPositiveLimit {
Expand All @@ -154,6 +173,24 @@ void ItResponse404(int limit) throws Exception {
}
}

@Nested
@DisplayName("limit 이 숫자가 아닐 경우")
class ContextWithNonNumberLimit {

@Test
@DisplayName("404를 응답한다")
void ItResponse404() throws Exception {
MockHttpServletRequestBuilder request = RestDocumentationRequestBuilders
.get(REQUEST_URI)
.queryParam("offset", "1")
.queryParam("limit", "test");

ResultActions response = mockMvc.perform(request);

//then
response.andExpect(status().isBadRequest());
}
}
}

private User getUser(long userId) {
Expand Down

0 comments on commit 5458440

Please sign in to comment.