Send error code to 403 in Loan Fraud on error

This commit is contained in:
Jose Alberto Hernandez
2022-10-26 12:11:08 +02:00
committed by Arnold Gálovics
parent 6cb741a7a2
commit 7c6e85be10
2 changed files with 2 additions and 2 deletions
@@ -3312,7 +3312,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final Map<String, Object> 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());
}
@@ -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();