Skip to content

CIRC-2641: fix closedLoanWithOpenFee() test method building an open loan#1685

Open
slaemmer wants to merge 1 commit into
masterfrom
CIRC-2641
Open

CIRC-2641: fix closedLoanWithOpenFee() test method building an open loan#1685
slaemmer wants to merge 1 commit into
masterfrom
CIRC-2641

Conversation

@slaemmer

Copy link
Copy Markdown

CIRC-2641

Purpose

AnonymizeLoansTests.closedLoanWithOpenFee() built a loan with status "Open" instead of "Closed". A few tests used this and passed accidentally. One asserted the opposite of the actual behavior. Closed loans should be anonymized without ever checking fees / fines according to here.

Approach

  • Corrected the fixture to build a loan with status "Closed".
  • Renamed WhenAnonymizingAllLoansImmediatelyTests.doNotAnonymizeClosedLoanWithOpenFees to anonymizeClosedLoanWithOpenFees and corrected its assertion

Production code is unchanged; the remaining tests using the method pass unmodified because their configurations set treatLoansWithFeesAndFinesDifferently = true (or use manual anonymization), so they were already reaching a fees-aware checker.

The fixture built a loan with status "Open", so five tests silently
exercised the open-loan path. Correcting it to "Closed" exposed that
WhenAnonymizingAllLoansImmediatelyTests.doNotAnonymizeClosedLoanWithOpenFees
asserted the opposite of the module's behaviour: with
treatLoansWithFeesAndFinesDifferently=false, AnonymizeLoansImmediatelyChecker
only checks loan.isClosed() and ignores fees and fines. Renamed the test
and flipped its assertion to match.
@slaemmer
slaemmer requested a review from a team July 23, 2026 11:49
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants