FINERACT-2070: Update test configurations

This commit is contained in:
Adam Saghy
2024-11-09 20:04:13 +01:00
parent 17a4392c26
commit 64976f1eb4
28 changed files with 1021 additions and 362 deletions
@@ -253,7 +253,8 @@ public class LoanCOBAccountLockCatchupInlineCOBTest extends BaseLoanIntegrationT
// days behind
loanCOBCatchUpHelper.executeLoanCOBCatchUp();
Awaitility.await().atMost(Duration.ofSeconds(30)).with().pollInterval(Duration.ofSeconds(5)) //
Awaitility.await().atMost(Duration.ofMinutes(2)).with().pollInterval(Duration.ofSeconds(5)) //
.pollDelay(Duration.ofSeconds(5)) //
.until(() -> loanCOBCatchUpHelper.isLoanCOBCatchUpFinishedFor(LocalDate.of(2020, 3, 4))); //
loan = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanID);
@@ -51,7 +51,9 @@ public final class NotificationHelper {
// Waiting for notifications to be available is needed due to the asynchronous event processing
public static void waitUntilNotificationsAreAvailable(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec) {
await().atMost(Duration.ofSeconds(30)).pollInterval(Duration.ofMillis(250))
await().atMost(Duration.ofSeconds(30)) //
.pollInterval(Duration.ofSeconds(5)) //
.pollDelay(Duration.ofSeconds(5)) //
.until(() -> NotificationHelper.areNotificationsAvailable(requestSpec, responseSpec));
}
}
@@ -223,26 +223,29 @@ public class SchedulerJobHelper extends IntegrationTest {
}
private void awaitJob(Instant beforeExecuteTime, Supplier<Callable<Map<String, String>>> retrieveLastRunHistory) {
final Duration timeout = Duration.ofMinutes(4);
final Duration pause = Duration.ofSeconds(2);
final Duration timeout = Duration.ofMinutes(2);
final Duration pause = Duration.ofSeconds(5);
DateTimeFormatter df = DateTimeFormatter.ISO_INSTANT; // FINERACT-926
// Await JobDetailData.lastRunHistory [JobDetailHistoryData]
// jobRunStartTime >= beforeExecuteTime (or timeout)
// jobRunEndTime to be both set and >= jobRunStartTime (or timeout)
Map<String, String> finalLastRunHistory = await().atMost(timeout).pollInterval(pause).until(retrieveLastRunHistory.get(),
lastRunHistory -> {
String jobRunStartText = lastRunHistory.get("jobRunStartTime");
if (jobRunStartText == null) {
return false;
}
String jobRunEndText = lastRunHistory.get("jobRunEndTime");
if (jobRunEndText == null) {
return false;
}
Instant jobRunStartTime = df.parse(jobRunStartText, Instant::from);
Instant jobRunEndTime = df.parse(jobRunEndText, Instant::from);
return !jobRunStartTime.isBefore(beforeExecuteTime) && !jobRunEndTime.isBefore(jobRunStartTime);
});
Map<String, String> finalLastRunHistory = await().atMost(timeout) //
.pollInterval(pause) //
.pollDelay(pause) //
.until(retrieveLastRunHistory.get(), //
lastRunHistory -> {
String jobRunStartText = lastRunHistory.get("jobRunStartTime");
if (jobRunStartText == null) {
return false;
}
String jobRunEndText = lastRunHistory.get("jobRunEndTime");
if (jobRunEndText == null) {
return false;
}
Instant jobRunStartTime = df.parse(jobRunStartText, Instant::from);
Instant jobRunEndTime = df.parse(jobRunEndText, Instant::from);
return !jobRunStartTime.isBefore(beforeExecuteTime) && !jobRunEndTime.isBefore(jobRunStartTime);
});
// Verify triggerType
MatcherAssert.assertThat(finalLastRunHistory.get("triggerType"), is("application"));