adamsaghy commented on code in PR #4025:
URL: https://github.com/apache/fineract/pull/4025#discussion_r1719978802


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/AdvancedPaymentAllocationLoanRepaymentScheduleTest.java:
##########
@@ -5095,6 +5095,41 @@ public void uc147b() {
         });
     }
 
+    // uc148a: Advanced payment allocation, with Interest Recalculation in 
Loan Product and Adjust last, unpaid period
+    // ADVANCED_PAYMENT_ALLOCATION_STRATEGY
+    // 1. Create a Loan product with Adv. Pment. Alloc. with Interest 
Recalculation enabled and Adjust last, unpaid
+    // period
+    @Test
+    public void uc148a() {
+        runAt("23 March 2024", () -> {
+            final Integer rescheduleStrategyMethod = 4; // Adjust last, unpaid 
period
+            PostLoanProductsRequest loanProduct = 
createOnePeriod30DaysPeriodicAccrualProductWithAdvancedPaymentAllocationAndInterestRecalculation(
+                    (double) 80.0, rescheduleStrategyMethod);
+
+            PostLoanProductsResponse loanProductResponse = 
loanProductHelper.createLoanProduct(loanProduct);
+            assertNotNull(loanProductResponse);
+        });
+    }
+
+    // uc148b: Negative Test: Advanced payment allocation, with Interest 
Recalculation in Loan Product but try to use
+    // Reduce EMI amount
+    // ADVANCED_PAYMENT_ALLOCATION_STRATEGY
+    // 1. Try to Create a Loan product with Adv. Pment. Alloc. with Interest 
Recalculation enabled and use Reduce EMI
+    // amount
+    @Test
+    public void uc148b() {
+        runAt("23 March 2024", () -> {
+            final Integer rescheduleStrategyMethod = 3; // Reduce EMI amount
+            PostLoanProductsRequest loanProduct = 
createOnePeriod30DaysPeriodicAccrualProductWithAdvancedPaymentAllocationAndInterestRecalculation(
+                    (double) 80.0, rescheduleStrategyMethod);
+
+            CallFailedRuntimeException callFailedRuntimeException = 
Assertions.assertThrows(CallFailedRuntimeException.class,
+                    () -> loanProductHelper.createLoanProduct(loanProduct));
+
+            
Assertions.assertTrue(callFailedRuntimeException.getMessage().contains("is not 
supported for Progressive loan schedule type"));
+        });
+    }
+

Review Comment:
   Would you mind to add a test case to cover whether the loan is cumulative 
but we are trying to set "Adjust last, unpaid period"?



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