diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestStepDefinitionsForJobApi.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestStepDefinitionsForJobApi.java index 060eba4b7..00d58a291 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestStepDefinitionsForJobApi.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestStepDefinitionsForJobApi.java @@ -277,6 +277,11 @@ public void iGetTheBatchIdOfBatch(String which) { @When("I get the {string} job-id from batch") public void iGetTheJobIdFromBatch(String which) { + await().atMost(30, TimeUnit.SECONDS) + .with() + .pollInterval(Duration.ofSeconds(5L)) + .until(() -> !batchResponse.getJobs().isEmpty()); + final UUID foundJobId = switch (which) { case "first" -> batchResponse.getJobs().get(0).getId(); case "any" -> batchResponse.getJobs().stream().findAny().map(JobStatusResult::getId).orElseThrow();