Skip to content

Commit

Permalink
test/#353: LoginRequest Valid
Browse files Browse the repository at this point in the history
  • Loading branch information
LJH098 committed Jul 4, 2024
1 parent 0d3c372 commit 0cf0127
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;

import com.gaebaljip.exceed.common.IntegrationTest;
import com.gaebaljip.exceed.common.ValidationMessage;
import com.gaebaljip.exceed.dto.request.LoginRequest;

class AuthControllerIntegrationTest extends IntegrationTest {
Expand Down Expand Up @@ -42,4 +43,20 @@ void login_fail() throws Exception {

resultActions.andExpect(status().isBadRequest());
}

@Test()
@DisplayName("로그인 실패 - 이메일 형식 안 맞을 때")
void login_fail2() throws Exception {
LoginRequest loginRequest = new LoginRequest("abcd1111gmail.com", "Abc@123");

ResultActions resultActions =
mockMvc.perform(
MockMvcRequestBuilders.post("/v1/auth/login")
.content(om.writeValueAsString(loginRequest))
.contentType(MediaType.APPLICATION_JSON));

resultActions.andExpectAll(
status().isBadRequest(),
jsonPath("$.error.reason").value(ValidationMessage.INVALID_EMAIL));
}
}

0 comments on commit 0cf0127

Please sign in to comment.