oleksii-novikov-onix commented on code in PR #4340:
URL: https://github.com/apache/fineract/pull/4340#discussion_r1967220893


##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java:
##########
@@ -2231,6 +2232,7 @@ public void checkNrOfTransactionsOnSecondLoan(int 
nrOfTransactionsExpected, Stri
     public void loanStatusHasChangedTo(String loanStatus) {
         Response<PostLoansResponse> loanResponse = 
testContext().get(TestContextKey.LOAN_CREATE_RESPONSE);
         long loanId = loanResponse.body().getLoanId();
+        await().pollDelay(1L, TimeUnit.SECONDS).until(() -> true);

Review Comment:
   `pollDelay` and `until(() -> true)` don't seem efficient. If we want to wait 
until the status changes, we should do something like this:
   ```
   await()
                   .pollInterval(Duration.ofSeconds(1))
                   .pollDelay(Duration.ofSeconds(1))
                   .untilAsserted(() ->
                           
eventAssertion.assertEvent(LoanStatusChangedEvent.class, loanId)
                                   .extractingData(LoanAccountDataV1::getStatus)
                                   .isEqualTo(expectedStatus)
                   );
   ```



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