This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new cbd13f8c0bf Add CDCClientConfigurationTest (#37375)
cbd13f8c0bf is described below
commit cbd13f8c0bfd47a6fdada2f4564dbadc2ad689f6
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Dec 13 20:18:04 2025 +0800
Add CDCClientConfigurationTest (#37375)
---
.../client/config/CDCClientConfigurationTest.java | 47 ++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git
a/kernel/data-pipeline/scenario/cdc/client/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/client/config/CDCClientConfigurationTest.java
b/kernel/data-pipeline/scenario/cdc/client/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/client/config/CDCClientConfigurationTest.java
new file mode 100644
index 00000000000..3daf66ecd83
--- /dev/null
+++
b/kernel/data-pipeline/scenario/cdc/client/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/client/config/CDCClientConfigurationTest.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.data.pipeline.cdc.client.config;
+
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+class CDCClientConfigurationTest {
+
+ @Test
+ void assertNewSuccess() {
+ CDCClientConfiguration actual = new CDCClientConfiguration("foo_host",
3307, 1000);
+ assertThat(actual.getAddress(), is("foo_host"));
+ assertThat(actual.getPort(), is(3307));
+ assertThat(actual.getTimeoutMillis(), is(1000));
+ }
+
+ @Test
+ void assertNewWithNullAddress() {
+ IllegalArgumentException actual =
assertThrows(IllegalArgumentException.class, () -> new
CDCClientConfiguration(null, 3307, 1000));
+ assertThat(actual.getMessage(), is("The address parameter can't be
null."));
+ }
+
+ @Test
+ void assertNewWithInvalidPort() {
+ IllegalArgumentException actual =
assertThrows(IllegalArgumentException.class, () -> new
CDCClientConfiguration("foo_host", 0, 1000));
+ assertThat(actual.getMessage(), is("The port must be greater than
0."));
+ }
+}