MSG-442 test: 구독 복합키 동등성 계약 검증 추가 - #201
Merged
Merged
Conversation
JaCoCo가 EventNotificationSubscriptionId 16.98%를 보고 — existsById는 DB 쿼리로 가서 자바 equals를 태우지 않아 분기 8개가 전부 미실행이었다. UserGridTest 선례 동형의 계약 테스트 1건으로 분기 100%.
|
Claude finished @s13121312's task in 1m 20s —— View job 리뷰 완료확인 범위
발견: 없음 참고: 샌드박스 권한 제약으로 |
테스트 커버리지
|
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.
🎫 관련 티켓
작업 내용
EventNotificationSubscriptionId(행사 알림 구독 복합 기본키)의 동등성 계약 테스트 1건을 추가합니다. JaCoCo가 이 클래스 커버리지 16.98%를 보고했는데, 런타임 경로(existsById)가 DB 쿼리로 나가서 자바equals를 태우지 않아 분기 8개가 전부 미실행이었기 때문입니다.UserGridTest의 복합키 동등성 테스트 선례와 같은 형태로, 자기 참조·같은 쌍 동등(+hashCode 동일)·필드별 비동등·타입 불일치·null까지 분기 전부를 검증합니다.🤔 고민한 내용
equals/hashCode는 영속성 컨텍스트 정체성 계약이라 보일러플레이트여도 검증 가치가 있고, 레포 관례(UserGridId)도 이미 테스트를 두고 있어 관례 정합 쪽을 택했습니다.event/entity/순수 JUnit입니다 — equals 한 건 때문에@SpringBootTest컨텍스트를 끌고 오지 않기 위해서입니다.👀 리뷰 포인트