Skip to content

[BE/test] 회원가입 API 테스트 #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jul 7, 2024
Merged

[BE/test] 회원가입 API 테스트 #362

merged 21 commits into from
Jul 7, 2024

Conversation

hwangdaesun
Copy link
Collaborator

@hwangdaesun hwangdaesun commented Jul 7, 2024

📌 관련 이슈

#360

🔑 주요 변경사항

  • 테스트 메서드 명 when_then 메서드 방식으로 수정
  • ValidateEmailService 및 CreateMemberService Mockito 이용해 단위 테스트 수행
  • SignUpMember API 통합 테스트 수행
  • 기타 회원가입 관련 코드 리팩토링

리뷰어에게

  • 회원가입 통합 테스트 수행 시 비동기 -> 동기로 변경하여 수행
  • 테스트간 격리를 위해 SignUpMemberIntegrationTest에 tearDown 메서드를 생성하여 Redis 초기화
  • @RecordApplicationEvents 를 이용해 이벤트 발행 여부 확인
  • 테스트 작성해가며 when_then 방식으로 통일

Comment on lines +44 to +46
verify(memberPort).command(any(MemberEntity.class));
verify(bCryptPasswordEncoder).encode(anyString());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify 메서드에서 VerificationMode가 없는데 어떻게 검증을 하나요??
times(1) 혹은 atLeastOne 해야 맞는거 아닌가요??

Copy link
Collaborator Author

@hwangdaesun hwangdaesun Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇구만

@LJH098 LJH098 merged commit 0a53f40 into be Jul 7, 2024
Copy link

github-actions bot commented Jul 7, 2024

Overall Project 55.23% -0.12%
Files changed 82.93% 🍏

File Coverage
ValidateEmailService.java 100% 🍏
CustomMemberRepositoryImpl.java 100% 🍏
VerifyEmailCheckedController.java 100% 🍏
SignUpMemberController.java 100% 🍏
OnBoardingController.java 100% 🍏
CheckMemberEmailController.java 46.15% -53.85%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants