awaneetdecoder commented on PR #5623: URL: https://github.com/apache/fineract/pull/5623#issuecomment-4068999039
Hi @adamsaghy, thank you for the feedback. You are absolutely right — the current tests focus more on behavioral verification (ensuring the service orchestrates calls to repositories, recalculates interest on backdated entries, and triggers journal entries) rather than state-based verification of the SavingsAccount balance logic itself. I used mock(SavingsAccount.class) to isolate SavingsAccountDomainServiceJpa from the complex internal state of the JPA entity, which is difficult to instantiate correctly in a pure unit test without a persistence context. My proposal to improve this: Keep the tests that verify real orchestration — backdated interest recalculation, journal entries, reversal repository save. Remove or refactor the weak tests that only verify mocked exception throwing. If the project prefers integration tests for this service to exercise full JPA/entity logic, please point me to a preferred base class (like AbstractIntegrationTest) and I will rewrite accordingly. Which approach aligns best with the project's testing standards for this module? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
