somasorosdpc commented on code in PR #4116:
URL: https://github.com/apache/fineract/pull/4116#discussion_r1822186867


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanInterestRefundTest.java:
##########
@@ -432,6 +435,285 @@ public void verifyUC05() {
         });
     }
 
+    @Test
+    public void verifyUC06() {
+        AtomicReference<Long> loanIdRef = new AtomicReference<>();
+        runAt("1 December 2020", () -> {
+            PostLoanProductsResponse loanProduct = loanProductHelper
+                    
.createLoanProduct(create4IProgressive().daysInMonthType(DaysInMonthType.ACTUAL)
 //
+                            .daysInYearType(DaysInYearType.ACTUAL) //
+                            .supportedInterestRefundTypes(new 
ArrayList<>()).addSupportedInterestRefundTypesItem("PAYOUT_REFUND") //
+                            
.addSupportedInterestRefundTypesItem("MERCHANT_ISSUED_REFUND") //
+                            
.recalculationRestFrequencyType(RecalculationRestFrequencyType.DAILY) //
+            );
+            Long loanId = applyAndApproveProgressiveLoan(client.getClientId(), 
loanProduct.getResourceId(), "1 December 2020", 1000.0, 9.99,
+                    6, null);
+            Assertions.assertNotNull(loanId);
+            loanIdRef.set(loanId);
+            disburseLoan(loanId, BigDecimal.valueOf(1000), "1 December 2020");
+
+        });
+        runAt("14 December 2020", () -> {
+            Long loanId = loanIdRef.get();
+            PostLoansLoanIdTransactionsResponse 
postLoansLoanIdTransactionsResponse = loanTransactionHelper
+                    .makeLoanRepayment("PayoutRefund", "14 December 2020", 
500F, loanId.intValue());
+            Assertions.assertNotNull(postLoansLoanIdTransactionsResponse);
+            
Assertions.assertNotNull(postLoansLoanIdTransactionsResponse.getResourceId());
+
+            logTransactions(loanId);
+            verifyTransactions(loanId, transaction(1000.0, "Disbursement", "01 
December 2020"), //
+                    transaction(500.0, "Payout Refund", "14 December 2020"), //
+                    transaction(1.78, "Interest Refund", "14 December 2020"));
+        });
+    }
+
+    @Test
+    public void verifyUC07() {
+        AtomicReference<Long> loanIdRef = new AtomicReference<>();
+        runAt("1 January 2021", () -> {
+            PostLoanProductsResponse loanProduct = loanProductHelper
+                    
.createLoanProduct(create4IProgressive().daysInMonthType(DaysInMonthType.ACTUAL)
 //
+                            .daysInYearType(DaysInYearType.ACTUAL) //
+                            .supportedInterestRefundTypes(new 
ArrayList<>()).addSupportedInterestRefundTypesItem("PAYOUT_REFUND") //
+                            
.addSupportedInterestRefundTypesItem("MERCHANT_ISSUED_REFUND") //

Review Comment:
   I've created a static class in Base class for options, and removed the 
unnecessary `.supportedInterestRefundTypes(new ArrayList<>())` 



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