snuyanzin commented on a change in pull request #18874:
URL: https://github.com/apache/flink/pull/18874#discussion_r812004263
##########
File path:
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/operations/SqlToOperationConverterTest.java
##########
@@ -1660,6 +1665,65 @@ public void testReset() {
assertThat(((ResetOperation)
operation2).getKey()).hasValue("test-key");
}
+ @Test
+ public void testHelpCommands() {
+ ExtendedParser extendedParser = new ExtendedParser();
+ Stream.of("HELP", "HELP;", "HELP ;", "HELP\t;", "HELP\n;")
+ .forEach(
+ command -> {
+ Operation operation1 =
+ extendedParser
+ .parse(command)
+ .orElseThrow(
+ () ->
+ new
RuntimeException(
+ "Fail to
parse '"
+ +
command
+ +
"'"));
+
assertThat(operation1).isInstanceOf(HelpOperation.class);
+ });
+ }
+
+ @Test
+ public void testClearCommands() {
+ ExtendedParser extendedParser = new ExtendedParser();
+ Stream.of("CLEAR", "CLEAR;", "CLEAR ;", "CLEAR\t;", "CLEAR\n;")
+ .forEach(
+ command -> {
+ Operation operation1 =
+ extendedParser
+ .parse(command)
+ .orElseThrow(
+ () ->
+ new
RuntimeException(
+ "Fail to
parse '"
+ +
command
+ +
"'"));
+
assertThat(operation1).isInstanceOf(ClearOperation.class);
+ });
+ }
+
+ @Test
+ public void testQuitCommands() {
+ ExtendedParser extendedParser = new ExtendedParser();
+ Stream.of(
Review comment:
I thought about junit5 parameterized tests however this class is using
junit4... Probably first need to migrate to junit5 and then it could be
replaced with junit5 parameterized.... I can put a comment about this. WDYT?
--
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]