Skip to content

Commit

Permalink
test: 대소문자 구분 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
redcarrot1 committed Mar 27, 2024
1 parent 56cb3ed commit b16cf6f
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,26 @@ void failSendAuthEmailByLimitExceed() throws Exception {
.andDo(print());
}

@Test
@DisplayName("메일은 대소문자를 구분하지 않는다.")
void authEmail() throws Exception {
// given
AuthEmailSendRequest attendanceRegisterRequest = new AuthEmailSendRequest("TeSt@kOnkUk.aC.Kr");
String request = objectMapper.writeValueAsString(attendanceRegisterRequest);

// expected
mockMvc.perform(post("/api/auth/emails")
.contentType(MediaType.APPLICATION_JSON)
.content(request)
)
.andExpect(status().isOk())
.andExpect(jsonPath("$.isSuccess").value(true))
.andExpect(jsonPath("$.response.sendingCount").value(1))
.andDo(print());

List<AuthEmail> authEmails = authEmailRepository.findAll();
assertThat(authEmails).hasSize(1);
assertThat(authEmails.get(0).getTarget()).isEqualTo("test@konkuk.ac.kr");
}

}

0 comments on commit b16cf6f

Please sign in to comment.