test: add unit tests for MedicalRecordService#141
test: add unit tests for MedicalRecordService#141annikaholmqvist94 wants to merge 1 commit intomainfrom
Conversation
- Introduced `MedicalRecordServiceTest` to provide thorough coverage for service methods. - Verified `create`, `getById`, `getByPet`, `getByOwner`, `getByClinic`, and similar retrieval methods. - Added tests for core functionalities: `update`, `assignVet`, `updateStatus`, and `close`. - Ensured validation of policies, exception handling, and logging behavior. closes #100
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA comprehensive JUnit 5 test suite for Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 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📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Snygg testat! Ser omfattande ut! |
TatjanaTrajkovic
left a comment
There was a problem hiding this comment.
Ser väldigt bra ut! Bra täckning och tydliga tester. Fundera på att kanske implementera hjälp metoder, för att få mindre kod och mer läsbar test. Ett exempel :
private void mockValidCreateSetup() {
when(petRepository.findById(petId)).thenReturn(Optional.of(pet));
when(clinicRepository.findById(clinicId)).thenReturn(Optional.of(clinic));
when(medicalRecordRepository.save(any(MedicalRecord.class))).thenReturn(record);
}
MedicalRecordServiceTestto provide thorough coverage for service methods.create,getById,getByPet,getByOwner,getByClinic, and similar retrieval methods.update,assignVet,updateStatus, andclose.Summary by CodeRabbit