DeathGun44 commented on code in PR #6321:
URL: https://github.com/apache/fineract/pull/6321#discussion_r3865567470


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/ExternalIdSupportIntegrationTest.java:
##########
@@ -664,13 +667,13 @@ public void negativeTest() {
             final Account expenseAccount = 
accountHelper.createExpenseAccount("extIdExpense");
             final Account overpaymentAccount = 
accountHelper.createLiabilityAccount("extIdOverpayment");
 
-            final String loanProductJSON = new 
LoanProductTestBuilder().withPrincipal("1000").withRepaymentTypeAsMonth()
+            final PostLoanProductsRequest loanProductRequest = new 
LoanProductTestBuilder().withPrincipal("1000").withRepaymentTypeAsMonth()
                     
.withRepaymentAfterEvery("1").withNumberOfRepayments("1").withRepaymentTypeAsMonth().withinterestRatePerPeriod("0")
                     
.withInterestRateFrequencyTypeAsMonths().withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat()
                     .withAccountingRulePeriodicAccrual(new Account[] { 
assetAccount, incomeAccount, expenseAccount, overpaymentAccount })
                     
.withDaysInMonth("30").withDaysInYear("365").withMoratorium("0", "0")
-                    
.withFeeAndPenaltyAssetAccount(assetFeeAndPenaltyAccount).build(null);
-            final Integer loanProductID = getLoanProductId(loanProductJSON);
+                    
.withFeeAndPenaltyAssetAccount(assetFeeAndPenaltyAccount).buildRequest(null);
+            final Integer loanProductID = getLoanProductId(loanProductRequest);

Review Comment:
   Agreed. getLoanProductId only existed to downcast the Long that 
createLoanProduct already returns, and applyForLoanApplication converted both 
ids straight back. Both are Long now, which also removes the 
clientId.intValue() at 19 call sites. It turned up a real bug: one test had a 
private applyForLoanApplication(Long, Long, String) whose third argument is a 
principal, while the base method's third argument is an external id. On Integer 
ids the clash was invisible. Renamed it applyForLoanWithPrincipal.



-- 
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]

Reply via email to