JiriOndrusek commented on a change in pull request #2694:
URL: https://github.com/apache/camel-quarkus/pull/2694#discussion_r642455630



##########
File path: 
integration-tests/sql/src/test/java/org/apache/camel/quarkus/component/sql/it/SqlTest.java
##########
@@ -66,4 +78,169 @@ public void testSqlStoredComponent() {
                 .statusCode(200)
                 .body(is("15"));
     }
+
+    @Test
+    public void testConsumer() throws InterruptedException {
+        testConsumer(1, "consumerRoute");
+    }
+
+    @Test
+    public void testClasspathConsumer() throws InterruptedException {
+        testConsumer(2, "consumerClasspathRoute");
+    }
+
+    @Test
+    public void testFileConsumer() throws InterruptedException {
+        testConsumer(3, "consumerFileRoute");
+    }
+
+    private void testConsumer(int id, String routeId) throws 
InterruptedException {
+        route(routeId, "start", "Started");
+
+        Map project = CollectionHelper.mapOf("ID", id, "PROJECT", routeId, 
"LICENSE", "222", "PROCESSED", false);
+        Map updatedProject = CollectionHelper.mapOf("ID", id, "PROJECT", 
routeId, "LICENSE", "XXX", "PROCESSED", false);
+
+        postMapWithParam("/sql/insert",
+                "table", "projects",
+                project)
+                        .statusCode(201);
+
+        //wait for the record to be caught
+        Thread.sleep(500);
+
+        RestAssured.get("/sql/get/results/" + routeId)
+                .then()
+                .statusCode(200)
+                .body("size()", is(1), "$", hasItem(project));
+
+        //update
+        postMapWithParam("/sql/update",
+                "table", "projects",
+                updatedProject)
+                        .statusCode(201);
+
+        Thread.sleep(500);

Review comment:
       Yes, I'll do it, awat is a much better solution
   
   




-- 
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.

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


Reply via email to