orpiske commented on code in PR #9672:
URL: https://github.com/apache/camel/pull/9672#discussion_r1151490261
##########
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());
+
+ // with predicate
+ ColumnSchema schema = new ColumnSchema.ColumnSchemaBuilder("id",
Type.INT32).build();
+ KuduPredicate predicate = KuduPredicate.newComparisonPredicate(schema,
KuduPredicate.ComparisonOp.EQUAL, 2);
+ headers.put(KuduConstants.CAMEL_KUDU_SCAN_PREDICATE, predicate);
+ sendBody("direct:scan", null, headers);
+ results = (List<Map<String, Object>>)
successEndpoint.getReceivedExchanges()
+ .get(1).getIn().getBody(List.class);
+ // only one record with id=2 is expected to be returned
+ assertEquals(1, results.size());
Review Comment:
Same note about the assert.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]