Skip to content

Commit d269cb9

Browse files
MarianaDmytrivBinariksadamsaghy
authored andcommitted
FINERACT-2406: e2e test scenarios for flush mode while reprocessing
1 parent ccf760c commit d269cb9

File tree

4 files changed

+719
-5
lines changed

4 files changed

+719
-5
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ public enum DefaultLoanProduct implements LoanProduct {
171171
LP1_INTEREST_FLAT_SAR_RECALCULATION_SAME_AS_REPAYMENT_MULTIDISB_AUTO_DOWNPAYMENT, //
172172
LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_DAILY, //
173173
LP1_WITH_OVERRIDES, //
174-
LP1_NO_OVERRIDES //
174+
LP1_NO_OVERRIDES, //
175+
LP2_ADV_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OF_ACCRUAL, //
176+
LP2_ADV_CUSTOM_PMT_ALLOC_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OFF_ACCRUAL, //
175177
;
176178

177179
@Override

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

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3983,9 +3983,9 @@ public void initialize() throws Exception {
39833983
.getName();
39843984
PostLoanProductsRequest loanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmi36030InterestRecalculationDaily = loanProductsRequestFactory
39853985
.defaultLoanProductsRequestLP2Emi()//
3986-
.supportedInterestRefundTypes(supportedInterestRefundTypes)
3987-
// .installmentAmountInMultiplesOf(null) //
39883986
.name(name147)//
3987+
.supportedInterestRefundTypes(supportedInterestRefundTypes) //
3988+
.installmentAmountInMultiplesOf(null) //
39893989
.daysInYearType(DaysInYearType.DAYS360.value)//
39903990
.daysInMonthType(DaysInMonthType.DAYS30.value)//
39913991
.isInterestRecalculationEnabled(true)//
@@ -4105,6 +4105,64 @@ public void initialize() throws Exception {
41054105
final Response<PostLoanProductsResponse> responseNoOverrides = loanProductsApi.createLoanProduct(loanProductsRequestNoOverrides)
41064106
.execute();
41074107
TestContext.INSTANCE.set(TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP1_NO_OVERRIDES, responseNoOverrides);
4108+
4109+
// LP2 advanced + progressive loan schedule + horizontal + interest recalculation
4110+
// Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1
4111+
String name148 = DefaultLoanProduct.LP2_ADV_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OF_ACCRUAL.getName();
4112+
PostLoanProductsRequest loanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmiActualInterestRecalcZeroChargeOffChargebackAccruals = loanProductsRequestFactory
4113+
.defaultLoanProductsRequestLP2Emi()//
4114+
.name(name148)//
4115+
.supportedInterestRefundTypes(supportedInterestRefundTypes).installmentAmountInMultiplesOf(null) //
4116+
.daysInYearType(DaysInYearType.ACTUAL.value)//
4117+
.daysInMonthType(DaysInMonthType.ACTUAL.value)//
4118+
.daysInYearCustomStrategy(FEB_29_PERIOD_ONLY.getValue()).isInterestRecalculationEnabled(true)//
4119+
.preClosureInterestCalculationStrategy(1)//
4120+
.rescheduleStrategyMethod(4)//
4121+
.interestRecalculationCompoundingMethod(0)//
4122+
.recalculationRestFrequencyType(2)//
4123+
.recalculationRestFrequencyInterval(1)//
4124+
.enableAccrualActivityPosting(true) //
4125+
.chargeOffBehaviour(ZERO_INTEREST.value)//
4126+
.paymentAllocation(List.of(//
4127+
createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"))); //
4128+
Response<PostLoanProductsResponse> responseLoanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmiActualInterestRecalcZeroChargeOffChargebackAccruals = loanProductsApi
4129+
.createLoanProduct(
4130+
loanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmiActualInterestRecalcZeroChargeOffChargebackAccruals)
4131+
.execute();
4132+
TestContext.INSTANCE.set(
4133+
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OF_ACCRUAL,
4134+
responseLoanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmiActualInterestRecalcZeroChargeOffChargebackAccruals);
4135+
4136+
// LP2 advanced custom payment allocation + progressive loan schedule + horizontal + interest recalculation
4137+
// Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1
4138+
String name149 = DefaultLoanProduct.LP2_ADV_CUSTOM_PMT_ALLOC_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OFF_ACCRUAL
4139+
.getName();
4140+
PostLoanProductsRequest loanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmiActualInterestRecalcZeroChargeOffAccruals = loanProductsRequestFactory
4141+
.defaultLoanProductsRequestLP2Emi()//
4142+
.name(name149)//
4143+
.supportedInterestRefundTypes(supportedInterestRefundTypes).installmentAmountInMultiplesOf(null) //
4144+
.daysInYearType(DaysInYearType.ACTUAL.value)//
4145+
.daysInMonthType(DaysInMonthType.ACTUAL.value)//
4146+
.daysInYearCustomStrategy(FEB_29_PERIOD_ONLY.getValue()).isInterestRecalculationEnabled(true)//
4147+
.preClosureInterestCalculationStrategy(1)//
4148+
.rescheduleStrategyMethod(4)//
4149+
.interestRecalculationCompoundingMethod(0)//
4150+
.recalculationRestFrequencyType(2)//
4151+
.recalculationRestFrequencyInterval(1)//
4152+
.enableAccrualActivityPosting(true) //
4153+
.chargeOffBehaviour(ZERO_INTEREST.value)//
4154+
.paymentAllocation(List.of(//
4155+
createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), //
4156+
createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), //
4157+
createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), //
4158+
createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT"))); //
4159+
Response<PostLoanProductsResponse> responseLoanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmiActualInterestRecalcZeroChargeOffAccruals = loanProductsApi
4160+
.createLoanProduct(
4161+
loanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmiActualInterestRecalcZeroChargeOffAccruals)
4162+
.execute();
4163+
TestContext.INSTANCE.set(
4164+
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_CUSTOM_PMT_ALLOC_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OFF_ACCRUAL,
4165+
responseLoanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmiActualInterestRecalcZeroChargeOffAccruals);
41084166
}
41094167

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,6 @@ public abstract class TestContextKey {
278278
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_PROGRESSIVE_ADV_PYMNT_WRITE_OFF_REASON_MAP = "loanProductCreateResponseLP2ProgressiveAdvancedPaymentWriteOffReasonMap";
279279
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP1_WITH_OVERRIDES = "loanProductCreateResponseLP1WithOverrides";
280280
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP1_NO_OVERRIDES = "loanProductCreateResponseLP1NoOverrides";
281+
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OF_ACCRUAL = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmiActualInterestRecalcChargeOffAccruals";
282+
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_CUSTOM_PMT_ALLOC_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OFF_ACCRUAL = "loanProductCreateResponseLP2AdvancedPaymentCustomAllocationInterestDailyEmiActualInterestRecalcChargeOffAccruals";
281283
}

0 commit comments

Comments
 (0)