Skip to content

Commit 1596d09

Browse files
MarianaDmytrivBinariksadamsaghy
authored andcommitted
FINERACT-2390: e2e test scenarios for infinite loop with MIR trn issue
1 parent 331a762 commit 1596d09

File tree

4 files changed

+380
-1
lines changed

4 files changed

+380
-1
lines changed

fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public enum DefaultLoanProduct implements LoanProduct {
169169
LP1_INTEREST_FLAT_SAR_RECALCULATION_DAILY_360_30_APPROVED_OVER_APPLIED_MULTIDISB, //
170170
LP1_INTEREST_FLAT_DAILY_RECALCULATION_DAILY_360_30_MULTIDISB, //
171171
LP1_INTEREST_FLAT_SAR_RECALCULATION_SAME_AS_REPAYMENT_MULTIDISB_AUTO_DOWNPAYMENT, //
172+
LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_DAILY, //
172173
;
173174

174175
@Override

fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.apache.fineract.test.initializer.global;
2020

2121
import static org.apache.fineract.client.models.LoanProductRelatedDetail.DaysInYearCustomStrategyEnum.FEB_29_PERIOD_ONLY;
22+
import static org.apache.fineract.test.data.ChargeOffBehaviour.ZERO_INTEREST;
2223
import static org.apache.fineract.test.data.TransactionProcessingStrategyCode.ADVANCED_PAYMENT_ALLOCATION;
2324
import static org.apache.fineract.test.factory.LoanProductsRequestFactory.INTEREST_CALCULATION_PERIOD_TYPE_SAME_AS_REPAYMENT;
2425
import static org.apache.fineract.test.factory.LoanProductsRequestFactory.INTEREST_RATE_FREQUENCY_TYPE_MONTH;
@@ -3974,6 +3975,87 @@ public void initialize() throws Exception {
39743975
TestContext.INSTANCE.set(
39753976
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP1_INTEREST_FLAT_SAR_RECALCULATION_SAME_AS_REPAYMENT_MULTIDISB_AUTO_DOWNPAYMENT,
39763977
responseLoanProductsRequestInterestFlatSaRRecalculationSameAsRepaymentMultiDisbursementAUtoDownPayment);
3978+
3979+
// LP2 advanced custom payment allocation + progressive loan schedule + horizontal + interest recalculation
3980+
// Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1
3981+
String name147 = DefaultLoanProduct.LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_DAILY
3982+
.getName();
3983+
PostLoanProductsRequest loanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmi36030InterestRecalculationDaily = loanProductsRequestFactory
3984+
.defaultLoanProductsRequestLP2Emi()//
3985+
.supportedInterestRefundTypes(supportedInterestRefundTypes)
3986+
// .installmentAmountInMultiplesOf(null) //
3987+
.name(name147)//
3988+
.daysInYearType(DaysInYearType.DAYS360.value)//
3989+
.daysInMonthType(DaysInMonthType.DAYS30.value)//
3990+
.isInterestRecalculationEnabled(true)//
3991+
.preClosureInterestCalculationStrategy(1)//
3992+
.rescheduleStrategyMethod(4)//
3993+
.interestRecalculationCompoundingMethod(0)//
3994+
.recalculationRestFrequencyType(2)//
3995+
.recalculationRestFrequencyInterval(1)//
3996+
.enableAccrualActivityPosting(true) //
3997+
.chargeOffBehaviour(ZERO_INTEREST.value)//
3998+
.paymentAllocation(List.of(//
3999+
createPaymentAllocation("MERCHANT_ISSUED_REFUND", "LAST_INSTALLMENT",
4000+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_INTEREST, //
4001+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PRINCIPAL, //
4002+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PENALTY, //
4003+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_FEE, //
4004+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_INTEREST, //
4005+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PRINCIPAL, //
4006+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PENALTY, //
4007+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_FEE, //
4008+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_INTEREST, //
4009+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PRINCIPAL, //
4010+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PENALTY, //
4011+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_FEE), //
4012+
createPaymentAllocation("GOODWILL_CREDIT", "REAMORTIZATION",
4013+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PRINCIPAL, //
4014+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_INTEREST, //
4015+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PENALTY, //
4016+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_FEE, //
4017+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PRINCIPAL, //
4018+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_INTEREST, //
4019+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PENALTY, //
4020+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_FEE, //
4021+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PRINCIPAL, //
4022+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_INTEREST, //
4023+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PENALTY, //
4024+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_FEE), //
4025+
createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT",
4026+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_INTEREST, //
4027+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PRINCIPAL, //
4028+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PENALTY, //
4029+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_FEE, //
4030+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_INTEREST, //
4031+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PRINCIPAL, //
4032+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PENALTY, //
4033+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_FEE, //
4034+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_INTEREST, //
4035+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PRINCIPAL, //
4036+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PENALTY, //
4037+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_FEE), //
4038+
createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT",
4039+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_INTEREST, //
4040+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PRINCIPAL, //
4041+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PENALTY, //
4042+
LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_FEE, //
4043+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_INTEREST, //
4044+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PRINCIPAL, //
4045+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PENALTY, //
4046+
LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_FEE, //
4047+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_INTEREST, //
4048+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PRINCIPAL, //
4049+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PENALTY, //
4050+
LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_FEE) //
4051+
));//
4052+
Response<PostLoanProductsResponse> responseLoanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmi36030InterestRecalculationDaily = loanProductsApi
4053+
.createLoanProduct(
4054+
loanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmi36030InterestRecalculationDaily)
4055+
.execute();
4056+
TestContext.INSTANCE.set(
4057+
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_DAILY,
4058+
responseLoanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmi36030InterestRecalculationDaily);
39774059
}
39784060

39794061
public static AdvancedPaymentData createPaymentAllocation(String transactionType, String futureInstallmentAllocationRule,

fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ public abstract class TestContextKey {
188188
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP1_INTEREST_FLAT_SAR_RECALCULATION_DAILY_360_30_APPROVED_OVER_APPLIED_MULTIDISB = "loanProductCreateResponseLP1InterestFlatSameAsRepaymentRecalculationDaily36030MultiDisbursement";
189189
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP1_INTEREST_FLAT_DAILY_RECALCULATION_DAILY_360_30_MULTIDISB = "loanProductCreateResponseLP1InterestFlatDailyRecalculationDaily36030MultiDisbursement";
190190
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP1_INTEREST_FLAT_SAR_RECALCULATION_SAME_AS_REPAYMENT_MULTIDISB_AUTO_DOWNPAYMENT = "loanProductCreateResponseLP1InterestFlatDailyRecalculationSameAsRepaymentMultiDisbursementAutoDownPayment";
191+
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_DAILY = "loanProductCreateResponseLP2AdvancedPaymentAllocCustomInterestDailyEmi36030InterestRecalculationDaily";
191192
public static final String CHARGE_FOR_LOAN_PERCENT_LATE_CREATE_RESPONSE = "ChargeForLoanPercentLateCreateResponse";
192193
public static final String CHARGE_FOR_LOAN_PERCENT_LATE_AMOUNT_PLUS_INTEREST_CREATE_RESPONSE = "ChargeForLoanPercentLateAmountPlusInterestCreateResponse";
193194
public static final String CHARGE_FOR_LOAN_PERCENT_PROCESSING_CREATE_RESPONSE = "ChargeForLoanPercentProcessingCreateResponse";

0 commit comments

Comments
 (0)