You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by wu...@apache.org on 2023/11/02 15:49:39 UTC
(shardingsphere) branch master updated: Fix test cases (#28922)
This is an automated email from the ASF dual-hosted git repository.
wuweijie 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 0de4f9b6a81 Fix test cases (#28922)
0de4f9b6a81 is described below
commit 0de4f9b6a81ef3228d0548f0a7846aaa4d97a282
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Thu Nov 2 23:49:32 2023 +0800
Fix test cases (#28922)
* Refactor DumperConfiguration
* Refactor DumperConfiguration
* Refactor DumperConfiguration
* Refactor DumperConfiguration
* Fix test case
* Fix test case
* Fix test case
---
.../mysql/ingest/MySQLIncrementalDumperTest.java | 16 ++++++++--------
.../postgresql/ingest/wal/WALEventConverterTest.java | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLIncrementalDumperTest.java b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLIncrementalDumperTest.java
index 1426037ebdd..dd956b53316 100644
--- a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLIncrementalDumperTest.java
+++ b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLIncrementalDumperTest.java
@@ -55,11 +55,11 @@ import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
+import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -129,7 +129,7 @@ class MySQLIncrementalDumperTest {
@Test
void assertWriteRowsEventWithoutCustomColumns() throws ReflectiveOperationException {
- assertWriteRowsEvent0(null, 3);
+ assertWriteRowsEvent0(Collections.emptyMap(), 3);
}
@Test
@@ -137,7 +137,7 @@ class MySQLIncrementalDumperTest {
assertWriteRowsEvent0(mockTargetTableColumnsMap(), 1);
}
- private void assertWriteRowsEvent0(final Map<LogicTableName, Set<ColumnName>> targetTableColumnsMap, final int expectedColumnCount) throws ReflectiveOperationException {
+ private void assertWriteRowsEvent0(final Map<LogicTableName, Collection<ColumnName>> targetTableColumnsMap, final int expectedColumnCount) throws ReflectiveOperationException {
dumperConfig.setTargetTableColumnsMap(targetTableColumnsMap);
WriteRowsEvent rowsEvent = new WriteRowsEvent();
rowsEvent.setDatabaseName("");
@@ -151,13 +151,13 @@ class MySQLIncrementalDumperTest {
assertThat(((DataRecord) actual.get(0)).getColumnCount(), is(expectedColumnCount));
}
- private Map<LogicTableName, Set<ColumnName>> mockTargetTableColumnsMap() {
+ private Map<LogicTableName, Collection<ColumnName>> mockTargetTableColumnsMap() {
return Collections.singletonMap(new LogicTableName("t_order"), Collections.singleton(new ColumnName("order_id")));
}
@Test
void assertUpdateRowsEventWithoutCustomColumns() throws ReflectiveOperationException {
- assertUpdateRowsEvent0(null, 3);
+ assertUpdateRowsEvent0(Collections.emptyMap(), 3);
}
@Test
@@ -165,7 +165,7 @@ class MySQLIncrementalDumperTest {
assertUpdateRowsEvent0(mockTargetTableColumnsMap(), 1);
}
- private void assertUpdateRowsEvent0(final Map<LogicTableName, Set<ColumnName>> targetTableColumnsMap, final int expectedColumnCount) throws ReflectiveOperationException {
+ private void assertUpdateRowsEvent0(final Map<LogicTableName, Collection<ColumnName>> targetTableColumnsMap, final int expectedColumnCount) throws ReflectiveOperationException {
dumperConfig.setTargetTableColumnsMap(targetTableColumnsMap);
UpdateRowsEvent rowsEvent = new UpdateRowsEvent();
rowsEvent.setDatabaseName("test");
@@ -182,7 +182,7 @@ class MySQLIncrementalDumperTest {
@Test
void assertDeleteRowsEventWithoutCustomColumns() throws ReflectiveOperationException {
- assertDeleteRowsEvent0(null, 3);
+ assertDeleteRowsEvent0(Collections.emptyMap(), 3);
}
@Test
@@ -190,7 +190,7 @@ class MySQLIncrementalDumperTest {
assertDeleteRowsEvent0(mockTargetTableColumnsMap(), 1);
}
- private void assertDeleteRowsEvent0(final Map<LogicTableName, Set<ColumnName>> targetTableColumnsMap, final int expectedColumnCount) throws ReflectiveOperationException {
+ private void assertDeleteRowsEvent0(final Map<LogicTableName, Collection<ColumnName>> targetTableColumnsMap, final int expectedColumnCount) throws ReflectiveOperationException {
dumperConfig.setTargetTableColumnsMap(targetTableColumnsMap);
DeleteRowsEvent rowsEvent = new DeleteRowsEvent();
rowsEvent.setDatabaseName("");
diff --git a/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/WALEventConverterTest.java b/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/WALEventConverterTest.java
index 451637bd877..85850fa1dae 100644
--- a/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/WALEventConverterTest.java
+++ b/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/WALEventConverterTest.java
@@ -123,7 +123,7 @@ class WALEventConverterTest {
@Test
void assertWriteRowEventWithoutCustomColumns() throws ReflectiveOperationException {
- assertWriteRowEvent0(null, 3);
+ assertWriteRowEvent0(Collections.emptyMap(), 3);
}
@Test