Skip to content

Conversation

@Do-oya
Copy link
Member

@Do-oya Do-oya commented May 10, 2025

📌 Issue


🧐 현재 상황

  • UserService에 너무 많은 책임이 있어 서비스 클래스를 각 인터페이스로 분리하여 리팩터링 하였습니다.

🎯 목표

  • SRP를 준수하게 되어, 유지보수와 코드 읽는데 이해가 쉬워지기 위함
  • 비즈니스 로직 단위로 구분
  • 인터페이스 기반 설계로 유연성 확보

🛠 작업 내용

  • 작업 할 내용을 입력해주세요.

  • 서비스 분리

  • 테스트 수정


🚀 기타 사항

  • 로직은 건드리지 않고 분리 및 컨벤션 수정만 진행했습니다!

@Do-oya Do-oya self-assigned this May 10, 2025
@Do-oya Do-oya added 🎨refactor 프로덕션 코드 리팩토링 💡test 테스트 추가, 테스트 리팩토링(프로덕션 코드 변경 X) labels May 10, 2025
SignUpResponse response = userSignUpService.signUp(request);

// then
assertNotNull(response);
Copy link
Contributor

Choose a reason for hiding this comment

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

해당 방식은 첫 줄에서 실패하면 그대로 테스트가 끝나서 assertAll로 묶어서 한 번에 테스트 하는 방향도 추천드려요!

Copy link
Member Author

Choose a reason for hiding this comment

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

좋은 의견 감사합니다!
저는 테스트가 성공하는 케이스니까, 처음 실패하면 바로 종료돼도 괜찮다고 생각했었는데요, 말씀해주신 것처럼 전체 검증을 묶어서 실행하면 더 많은 정보를 한 번에 확인할 수 있어서 훨씬 좋은 방법인 것 같네요!
assertAll로 묶어서 테스트 작성하는 것으로 수정해보겠습니다!

… 강화, when -> given, verify -> then 스타일로 변경하여 BDD 가독성 향상
@Do-oya Do-oya merged commit 556c844 into dev May 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨refactor 프로덕션 코드 리팩토링 💡test 테스트 추가, 테스트 리팩토링(프로덕션 코드 변경 X)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants