FINERACT-2326: Loan contract termination same disbursement date - E2E

This commit is contained in:
Peter Kovacs
2025-11-13 12:47:46 +01:00
committed by Adam Saghy
parent a0b31bbb25
commit 1b3217be39
3 changed files with 17 additions and 2 deletions
@@ -5341,6 +5341,20 @@ public class LoanStepDef extends AbstractStepDef {
.isEqualTo(transactionId);
}
@And("Admin successfully terminates loan contract - no event check")
public void makeLoanContractTerminationNoEventCheck() throws IOException {
final Response<PostLoansResponse> loanResponse = testContext().get(TestContextKey.LOAN_CREATE_RESPONSE);
assert loanResponse.body() != null;
final long loanId = loanResponse.body().getLoanId();
final PostLoansLoanIdRequest contractTerminationRequest = LoanRequestFactory.defaultLoanContractTerminationRequest();
final Response<PostLoansLoanIdResponse> loanContractTerminationResponse = loansApi
.stateTransitions(loanId, contractTerminationRequest, "contractTermination").execute();
testContext().set(TestContextKey.LOAN_CONTRACT_TERMINATION_RESPONSE, loanContractTerminationResponse);
ErrorHelper.checkSuccessfulApiCall(loanContractTerminationResponse);
}
@And("Admin successfully undoes loan contract termination")
public void undoLoanContractTermination() throws IOException {
final Response<PostLoansResponse> loanResponse = testContext().get(TestContextKey.LOAN_CREATE_RESPONSE);
@@ -1327,7 +1327,7 @@ Feature: Contract Termination
| LP2_ADV_PYMNT_INTEREST_DAILY_INTEREST_RECALCULATION_CONTRACT_TERMINATION | 01 January 2025 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 4 | MONTHS | 1 | MONTHS | 4 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION |
And Admin successfully approves the loan on "01 January 2025" with "100" amount and expected disbursement date on "01 January 2025"
And Admin successfully disburse the loan on "01 January 2025" with "100" EUR transaction amount
And Admin successfully terminates loan contract
And Admin successfully terminates loan contract - no event check
Then Loan Repayment schedule has 1 periods, with the following data for periods:
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
| | | 01 January 2025 | | 100.0 | | | 0.0 | | 0.0 | 0.0 | | | |
@@ -1349,7 +1349,7 @@ Feature: Contract Termination
| LP2_ADV_PYMNT_INTEREST_DAILY_INTEREST_RECALCULATION_CONTRACT_TERMINATION_INT_RECOGNITION | 01 January 2025 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 4 | MONTHS | 1 | MONTHS | 4 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION |
And Admin successfully approves the loan on "01 January 2025" with "100" amount and expected disbursement date on "01 January 2025"
And Admin successfully disburse the loan on "01 January 2025" with "100" EUR transaction amount
And Admin successfully terminates loan contract
And Admin successfully terminates loan contract - no event check
Then Loan Repayment schedule has 1 periods, with the following data for periods:
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
| | | 01 January 2025 | | 100.0 | | | 0.0 | | 0.0 | 0.0 | | | |
@@ -2255,4 +2255,5 @@ public final class LoanApplicationTerms {
public void updateVariationDays(final long daysToAdd) {
this.variationDays += daysToAdd;
}
}