FINERACT-2277: Deprecate findExistingReversedTransactionIds and fetch only the ids from database instead

This commit is contained in:
mariiaKraievska
2025-05-26 14:41:32 +02:00
committed by Adam Saghy
parent 13e4c8b55d
commit 8b86229a3e
15 changed files with 52 additions and 51 deletions
@@ -235,7 +235,7 @@ class LoanAdjustmentServiceImplTest {
// Mock methods called inside adjustExistingTransaction
when(loanTransactionRepository.findTransactionIdsByLoan(loan)).thenReturn(Collections.emptyList());
when(loan.findExistingReversedTransactionIds()).thenReturn(Collections.emptyList());
when(loanTransactionRepository.findReversedTransactionIdsByLoan(loan)).thenReturn(Collections.emptyList());
doNothing().when(loanTransactionValidator).validateActivityNotBeforeClientOrGroupTransferDate(any(), any(), any());
when(loan.isClosedWrittenOff()).thenReturn(false);
when(newTransactionDetail.isRepaymentLikeType()).thenReturn(true);
@@ -280,7 +280,7 @@ class LoanAdjustmentServiceImplTest {
// Mock methods called inside adjustExistingTransaction
when(loanTransactionRepository.findTransactionIdsByLoan(loan)).thenReturn(Collections.emptyList());
when(loan.findExistingReversedTransactionIds()).thenReturn(Collections.emptyList());
when(loanTransactionRepository.findReversedTransactionIdsByLoan(loan)).thenReturn(Collections.emptyList());
doNothing().when(loanTransactionValidator).validateActivityNotBeforeClientOrGroupTransferDate(any(), any(), any());
when(loan.isClosedWrittenOff()).thenReturn(false);
when(newTransactionDetail.isRepaymentLikeType()).thenReturn(true);
@@ -193,7 +193,7 @@ class LoanChargeWritePlatformServiceImplTest {
List<Long> existingTransactionIds = new ArrayList<>();
List<Long> existingReversedTransactionIds = new ArrayList<>();
when(loanTransactionRepository.findTransactionIdsByLoan(loan)).thenReturn(existingTransactionIds);
when(loan.findExistingReversedTransactionIds()).thenReturn(existingReversedTransactionIds);
when(loanTransactionRepository.findReversedTransactionIdsByLoan(loan)).thenReturn(existingReversedTransactionIds);
when(loan.getLoanCharges()).thenReturn(new HashSet<>());
when(loan.getDisbursementDate()).thenReturn(LocalDate.now(ZoneId.systemDefault()));