slinkydeveloper commented on a change in pull request #18151:
URL: https://github.com/apache/flink/pull/18151#discussion_r772292284



##########
File path: 
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/stream/table/DataGeneratorConnectorITCase.java
##########
@@ -71,4 +74,31 @@ public void testTypes() throws Exception {
 
         Assert.assertEquals("Unexpected number of results", 10, 
results.size());
     }
+
+    @Test
+    public void testLimit() throws Exception {
+        final TestingTableEnvironment env = TestingTableEnvironment
+                .create(
+                        
EnvironmentSettings.newInstance().inStreamingMode().build(),
+                        null,
+                        new TableConfig());
+
+        env.executeSql("CREATE TABLE datagen_t (\n"
+                + "    f0 CHAR(1)\n"
+                + ") WITH ("
+                + "    'connector' = 'datagen'"
+                + ")");
+
+        List<Row> results = new ArrayList<>();
+
+        try (CloseableIterator<Row> iter = env
+                .executeSql("select * from datagen_t limit 5")
+                .collect()) {
+            while (iter.hasNext()) {
+                results.add(iter.next());
+            }
+        }
+
+        Assert.assertEquals("Unexpected number of results", 5, results.size());

Review comment:
       Please use assertj assertions here, and convert the rest of this class 
to use assertj as well




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


Reply via email to