aldettinger commented on code in PR #4133:
URL: https://github.com/apache/camel-quarkus/pull/4133#discussion_r993471663


##########
integration-test-groups/foundation/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerTest.java:
##########
@@ -28,12 +28,48 @@
 class SchedulerTest {
 
     @Test
-    public void test() throws Exception {
-        // wait until the scheduler has run and return a counter that is > 0
+    public void testInitialDelay() throws Exception {
         await().atMost(5, TimeUnit.SECONDS).until(() -> {
             String body = 
RestAssured.get("/scheduler/get").then().statusCode(200).extract().body().asString();
             return !body.equals("0");
         });
     }
 
+    @Test
+    public void testDelay() throws Exception {
+        await().atMost(2, TimeUnit.SECONDS).until(() -> {
+            String body = 
RestAssured.get("/scheduler/get-delay-count").then().statusCode(200).extract().body()
+                    .asString();
+            return Integer.parseInt(body) > 2;
+        });
+
+    }
+
+    @Test
+    public void testFixedDelay() throws Exception {
+        await().atMost(2, TimeUnit.SECONDS).until(() -> {
+            String body = 
RestAssured.get("/scheduler/get-fixed-delay-count").then().statusCode(200).extract().body()
+                    .asString();
+            return Integer.parseInt(body) > 2;
+        });
+    }
+
+    @Test
+    public void testDelayWithRepeat() throws Exception {
+        await().atMost(4, TimeUnit.SECONDS).until(() -> {
+            String body = 
RestAssured.get("/scheduler/get-repeat-count").then().statusCode(200).extract().body()
+                    .asString();
+            return Integer.parseInt(body) >= 4;
+        });
+    }
+
+    @Test
+    public void testGreedyScheduler() throws Exception {
+        await().atMost(1, TimeUnit.SECONDS).until(() -> {
+            String body = 
RestAssured.get("/scheduler/get-greedy-count").then().statusCode(200).extract().body()
+                    .asString();
+            return Integer.parseInt(body) > 10;

Review Comment:
   For a next round, maybe `body().as(Integer.class)` would avoid manual 
parsing here. Not a blocker though :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to