[test] 급여 계산 경계값 테스트 추가#92
Hidden character warning
Conversation
Walkthrough정밀도(1원) 검증, 경계값(분 단위 포함) 및 복합 시나리오를 검증하는 테스트들이 추가되었고, 데이터셋 기반 테스트와 해당 JSON 픽스처가 새로 도입되었습니다. 프로덕션 코드 변경은 없습니다. Changes
Sequence Diagram(s)(생성 조건 미충족 — 변경은 테스트 추가/정밀 검증에 국한되어 있어 다중 컴포넌트 제어 흐름 시각화가 필요하지 않습니다.) 추정 코드 리뷰 노력🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@src/test/java/com/example/paycheck/domain/salary/service/SalaryServiceSimpleTest.java`:
- Around line 311-313: The mock excludedCurrentLastWeek is missing stubs for
getWeeklyPaidLeaveAmount() and getOvertimeAmount(), which can lead to NPEs
because SalaryService calls these before date-filtering; update the test to stub
excludedCurrentLastWeek.getWeeklyPaidLeaveAmount() and
excludedCurrentLastWeek.getOvertimeAmount() with the same style/values used for
includedCurrent and includedPreviousLastWeek so the mock is fully consistent
with those objects and prevents null returns when SalaryService invokes those
methods.
🧹 Nitpick comments (2)
src/test/java/com/example/paycheck/domain/salary/service/SalaryServiceSimpleTest.java (2)
266-268: 테스트 메서드명을 한글로 변경하는 것을 고려해 주세요.코딩 가이드라인에 따르면 테스트 메서드명은 한글 사용이 권장됩니다. 현재 메서드명이 다소 길고 복잡하므로, 한글로 변경하면 가독성이 향상될 수 있습니다.
예시:
급여_자동_계산_시_전월_마지막주차_이월_포함_당월_마지막주차_제외()
333-340: 주휴수당에 대한 명시적 검증 추가를 고려해 주세요.현재
totalGrossPay와overtimePay만 검증하고 있습니다. 이 테스트의 목적이 월 경계 이월 로직 검증이므로, 주휴수당(weeklyPaidLeaveAmount)도 명시적으로 검증하면 테스트 의도가 더 명확해집니다.♻️ 제안하는 추가 검증
// then assertThat(response.getTotalGrossPay()).isEqualByComparingTo(new BigDecimal("192000.00")); assertThat(response.getOvertimePay()).isEqualByComparingTo(new BigDecimal("22000.00")); +// 주휴수당: 30000 (당월) + 40000 (전월 이월) = 70000 +// Note: SalaryDto.Response에 weeklyPaidLeaveAmount 필드가 있다면 검증 추가 assertThat(response.getPaymentDueDate()).isEqualTo("2024-03-25");
📝 변경 사항
주요 변경 내용
상세 설명
✅ 체크리스트
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.