[BOM-1163] refactor: 테스트 코드 개선#788
Merged
Hidden character warning
The head ref may contain hidden characters: "BOM-1163-\ud14c\uc2a4\ud2b8-\ucf54\ub4dc-\uac1c\uc120"
Merged
Conversation
ef8bb12 to
72cbb7e
Compare
Choidongjun0830
approved these changes
Jun 25, 2026
minSsan
approved these changes
Jun 25, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
미루고 미루다 드디어 테스트 코드를 개선했습니다. 🥹
저번에 이야기 나눈대로 기준은 아래처럼 잡았습니다.
왜 이렇게 전략을 세웠고 세부 사항들은 따로 정리해두었습니다.
봄봄 테스트 코드 작성 가이드 라인
핵심 변경
Why
@MockitoBean, 수동 repository 삭제, fixture 생성 방식이 달라 Spring Context 재사용이 어렵고 setup 코드가 비대해졌습니다.TestFixture기본값에 사전 조건이 숨어 있어 테스트만 보고 어떤 데이터로 어떤 시나리오를 검증하는지 파악하기 어려웠습니다.deleteAllInBatch()정리 체인이 누락되거나 순서가 달라지면 데이터 충돌이 날 수 있어, 테스트 격리 방식이 파일마다 흔들렸습니다.How
Controller ~ DB흐름을 통과하는@AcceptanceTest로 검증했습니다.TestFixture로 즉석 생성하기보다 JSON dataset에 고정 ID로 명시해 사전 조건이 보이도록 했습니다.@ResetsAcceptanceData를 붙여 전체 수동 삭제를 줄였습니다.@IntegrationTest로 남겼고, 순수 정책은 Domain 단위 테스트로 분리했습니다.CleanUp,AcceptanceDataSetLoader, support 패키지 분리로 새 테스트가 같은 방식으로 작성되도록 기반을 정리했습니다.Review Points
CleanUp/dataset loader의 데이터 격리 흐름이 안정적인지Verification
./gradlew test --rerun-tasksgit merge-tree origin/server-dev HEADconflict 없음 확인