ruzeynalov commented on code in PR #5825:
URL: https://github.com/apache/fineract/pull/5825#discussion_r3225327461
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java:
##########
@@ -2169,7 +2169,8 @@ public void loanOverpaid(double totalOverpaidExpected) {
() -> fineractClient.loans().retrieveLoan(loanId,
Map.of("staffInSelectedOfficeOnly", "false")));
testContext().set(TestContextKey.LOAN_RESPONSE, loanDetailsResponse);
- Double totalOverpaidActual =
loanDetailsResponse.getTotalOverpaid().doubleValue();
+ Double totalOverpaidActual = (loanDetailsResponse.getTotalOverpaid()
!= null) ? loanDetailsResponse.getTotalOverpaid().doubleValue()
Review Comment:
@galovics Fair point — silent coercion was hiding exactly the regression
this step should catch. Refactored to fail loudly when the API returns null but
the scenario expected a non-zero overpayment, while preserving the legitimate
"loan closed with zero overpayment" case where the field is omitted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]