You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "kukim1289 (via GitHub)" <gi...@apache.org> on 2023/05/23 04:03:16 UTC

[GitHub] [fineract] kukim1289 opened a new pull request, #3194: Adding two test cases in LoanApplicationApprovalTest.java

kukim1289 opened a new pull request, #3194:
URL: https://github.com/apache/fineract/pull/3194

   ## Description
   
   Describe the changes made and why they were made.
   
   Two test cases were added: 
   1. Where the approved and proposed amounts are equal to one another.
   -The approved loan amount is set to "8000" and the proposed amount is also set to "8000". Although existing test cases have an approved amount greater than or less than proposed amount, there were no test cases where approved amount equaled proposed amount. 
   3. A loan product is created with a negative interest rate.
   - The test case throws an AssertionError as a loan product cannot possess a negative interest rate. 
   
   
   Ignore if these details are present on the associated [Apache Fineract JIRA ticket](https://github.com/apache/fineract/pull/1284).
   
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [ ] Write the commit message as per https://github.com/apache/fineract/#pull-requests
   
   - [ ] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
   
   - [ ] Create/update unit or integration tests for verifying the changes made.
   
   - [ ] Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
   
   - [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
   
   - [ ] Submission is not a "code dump".  (Large changes can be made "in repository" via a branch.  Ask on the developer mailing list for guidance, if required.)
   
   FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.
   


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] github-actions[bot] commented on pull request #3194: Adding two test cases in LoanApplicationApprovalTest.java

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #3194:
URL: https://github.com/apache/fineract/pull/3194#issuecomment-1603467002

   This pull request seems to be stale.  Are you still planning to work on it?  We will automatically close it in 30 days.


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] galovics commented on a diff in pull request #3194: Adding two test cases in LoanApplicationApprovalTest.java

Posted by "galovics (via GitHub)" <gi...@apache.org>.
galovics commented on code in PR #3194:
URL: https://github.com/apache/fineract/pull/3194#discussion_r1202197126


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanApplicationApprovalTest.java:
##########
@@ -67,6 +68,40 @@ public void setup() {
         this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
     }
 
+    /*
+     * Equal test case: Approved amount non zero is equal to proposed amount
+     */
+    @Test
+    public void loanApplicationApprovedAmountEqualToProposedAmount() {
+
+        final String proposedAmount = "8000";
+        final String approvalAmount = "8000";
+        final String approveDate = "20 September 2012";
+
+        final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2012");
+        final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder().build(null));
+        final Integer loanID = applyForLoanApplication(clientID, loanProductID, proposedAmount);
+
+        HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
+        LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
+
+        final String expectedDisbursementDate = null;
+        List<HashMap> approveTranches = null;
+        loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount,
+                loanID, approveTranches);
+        LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
+
+    }
+
+    /*
+    * Loan Product Rejection: Negative interest rate
+    */
+    @Test
+    public void NewLoanProductRejectedNegativeInterestRate(){
+        assertThrows(AssertionError.class, ()->{
+                    this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder().withinterestRatePerPeriod("-6").build(null));});

Review Comment:
   I think this is not necessarily the best idea because you can't be sure why the system is throwing an error. Is it because of the negative interest rate period or is it because nothing else is filled in the Loan Product.
   
   Let's make a proper loan product that would pass the validations and would get created, and spice it up with the negative interest rate period and then validate that the API fails.



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] galovics closed pull request #3194: Adding two test cases in LoanApplicationApprovalTest.java

Posted by "galovics (via GitHub)" <gi...@apache.org>.
galovics closed pull request #3194: Adding two test cases in LoanApplicationApprovalTest.java
URL: https://github.com/apache/fineract/pull/3194


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org