Description
Add unit tests for the payment gateway integration using JUnit 5 and Mockito. The current implementation lacks coverage for payment flows, verification, and failure handling, which may lead to inconsistent transactions.
Tasks
- Set up test configuration for JUnit 5
- Mock dependencies using Mockito
- Write unit tests for payment controller/service
- Test successful payment flow
- Test payment failure scenarios
- Mock payment gateway API (e.g., Razorpay)
- Verify webhook/signature validation logic
- Test idempotency to prevent duplicate charges
- Validate transaction data persistence
- Test error handling and edge cases
- Ensure good test coverage
Description
Add unit tests for the payment gateway integration using JUnit 5 and Mockito. The current implementation lacks coverage for payment flows, verification, and failure handling, which may lead to inconsistent transactions.
Tasks