You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2026/04/17 11:51:16 UTC
(camel-quarkus) branch main updated: Wrap FileLanguageTest.fileLanguageDate assertions with Awaitility
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new e5960affc9 Wrap FileLanguageTest.fileLanguageDate assertions with Awaitility
e5960affc9 is described below
commit e5960affc95bf5a029930483f7f4e65101ca9754
Author: James Netherton <ja...@users.noreply.github.com>
AuthorDate: Fri Apr 17 12:51:10 2026 +0100
Wrap FileLanguageTest.fileLanguageDate assertions with Awaitility
---
.../camel/quarkus/component/file/it/FileLanguageTest.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileLanguageTest.java b/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileLanguageTest.java
index 028dce8d64..8c9e7266a4 100644
--- a/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileLanguageTest.java
+++ b/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileLanguageTest.java
@@ -19,12 +19,15 @@ package org.apache.camel.quarkus.component.file.it;
import java.io.UnsupportedEncodingException;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
+import java.time.Duration;
import java.util.Date;
+import java.util.concurrent.TimeUnit;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import org.apache.camel.quarkus.core.util.FileUtils;
+import org.awaitility.Awaitility;
import org.junit.jupiter.api.Test;
import static org.apache.camel.quarkus.component.file.it.FileLanguageRoutes.FILE_LANGUAGE;
@@ -73,11 +76,13 @@ class FileLanguageTest {
String fileName = "out-" + format.format(new Date()) + "-customValue.xml";
// Read the file with current date
- RestAssured
- .get("/file/get/" + FileLanguageRoutes.FILE_LANG_DATE_OUT + "/" + Paths.get(fileName).getFileName())
- .then()
- .statusCode(200)
- .body(equalTo(FILE_BODY));
+ Awaitility.await().pollInterval(Duration.ofMillis(250)).atMost(10, TimeUnit.SECONDS).untilAsserted(() -> {
+ RestAssured
+ .get("/file/get/" + FileLanguageRoutes.FILE_LANG_DATE_OUT + "/" + Paths.get(fileName).getFileName())
+ .then()
+ .statusCode(200)
+ .body(equalTo(FILE_BODY));
+ });
}
private static void startRouteAndWait(String routeId) throws InterruptedException {