CosmosNi commented on code in PR #9281:
URL: https://github.com/apache/seatunnel/pull/9281#discussion_r2085743133
##########
seatunnel-core/seatunnel-spark-starter/seatunnel-spark-3-starter/src/test/java/org/apache/seatunnel/core/starter/spark/SparkCommandArgsTest.java:
##########
@@ -43,19 +44,32 @@ public void testExecuteClientCommandArgsWithPluginName()
}
@Test
- public void testExecuteClientCommandArgsWithoutPluginName()
- throws FileNotFoundException, URISyntaxException {
+ public void testExecuteClientCommandArgsWithoutPluginName() throws
Exception {
String configurePath =
"/config/fake_to_inmemory_without_pluginname.json";
String configFile =
MultiTableSinkTest.getTestConfigFile(configurePath);
SparkCommandArgs sparkCommandArgs = buildSparkCommands(configFile);
sparkCommandArgs.setDeployMode(DeployMode.CLIENT);
- CommandExecuteException commandExecuteException =
- Assertions.assertThrows(
- CommandExecuteException.class,
- () -> SeaTunnel.run(sparkCommandArgs.buildCommand()));
- Assertions.assertEquals(
- String.format("No configuration setting found for key '%s'",
PLUGIN_NAME.key()),
- commandExecuteException.getCause().getMessage());
+
+ // Catch System.exit call and verify exit code
+ int statusCode =
+ catchSystemExit(
+ () -> {
+ try {
+ SeaTunnel.run(sparkCommandArgs.buildCommand());
+ } catch (CommandExecuteException e) {
+ // Verify the exception message
+ Assertions.assertEquals(
Review Comment:
GET
--
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]