peter-kovacs-dpc commented on code in PR #6432:
URL: https://github.com/apache/fineract/pull/6432#discussion_r3995701971


##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalAmortizationScheduleStepDef.java:
##########
@@ -330,6 +330,27 @@ public void verifyRetrievedPaymentDetailsByPaymentNo(final 
DataTable dataTable)
         assertions.assertAll();
     }
 
+    @Then("The last projected payment amount is the smaller tail remainder")
+    public void verifyLastProjectedPaymentIsSmallerTail() {
+        final ProjectedAmortizationScheduleData response = 
getRetrievedSchedule();
+        final List<ProjectedAmortizationSchedulePaymentData> payments = 
response.getPayments();
+        assertThat(payments).as("payments list").hasSizeGreaterThan(1);
+        final ProjectedAmortizationSchedulePaymentData last = 
payments.getLast();
+        assertThat(last.getPaymentNo()).as("last paymentNo").isGreaterThan(0);
+        assertThat(last.getExpectedBalance()).as("last 
expectedBalance").isEqualByComparingTo(BigDecimal.ZERO);
+        assertThat(last.getExpectedDiscountFeeBalance()).as("last 
expectedDiscountFeeBalance").isEqualByComparingTo(BigDecimal.ZERO);
+        final ProjectedAmortizationSchedulePaymentData firstPayment = 
payments.get(1);
+        assertThat(last.getExpectedPaymentAmount()).as("tail 
expectedPaymentAmount must be positive").isGreaterThan(BigDecimal.ZERO);
+        
assertThat(last.getExpectedPaymentAmount().compareTo(firstPayment.getExpectedPaymentAmount()))
+                .as("tail expectedPaymentAmount should be less than or equal 
to the regular instalment").isLessThanOrEqualTo(0);

Review Comment:
   fixed
   I split your suggestion int two separate assertions, just because to be able 
to produce more meaningful error messages



-- 
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]

Reply via email to