From 7c6e85be1026b352b4e895065079c12b9074033e Mon Sep 17 00:00:00 2001 From: Jose Alberto Hernandez Date: Tue, 25 Oct 2022 18:04:59 -0500 Subject: [PATCH] Send error code to 403 in Loan Fraud on error --- .../service/LoanWritePlatformServiceJpaRepositoryImpl.java | 2 +- .../apache/fineract/integrationtests/LoanAccountFraudTest.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 a489e10b6..b8ebd1293 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 @@ -3312,7 +3312,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf final Map changes = new LinkedHashMap<>(); if (!loan.isOpen()) { - throw new PlatformServiceUnavailableException("error.msg.loan.mark.as.fraud.not.allowed", + throw new GeneralPlatformDomainRuleException("error.msg.loan.mark.as.fraud.not.allowed", "Loan Id: " + loanId + " mark as fraud is not allowed as loan status is not active", loan.getStatus().getCode()); } diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanAccountFraudTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanAccountFraudTest.java index 73d5ff71d..30d1c5c1c 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanAccountFraudTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanAccountFraudTest.java @@ -57,7 +57,7 @@ public class LoanAccountFraudTest { this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey()); this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); - this.responseSpecError = new ResponseSpecBuilder().expectStatusCode(503).build(); + this.responseSpecError = new ResponseSpecBuilder().expectStatusCode(403).build(); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.todaysDate = Utils.getLocalDateOfTenant();