You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/08/07 07:13:18 UTC

[camel] branch main updated: camel-quartz - Fix flaky test (#11016)

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

davsclaus 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 ace3135b35f camel-quartz - Fix flaky test (#11016)
ace3135b35f is described below

commit ace3135b35f591ef78765c25c5d236168423f14b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Aug 7 09:13:09 2023 +0200

    camel-quartz - Fix flaky test (#11016)
---
 .../routepolicy/quartz/CronScheduledRoutePolicyTest.java     | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicyTest.java b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicyTest.java
index 3fa7a6f6505..3b62cafe483 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicyTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicyTest.java
@@ -72,8 +72,10 @@ public class CronScheduledRoutePolicyTest {
 
             Awaitility.await().atMost(5, TimeUnit.SECONDS)
                     .untilAsserted(
-                            () -> assertSame(ServiceStatus.Started, context.getRouteController().getRouteStatus("test1")));
-            assertSame(ServiceStatus.Started, context.getRouteController().getRouteStatus("test2"));
+                            () -> {
+                                assertSame(ServiceStatus.Started, context.getRouteController().getRouteStatus("test1"));
+                                assertSame(ServiceStatus.Started, context.getRouteController().getRouteStatus("test2"));
+                            });
             template.sendBody("direct:start1", "Ready or not, Here, I come");
             template.sendBody("direct:start2", "Ready or not, Here, I come");
 
@@ -111,8 +113,10 @@ public class CronScheduledRoutePolicyTest {
 
             Awaitility.await().atMost(5, TimeUnit.SECONDS)
                     .untilAsserted(
-                            () -> assertSame(ServiceStatus.Stopped, context.getRouteController().getRouteStatus("test1")));
-            assertSame(ServiceStatus.Stopped, context.getRouteController().getRouteStatus("test2"));
+                            () -> {
+                                assertSame(ServiceStatus.Stopped, context.getRouteController().getRouteStatus("test1"));
+                                assertSame(ServiceStatus.Stopped, context.getRouteController().getRouteStatus("test2"));
+                            });
         }
     }