test: HealthService 단위 테스트 추가 - #218
Conversation
createHealthData/getHealthData/getHealthSummary/deleteHealthData 전체 메서드에 대해 정상 케이스 + 예외 케이스 + 경계값 검증 (22개). 버그는 발견되지 않음 — 소유권 검증(record.getRunnectUser().getId().equals(userId))을 일관되게 사용하고 있고, 동시성 경쟁으로 인한 유니크 제약 위반도 DataIntegrityViolationException을 잡아 409로 변환하는 등 이번에 테스트한 서비스 중 가장 방어적으로 잘 짜여있었음.
|
Warning Review limit reached
Next review available in: 3 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
작업 배경
변경 사항
HealthServiceTest이번엔 버그가 발견되지 않음. 소유권 검증(
record.getRunnectUser().getId().equals(userId))을 4개 메서드 전부에서 일관되게 사용하고 있고, 동시성 경쟁으로 인한 유니크 제약 위반(DataIntegrityViolationException)도 미리 잡아서 409로 변환하는 등, 지금까지 테스트한 서비스 중 가장 방어적으로 잘 짜여있었음 — 다른 서비스들의 IDOR 패턴을 고칠 때 참고한 기준이 이 서비스였음.영향 범위
검증 매트릭스
정상_생성_샘플없음•
정상_생성_샘플있음•
기본_최대심박수_사용존재하지_않는_레코드•
소유자가_아님•
평균심박수_0이하•
칼로리_음수•
심박수_샘플_초과•
이미_존재하는_건강데이터•
동시성_경쟁으로_인한_제약위반정상_조회•
건강데이터_없음•
존재하지_않는_레코드•
소유자가_아님정상_조회•
집계_결과_없음•
잘못된_날짜형식•
종료일이_시작일보다_빠름정상_삭제•
존재하지_않는_레코드•
소유자가_아님•
건강데이터_없음Test Plan
./gradlew build전체(기존 ServerApplicationTests 포함) 통과 확인🤖 Generated with Claude Code