devi-pathak2263 commented on code in PR #5667:
URL: https://github.com/apache/fineract/pull/5667#discussion_r3008479657
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java:
##########
@@ -985,8 +984,11 @@ private String retrieveApprovalTemplate(final Long loanId,
final String loanExte
if (templateType == null) {
final String errorMsg = "Loan template type must be provided";
throw new LoanTemplateTypeRequiredException(errorMsg);
- } else if (templateType.equals("approval")) {
+ } else if ("approval".equals(templateType)) {
loanApprovalTemplate =
this.loanReadPlatformService.retrieveApprovalTemplate(resolvedLoanId);
+ } else {
Review Comment:
Hi @Aman-Mittal,
Thanks for the suggestion!
I have added a test case for this behavior in a separate PR:
https://issues.apache.org/jira/browse/FINERACT-2551
The test verifies that an unsupported templateType results in
NotSupportedLoanTemplateTypeException and also ensures permission validation is
executed.
Please let me know if you would prefer the tests to be included in this PR
instead.
Thanks!
--
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]