ruanwenjun commented on code in PR #1742:
URL:
https://github.com/apache/incubator-seatunnel/pull/1742#discussion_r857648865
##########
seatunnel-core/seatunnel-core-flink/src/test/java/org/apache/seatunnel/FlinkStarterTest.java:
##########
@@ -31,6 +31,23 @@ public void buildCommands() {
Assert.assertTrue(flinkExecuteCommand.contains("--config test.conf"));
Assert.assertTrue(flinkExecuteCommand.contains("-m yarn-cluster"));
Assert.assertTrue(flinkExecuteCommand.contains("-Dkey1=value1"));
+
Assert.assertTrue(flinkExecuteCommand.contains("${FLINK_HOME}/bin/flink run"));
+
+ String[] args1 = {"--config", "test.conf", "-m", "yarn-cluster", "-i",
"key1=value1", "-i", "key2=value2", "--run-mode", "run-application"};
+ flinkExecuteCommand = String.join(" ", new
FlinkStarter(args1).buildCommands());
+
Assert.assertTrue(flinkExecuteCommand.contains("${FLINK_HOME}/bin/flink
run-application"));
+
+ String[] args2 = {"--config", "test.conf", "-m", "yarn-cluster", "-i",
"key1=value1", "-i", "key2=value2", "--run-mode", "run"};
+ flinkExecuteCommand = String.join(" ", new
FlinkStarter(args2).buildCommands());
+
Assert.assertTrue(flinkExecuteCommand.contains("${FLINK_HOME}/bin/flink run"));
+
+ try {
+ String[] args3 = {"--config", "test.conf", "-m", "yarn-cluster",
"-i", "key1=value1", "-i", "key2=value2", "--run-mode", "run123"};
+ new FlinkStarter(args3);
+ } catch (Exception e) {
+ Assert.assertTrue(e instanceof IllegalArgumentException);
+ Assert.assertEquals("Run mode run123 not supported",
e.getMessage());
+ }
Review Comment:
We can add test case without `--run-mode` parameter.
--
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]