fix(MX-384): update enrollment and transfer test setup - #183
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe tests now initialize tenant context and use fixed transaction dates. Account transfer tests mock transaction-date services and reset thread-local tenant state. Registration tests stub fixed creation and token-expiry timestamps. ChangesSelf-service test determinism
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/test/java/org/apache/fineract/selfservice/account/service/SelfAccountTransferWritePlatformServiceImplTest.java (1)
15-15: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueUse the Fineract transfer date constants in the date stub.
getCurrentDateForFineract(...)is only called from this service withFINERACT_TRANSFER_DATE_FORMATandFINERACT_TRANSFER_LOCALEin this PR code, and these constants are already available in the class under test and the test file. Replace the genericanyString()matchers witheq(FINERACT_TRANSFER_DATE_FORMAT, FINERACT_TRANSFER_LOCALE)so the stub matches the real caller contract and rejects unexpected argument changes.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/org/apache/fineract/selfservice/account/service/SelfAccountTransferWritePlatformServiceImplTest.java` at line 15, Update the date stubbing in SelfAccountTransferWritePlatformServiceImplTest to match getCurrentDateForFineract with the specific FINERACT_TRANSFER_DATE_FORMAT and FINERACT_TRANSFER_LOCALE constants using eq matchers, replacing the generic anyString matcher while preserving the service’s caller contract.src/test/java/org/apache/fineract/selfservice/registration/service/SelfServiceRegistrationWritePlatformServiceImplTest.java (1)
230-233: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winMake the timestamp stubs verify the date flow.
calculateExpiry(any())returnsexpectedExpiryfor every argument. The test can therefore miss an incorrect creation timestamp or missing timestamp persistence. MatchcreatedAtexactly and verify the saved registration containscreatedAtandexpectedExpiry.Proposed matcher change
- when(selfServiceAuthorizationTokenService.calculateExpiry(any())).thenReturn(expectedExpiry); + when(selfServiceAuthorizationTokenService.calculateExpiry(eq(createdAt))) + .thenReturn(expectedExpiry);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/org/apache/fineract/selfservice/registration/service/SelfServiceRegistrationWritePlatformServiceImplTest.java` around lines 230 - 233, Update the timestamp stubs in SelfServiceRegistrationWritePlatformServiceImplTest to make calculateExpiry match the exact createdAt value instead of any argument, then verify the persisted registration uses createdAt as its creation timestamp and expectedExpiry as its expiry timestamp. Preserve the existing test flow while asserting both values on the saved registration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@src/test/java/org/apache/fineract/selfservice/account/service/SelfAccountTransferWritePlatformServiceImplTest.java`:
- Line 15: Update the date stubbing in
SelfAccountTransferWritePlatformServiceImplTest to match
getCurrentDateForFineract with the specific FINERACT_TRANSFER_DATE_FORMAT and
FINERACT_TRANSFER_LOCALE constants using eq matchers, replacing the generic
anyString matcher while preserving the service’s caller contract.
In
`@src/test/java/org/apache/fineract/selfservice/registration/service/SelfServiceRegistrationWritePlatformServiceImplTest.java`:
- Around line 230-233: Update the timestamp stubs in
SelfServiceRegistrationWritePlatformServiceImplTest to make calculateExpiry
match the exact createdAt value instead of any argument, then verify the
persisted registration uses createdAt as its creation timestamp and
expectedExpiry as its expiry timestamp. Preserve the existing test flow while
asserting both values on the saved registration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: bee6b771-f4f6-47b0-ba35-e9d66772317e
📒 Files selected for processing (2)
src/test/java/org/apache/fineract/selfservice/account/service/SelfAccountTransferWritePlatformServiceImplTest.javasrc/test/java/org/apache/fineract/selfservice/registration/service/SelfServiceRegistrationWritePlatformServiceImplTest.java
2648d20 to
3ac85bd
Compare
Summary
Tests
Summary by CodeRabbit