This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch 
gh-readonly-queue/dev/pr-12890-f3e1c2ee3b83efd4a1e7fb4cc4fe40b44060c7d0
in repository https://gitbox.apache.org/repos/asf/seatunnel.git

commit fcb404cd947da03a712c4ae9ee9068744bd946a5
Author: FatMan <[email protected]>
AuthorDate: Sat Oct 31 15:59:28 2026 +0000

    [Test][Connector-V2] Check that the Jdbc source still rejects unknown 
option keys (#12890)
    
    Co-authored-by: chen <[email protected]>
---
 .../seatunnel/jdbc/source/JdbcSourceFactoryTest.java   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git 
a/seatunnel-connectors-v2/connector-jdbc/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceFactoryTest.java
 
b/seatunnel-connectors-v2/connector-jdbc/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceFactoryTest.java
index 649ce772e7..3f345f93e0 100644
--- 
a/seatunnel-connectors-v2/connector-jdbc/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceFactoryTest.java
+++ 
b/seatunnel-connectors-v2/connector-jdbc/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceFactoryTest.java
@@ -80,6 +80,9 @@ class JdbcSourceFactoryTest {
         cfg.put("kerberos_principal", "[email protected]");
         cfg.put("kerberos_keytab_path", "/etc/seatunnel.keytab");
         cfg.put("krb5_path", "/etc/krb5.conf");
+        cfg.put("access_key_id", "ak");
+        cfg.put("secret_access_key", "sk");
+        cfg.put("region", "us-east-1");
 
         Assertions.assertDoesNotThrow(
                 () ->
@@ -87,6 +90,21 @@ class JdbcSourceFactoryTest {
                                 ReadonlyConfig.fromMap(cfg), rule, "Jdbc"));
     }
 
+    @Test
+    void testUndeclaredSourceOptionIsUnknownKey() {
+        Map<String, Object> cfg = baseConfig();
+        cfg.put("table_path", "test.users");
+        cfg.put("fetch_sise", 1000);
+
+        OptionValidationException exception =
+                Assertions.assertThrows(
+                        OptionValidationException.class,
+                        () ->
+                                ConfigValidator.validateUnknownKeys(
+                                        ReadonlyConfig.fromMap(cfg), rule, 
"Jdbc"));
+        Assertions.assertTrue(exception.getMessage().contains("[fetch_sise]"));
+    }
+
     @Test
     void testValidConfigWithQuery() {
         Map<String, Object> cfg = baseConfig();

Reply via email to