FINERACT-2181: Fix integration test / unify getLoanRepaymentScheduleDetail()

This commit is contained in:
Adam Saghy
2025-06-06 15:08:40 +02:00
parent caf42f733c
commit 19b2a77127
12 changed files with 24 additions and 28 deletions
@@ -1226,7 +1226,7 @@ public class AdvancedPaymentScheduleTransactionProcessor extends AbstractLoanRep
final MathContext mc = MoneyHelper.getMathContext();
Loan loan = disbursementTransaction.getLoan();
LoanProductRelatedDetail loanProductRelatedDetail = loan.getLoanRepaymentScheduleDetail();
Integer installmentAmountInMultiplesOf = loan.getLoanProductRelatedDetail().getInstallmentAmountInMultiplesOf();
Integer installmentAmountInMultiplesOf = loanProductRelatedDetail.getInstallmentAmountInMultiplesOf();
List<LoanRepaymentScheduleInstallment> installments = transactionCtx.getInstallments();
LocalDate transactionDate = disbursementTransaction.getTransactionDate();
MonetaryCurrency currency = transactionCtx.getCurrency();
@@ -529,12 +529,11 @@ class AdvancedPaymentScheduleTransactionProcessorTest {
LoanProductRelatedDetail loanProductRelatedDetail = mock(LoanProductRelatedDetail.class);
org.apache.fineract.portfolio.loanproduct.domain.LoanProduct loanProduct = mock(
org.apache.fineract.portfolio.loanproduct.domain.LoanProduct.class);
when(loanProduct.getInstallmentAmountInMultiplesOf()).thenReturn(null);
when(loanProductRelatedDetail.getInstallmentAmountInMultiplesOf()).thenReturn(null);
when(loanProductRelatedDetail.isEnableDownPayment()).thenReturn(false);
Loan loan = mock(Loan.class);
when(loan.getLoanRepaymentScheduleDetail()).thenReturn(loanProductRelatedDetail);
when(loan.getLoanProduct()).thenReturn(loanProduct);
when(loan.isInterestBearing()).thenReturn(true);
LoanRepaymentScheduleInstallment installment1 = spy(