From 8d25b0c765f31a141d1172c7a1b30a57a7bca319 Mon Sep 17 00:00:00 2001 From: Jose Alberto Hernandez Date: Thu, 28 Nov 2024 14:13:28 -0500 Subject: [PATCH] FINERACT-1981: Reverse Interest Refund transaction not allowed directly with 403 error --- .../service/LoanWritePlatformServiceJpaRepositoryImpl.java | 2 +- .../fineract/integrationtests/LoanInterestRefundTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java index a0b17cfe89..b8ed5b39c0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java @@ -1426,7 +1426,7 @@ public CommandProcessingResult adjustLoanTransaction(final Long loanId, final Lo } if (transactionToAdjust.isInterestRefund()) { - throw new PlatformServiceUnavailableException("error.msg.loan.transaction.update.not.allowed", + throw new GeneralPlatformDomainRuleException("error.msg.loan.transaction.update.not.allowed", "Interest refund transaction: " + transactionId + " cannot be reversed or adjusted directly", transactionId); } diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanInterestRefundTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanInterestRefundTest.java index 91578eb624..b9ece7fb99 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanInterestRefundTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanInterestRefundTest.java @@ -1240,7 +1240,7 @@ public void verifyUC19() { () -> loanTransactionHelper.reverseLoanTransaction(loanId, interestRefundTransactionId, new PostLoansLoanIdTransactionsTransactionIdRequest().dateFormat(DATETIME_PATTERN) .transactionDate("22 January 2021").transactionAmount(0.0).locale("en"))); - assertEquals(503, exception.getResponse().code()); + assertEquals(403, exception.getResponse().code()); assertTrue(exception.getMessage().contains("error.msg.loan.transaction.update.not.allowed")); Optional optMerchantIssuedTransaction = loanDetails.getTransactions().stream()