You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "orpiske (via GitHub)" <gi...@apache.org> on 2023/03/29 07:15:44 UTC

[GitHub] [camel] orpiske commented on a diff in pull request #9672: CAMEL-19216: camel-kudu - add predicate support to the scan operation

orpiske commented on code in PR #9672:
URL: https://github.com/apache/camel/pull/9672#discussion_r1151490014


##########
components/camel-kudu/src/test/java/org/apache/camel/component/kudu/KuduScanTest.java:
##########
@@ -107,6 +111,34 @@ public void scan() throws InterruptedException {
 
     }
 
+    @Test
+    public void scanWithPredicate() throws InterruptedException {
+        errorEndpoint.expectedMessageCount(0);
+        successEndpoint.expectedMessageCount(2);
+
+        // without predicate
+        Map<String, Object> headers = new HashMap<>();
+        headers.put(KuduConstants.CAMEL_KUDU_SCAN_PREDICATE, null);
+        sendBody("direct:scan", null, headers);
+        List<Map<String, Object>> results = (List<Map<String, Object>>) successEndpoint.getReceivedExchanges()
+                .get(0).getIn().getBody(List.class);
+        // two records with id=1 and id=2 are expected to be returned
+        assertEquals(2, results.size());

Review Comment:
   Just a minor suggestion ... maybe use the comment in the `assertEquals` so that:
   ` assertEquals(2, results.size(), "two records with id=1 and id=2 are expected to be returned");`
   
   That way we don't have to dig into the code to read the expectations and the errors on CI are easier to read.



-- 
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-unsubscribe@camel.apache.org

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