Skip to content

room 테스트 결합과 dead code를 정리한다#118

Merged
NaMinhyeok merged 3 commits into
mainfrom
cleanup/room-refactor-resistant-tests
Apr 26, 2026
Merged

room 테스트 결합과 dead code를 정리한다#118
NaMinhyeok merged 3 commits into
mainfrom
cleanup/room-refactor-resistant-tests

Conversation

@NaMinhyeok
Copy link
Copy Markdown
Contributor

변경 배경

room 모듈의 테스트 중 일부가 구현 세부, thin delegation, 과거 마이그레이션 경로, 응답의 부재 필드 같은 낮은 가치의 세부사항을 고정하고 있어 리팩토링 내성을 떨어뜨리고 있었습니다. 테스트가 설계 규칙, 도메인 규칙, 외부 계약, 실제 회귀 위험을 보호하도록 범위를 줄이고, 필요한 경우 production 코드의 경계도 함께 정리했습니다.

주요 변경사항

  • 사용하지 않는 room 관련 타입과 fixture/helper를 제거했습니다.
  • Room.join이 참가한 RoomTeamLeader를 반환하도록 바꿔 JoinRoom이 저장된 aggregate를 다시 탐색하지 않도록 정리했습니다.
  • CreateRoom/JoinRoom의 세션 반환 경로를 단순화하고, 구현 탐색을 고정하던 JoinRoomTest를 제거했습니다.
  • 경매 마감 스케줄러가 구체 구현인 SettleAuction, JpaAuctionScheduleReader 대신 AuctionSettlementRunner, AuctionScheduleReader 계약에 의존하도록 정리했습니다.
  • 스케줄러 테스트에서 JPA repository fake와 SettleAuction 상속 fake를 제거하고, 스케줄링 정책만 검증하도록 줄였습니다.
  • JpaAuctionScheduleReader의 pagination 동작은 별도 낮은 레이어 테스트로 이동했습니다.
  • WebMvc 테스트에서 과거 응답 필드 부재, wrapper null, 반복적인 성공 포맷 확인 등 리팩토링에 취약한 assert를 제거했습니다.
  • repository, realtime, migration 통합 테스트에서 중복 검증과 과거 이행 과정 고정에 가까운 케이스를 줄였습니다.

검증

  • ./gradlew check
  • ./gradlew integrationTest
  • git diff --check

리뷰 포인트

  • 제거된 테스트가 실제 회귀 위험이 아니라 구현 choreography나 중복 검증을 고정하던 테스트인지 확인해 주세요.
  • 새로 추가한 AuctionSettlementRunner, AuctionScheduleReader가 스케줄러의 내부 경계를 적절히 드러내는지 확인해 주세요.
  • room API 테스트가 외부 계약을 충분히 보호하면서도 response shape 전체를 과하게 고정하지 않는지 확인해 주세요.

@NaMinhyeok NaMinhyeok marked this pull request as ready for review April 26, 2026 15:22
@NaMinhyeok NaMinhyeok merged commit cb11237 into main Apr 26, 2026
2 checks passed
@NaMinhyeok NaMinhyeok deleted the cleanup/room-refactor-resistant-tests branch April 26, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant