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 23805c5889 [jt400-stabilize] Change order of sending message
23805c5889 is described below

commit 23805c588922bc8deaca796e7d9efa79db87ab25
Author: Tomas Veskrna <[email protected]>
AuthorDate: Thu Jun 11 08:11:03 2026 +0200

    [jt400-stabilize] Change order of sending message
---
 .../quarkus/component/jt400/it/Jt400Test.java      | 29 ++++++++++++----------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git 
a/integration-tests/jt400/src/test/java/org/apache/camel/quarkus/component/jt400/it/Jt400Test.java
 
b/integration-tests/jt400/src/test/java/org/apache/camel/quarkus/component/jt400/it/Jt400Test.java
index 6b202ef32b..5404b0383b 100644
--- 
a/integration-tests/jt400/src/test/java/org/apache/camel/quarkus/component/jt400/it/Jt400Test.java
+++ 
b/integration-tests/jt400/src/test/java/org/apache/camel/quarkus/component/jt400/it/Jt400Test.java
@@ -220,16 +220,6 @@ public class Jt400Test {
         
getClientHelper().registerForRemoval(Jt400TestResource.RESOURCE_TYPE.replyToQueueu,
 msg);
         
getClientHelper().registerForRemoval(Jt400TestResource.RESOURCE_TYPE.replyToQueueu,
 replyMsg);
 
-        //sending a message using the same client as component
-        getClientHelper().sendInquiry(msg);
-
-        LOGGER.debug("testInquiryMessageQueue: message " + msg + " written via 
client");
-        //register deletion of the message in case some following task fails
-        QueuedMessage queuedMessage = 
getClientHelper().peekReplyToQueueMessage(msg);
-        if (queuedMessage != null) {
-            LOGGER.debug("testInquiryMessageQueue: message confirmed by peek: 
" + msg);
-        }
-
         //set filter for expected messages (for parallel executions)
         RestAssured.given()
                 .body(msg)
@@ -238,7 +228,7 @@ public class Jt400Test {
                 .statusCode(204);
 
         //start route before sending message (and wait for start)
-        Awaitility.await().atMost(WAIT_IN_SECONDS, TimeUnit.SECONDS).until(
+        Awaitility.await().pollInterval(1, 
TimeUnit.SECONDS).atMost(WAIT_IN_SECONDS, TimeUnit.SECONDS).until(
                 () -> RestAssured.get("/jt400/route/start/inquiryRoute")
                         .then()
                         .statusCode(200)
@@ -246,8 +236,21 @@ public class Jt400Test {
                 Matchers.is(Boolean.TRUE.toString()));
         LOGGER.debug("testInquiryMessageQueue: inquiry route started");
 
+        //give the route time to actually start consuming before sending the 
message
+        TimeUnit.SECONDS.sleep(2);
+
+        //sending a message using the same client as component
+        getClientHelper().sendInquiry(msg);
+
+        LOGGER.debug("testInquiryMessageQueue: message " + msg + " written via 
client");
+        //register deletion of the message in case some following task fails
+        QueuedMessage queuedMessage = 
getClientHelper().peekReplyToQueueMessage(msg);
+        if (queuedMessage != null) {
+            LOGGER.debug("testInquiryMessageQueue: message confirmed by peek: 
" + msg);
+        }
+
         //await to be processed
-        Awaitility.await().pollInterval(1, 
TimeUnit.SECONDS).atMost(WAIT_IN_SECONDS, TimeUnit.SECONDS).until(
+        Awaitility.await().pollInterval(2, 
TimeUnit.SECONDS).atMost(WAIT_IN_SECONDS, TimeUnit.SECONDS).until(
                 () -> RestAssured.get("/jt400/inquiryMessageProcessed")
                         .then()
                         .statusCode(200)
@@ -256,7 +259,7 @@ public class Jt400Test {
         LOGGER.debug("testInquiryMessageQueue: inquiry message processed");
 
         //stop route (and wait for stop)
-        Awaitility.await().atMost(2 * WAIT_IN_SECONDS, TimeUnit.SECONDS).until(
+        Awaitility.await().pollInterval(1, TimeUnit.SECONDS).atMost(2 * 
WAIT_IN_SECONDS, TimeUnit.SECONDS).until(
                 () -> RestAssured.get("/jt400/route/stop/inquiryRoute")
                         .then()
                         .statusCode(200)

Reply via email to