diff --git a/NEWS.md b/NEWS.md index 0fb059c85e..cb301962cb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ * Fix flaky tests ([CIRC-2633](https://folio-org.atlassian.net/browse/CIRC-2633)) * Refactor item location handling to use locationRepository directly for effective location retrieval ([CIRC-2538](https://folio-org.atlassian.net/browse/CIRC-2538)) * Fail on startup if Kafka config is invalid ([CIRC-2003](https://folio-org.atlassian.net/browse/CIRC-2003)) +* Fix loan status in `AnonymizeLoansTests` fixture for closed loans with open fees ([CIRC-2641](https://folio-org.atlassian.net/browse/CIRC-2641)) ## 24.5.0 2026-04-14 * Allow HTTP Connection Pool to be Configurable ([CIRC-2279](https://folio-org.atlassian.net/browse/CIRC-2279)) diff --git a/src/test/java/org/folio/circulation/domain/anonymization/AnonymizeLoansTests.java b/src/test/java/org/folio/circulation/domain/anonymization/AnonymizeLoansTests.java index a7f9da1bf4..0c695179c4 100644 --- a/src/test/java/org/folio/circulation/domain/anonymization/AnonymizeLoansTests.java +++ b/src/test/java/org/folio/circulation/domain/anonymization/AnonymizeLoansTests.java @@ -59,11 +59,12 @@ void doNotAnonymizeOpenLoanWithNoFees() { } @Test - void doNotAnonymizeClosedLoanWithOpenFees() { + void anonymizeClosedLoanWithOpenFees() { final var segregatedLoans = checker.segregateLoans(List.of(closedLoanWithOpenFee())); assertThat(segregatedLoans.size(), is(1)); - assertThat(loansNotAnonymizedImmediately(segregatedLoans).size(), is(1)); + // Fees and fines are ignored when loans with fees should not be treated differently + assertThat(anonymizedLoans(segregatedLoans).size(), is(1)); } @Test @@ -381,7 +382,7 @@ private Loan closedLoanWithClosedFee(ZonedDateTime feeClosedDate) { } private Loan closedLoanWithOpenFee() { - return loan("Open", null) + return loan("Closed", null) .withAccounts(List.of(openFee())); }