Skip to content

Commit

Permalink
[test] 지원서 목록 보기 API enum 타입인 parameter들에 대해 테스트 코드 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
letskuku committed Jul 28, 2024
1 parent a1b085f commit 41234fe
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,26 @@ void getApplicationsWithoutRequiredFalse() throws Exception {
.with(SecurityMockMvcRequestPostProcessors.authentication(authentication)))
.andExpect(MockMvcResultMatchers.status().isOk());
}

@DisplayName("지원서 목록 보기 API - enum 타입 영어로 처리")
@Test
void successGetApplications() throws Exception {
Authentication authentication = new TestingAuthenticationToken(null, null, "ROLE_ADMIN");

mockMvc.perform(MockMvcRequestBuilders
.get("/applications?part=PRODUCT&docPass=PASS&finalPass=FAIL&applicantName=&pageNum=0&limit=7")
.with(SecurityMockMvcRequestPostProcessors.authentication(authentication)))
.andExpect(MockMvcResultMatchers.status().isOk());
}

@DisplayName("지원서 목록 보기 API - enum 타입 한글로 처리 시 예외 발생")
@Test
void failGetApplications() throws Exception {
Authentication authentication = new TestingAuthenticationToken(null, null, "ROLE_ADMIN");

mockMvc.perform(MockMvcRequestBuilders
.get("/applications?part=기획&docPass=합격&finalPass=불합격&applicantName=&pageNum=0&limit=7")
.with(SecurityMockMvcRequestPostProcessors.authentication(authentication)))
.andExpect(MockMvcResultMatchers.status().is(400));
}
}

0 comments on commit 41234fe

Please sign in to comment.