FINERACT-2326: Not implemented exception handling

This commit is contained in:
Adam Saghy
2025-12-03 12:40:55 +01:00
parent c50ed19959
commit f55b63432e
5 changed files with 120 additions and 9 deletions
@@ -538,4 +538,21 @@ public class LoanReAgingStepDef extends AbstractStepDef {
}
return request;
}
@When("Admin creates a Loan re-aging transaction by Loan external ID with the following data, but fails with {int} error code:")
public void adminCreatesALoanReAgingTransactionByLoanExternalIDWithTheFollowingDataButFailsWithErrorCode(int errorCode,
DataTable table) {
PostLoansResponse loanResponse = testContext().get(TestContextKey.LOAN_CREATE_RESPONSE);
String loanExternalId = loanResponse.getResourceExternalId();
PostLoansLoanIdTransactionsRequest reAgingRequest = setReAgeingRequestProperties(//
LoanRequestFactory.defaultReAgingRequest(), //
table.row(0), //
table.row(1) //
);
CallFailedRuntimeException response = fail(() -> fineractClient.loanTransactions().executeLoanTransaction1(loanExternalId,
reAgingRequest, Map.<String, Object>of("command", "reAge")));
assertThat(response.getStatus()).isEqualTo(errorCode);
}
}