-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a492310
commit e12c48c
Showing
5 changed files
with
34 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,25 @@ void loginBuyer() { | |
assertThat(loginResponse.name()).isEqualTo("홍길동"); | ||
} | ||
|
||
@Test | ||
@DisplayName("회원 가입된 구매자는 틀린 비밀번호를 입력하면 로그인할 수 없다.") | ||
void loginBuyerWithFailLoin() { | ||
// given | ||
String email = "[email protected]"; | ||
String password = "password"; | ||
String failPassword = "fail_password"; | ||
BuyerRequest buyerRequest = new BuyerRequest(email, password, "홍길동", "01012345678", "admin"); | ||
buyerService.signUp(buyerRequest, LocalDateTime.of(2024, 10, 22, 11, 28)); | ||
|
||
UserType userType = UserType.BUYER; | ||
LoginRequest loginRequest = new LoginRequest(email, failPassword, userType); | ||
|
||
// when | ||
Assertions.assertThatThrownBy(() -> loginService.login(loginRequest)) | ||
.isInstanceOf(IllegalArgumentException.class) | ||
.hasMessage("비밀번호가 일치하지 않습니다."); | ||
} | ||
|
||
@Test | ||
@DisplayName("회원 정보가 없는 구매자는 로그인을 할 수 없다.") | ||
void loginBuyerWithFail() { | ||
|