This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new a91d14222545 CAMEL-19525: replace Thread.sleep in tests (camel-jetty)
a91d14222545 is described below

commit a91d142225452e881b628ac914021ddcbd070b48
Author: Otavio R. Piske <[email protected]>
AuthorDate: Sun Jan 25 15:19:34 2026 +0100

    CAMEL-19525: replace Thread.sleep in tests (camel-jetty)
    
    Signed-off-by: Otavio R. Piske <[email protected]>
---
 .../apache/camel/component/jetty/JettyXsltHttpTemplateTest.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyXsltHttpTemplateTest.java
 
b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyXsltHttpTemplateTest.java
index 3770b3da8608..cfb3064df370 100644
--- 
a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyXsltHttpTemplateTest.java
+++ 
b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyXsltHttpTemplateTest.java
@@ -16,9 +16,12 @@
  */
 package org.apache.camel.component.jetty;
 
+import java.util.concurrent.TimeUnit;
+
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit5.CamelTestSupport;
+import org.awaitility.Awaitility;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -30,8 +33,8 @@ public class JettyXsltHttpTemplateTest extends 
CamelTestSupport {
 
     @Test
     void testXsltHttpTemplate() throws Exception {
-        // give Jetty a bit time to startup and be ready
-        Thread.sleep(1000);
+        // give Jetty a bit of time to startup and be ready
+        Awaitility.await().atMost(1, TimeUnit.SECONDS).until(() -> 
context.isStarted());
 
         String xml = template.requestBody("xslt:http://0.0.0.0:"; + port + 
"/myxslt",
                 "<mail><subject>Hey</subject><body>Hello 
world!</body></mail>", String.class);

Reply via email to