Copilot commented on code in PR #8984:
URL: https://github.com/apache/seatunnel/pull/8984#discussion_r2049901072
##########
seatunnel-core/seatunnel-core-starter/src/test/java/org/apache/seatunnel/core/starter/utils/ConfigShadeTest.java:
##########
@@ -82,6 +82,28 @@ public void testParseConfig() throws URISyntaxException {
config.getConfigList("source").get(0).getString("secret_key"),
SECRET_KEY);
}
+ @Test
+ public void testParseRefConfig() throws URISyntaxException {
+ URL resource = ConfigShadeTest.class.getResource("/ref.conf");
+ Assertions.assertNotNull(resource);
+ Config refConfigs = ConfigBuilder.of(Paths.get(resource.toURI()));
+ // Assertions.assertEquals(config.);
+ Assertions.assertEquals(
+ refConfigs.getConfig("mysql_prod").getString("query"), "select
* from not_exist");
+
Assertions.assertEquals(refConfigs.getConfig("mysql_prod").getString("password"),
"111111");
+
+ URL jobConfigUrl =
ConfigShadeTest.class.getResource("/mysql_to_console_by_ref.conf");
+ Config jobConfig = ConfigBuilder.of(Paths.get(jobConfigUrl.toURI()));
+
+ Config mysqlPluginConfig = jobConfig.getConfigList("source").get(0);
+ String refId = mysqlPluginConfig.getString("__st_config_ref_key__ ");
Review Comment:
There is an extra whitespace in the key string "__st_config_ref_key__ ".
This may lead to lookup failures; please remove the trailing space.
```suggestion
String refId = mysqlPluginConfig.getString("__st_config_ref_key__");
```
--
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]