ruchiD commented on code in PR #3889:
URL: https://github.com/apache/fineract/pull/3889#discussion_r1599686240
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/InstallmentLevelDelinquencyAPIIntegrationTests.java:
##########
@@ -410,6 +411,55 @@ public void
tesInstallmentLevelSettingForLoanWithLoanProductWithoutDelinquencyBu
}
+ @Test
+ public void
tesInstallmentLevelSettingForLoanProductWithoutDelinquencyBucketValidation() {
+
+ runAt("31 May 2023", () -> {
+ // Create Client
+ Long clientId =
clientHelper.createClient(ClientHelper.defaultClientCreationRequest()).getClientId();
+
+ // Create Loan Product without delinquency bucket
+ PostLoanProductsRequest loanProductsRequest =
create1InstallmentAmountInMultiplesOf4Period1MonthLongWithInterestAndAmortizationProduct(
+ InterestType.FLAT, AmortizationType.EQUAL_INSTALLMENTS);
+ // set installment level delinquency as true
+ loanProductsRequest.setEnableInstallmentLevelDelinquency(true);
+
+ // Create loan product with installment level delinquency setting
+ CallFailedRuntimeException callFailedRuntimeException =
Assertions.assertThrows(CallFailedRuntimeException.class,
+ () ->
loanProductHelper.createLoanProduct(loanProductsRequest));
+
+ Assertions.assertTrue(callFailedRuntimeException.getMessage()
+ .contains("Installment level delinquency cannot be enabled
if Delinquency bucket is not configured for loan product"));
+
+ });
+
+ }
+
+ @Test
+ public void
tesUpdateInstallmentLevelSettingForLoanProductWithoutDelinquencyBucketValidation()
{
+
+ runAt("31 May 2023", () -> {
+ // Create Client
+ Long clientId =
clientHelper.createClient(ClientHelper.defaultClientCreationRequest()).getClientId();
+
+ // Create Loan Product without delinquency bucket
+ PostLoanProductsRequest loanProductsRequest =
create1InstallmentAmountInMultiplesOf4Period1MonthLongWithInterestAndAmortizationProduct(
+ InterestType.FLAT, AmortizationType.EQUAL_INSTALLMENTS);
+
+ PostLoanProductsResponse loanProductResponse =
loanProductHelper.createLoanProduct(loanProductsRequest);
+
+ // Update loan product with installment level delinquency setting
+ CallFailedRuntimeException callFailedRuntimeException =
Assertions.assertThrows(CallFailedRuntimeException.class,
+ () ->
loanProductHelper.updateLoanProductById(loanProductResponse.getResourceId(),
+ new
PutLoanProductsProductIdRequest().enableInstallmentLevelDelinquency(true).locale("en")));
+
+ Assertions.assertTrue(callFailedRuntimeException.getMessage()
+ .contains("Installment level delinquency cannot be enabled
if Delinquency bucket is not configured for loan product"));
+
+ });
+
+ }
+
Review Comment:
This is covered in upcoming PR where loan modification tests are there. This
PR is for loan product level validations.
--
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]