Skip to content

Commit

Permalink
modify: BookstoreAccount 엔티티 변수면 변경 따른 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
woody35545 committed May 13, 2024
1 parent 046e84b commit 9b05580
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public MemberRegistrationResponse registerMember(MemberRegistrationRequest reque

BookstoreAccount bookstoreAccount = bookstoreAccountRepository.save(BookstoreAccount.builder()
.id(request.getAccountId())
.AccountPassword(passwordEncoder.encode(request.getPassword()))
.password(passwordEncoder.encode(request.getPassword()))
.member(member)
.build());

Expand All @@ -89,7 +89,7 @@ public void modifyMemberPassword(long memberId, MemberPasswordModifyRequest requ
BookstoreAccount bookstoreAccount = bookstoreAccountRepository.findByMemberId(memberId)
.orElseThrow(() -> new MemberNotFoundForIdException(memberId));

if (!passwordEncoder.matches(request.getCurrentPassword(), bookstoreAccount.getAccountPassword())) {
if (!passwordEncoder.matches(request.getCurrentPassword(), bookstoreAccount.getPassword())) {
throw new IllegalArgumentException("기존 비밀번호가 일치하지 않습니다.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ void modifyMemberPasswordTest() {

BookstoreAccount bookstoreAccount = BookstoreAccount.builder()
.id("test")
.AccountPassword("encodedPassword")
.password("encodedPassword")
.member(Member.builder().id(memberId).build())
.build();

Mockito.when(bookstoreAccountRepository.findByMemberId(memberId)).thenReturn(Optional.of(bookstoreAccount));
Mockito.when(passwordEncoder.matches(request.getCurrentPassword(), bookstoreAccount.getAccountPassword())).thenReturn(true);
Mockito.when(passwordEncoder.matches(request.getCurrentPassword(), bookstoreAccount.getPassword())).thenReturn(true);
Mockito.when(passwordEncoder.encode(request.getNewPassword())).thenReturn("encodedNewPassword");

// when & then
Expand Down

0 comments on commit 9b05580

Please sign in to comment.