Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ void testAfterContainsNull() {
entry("name", "jarad"),
entry("birth", "2022-05-29")
);
// lastAfter.put("age", null);
lastAfter.put("age", null);
assertBeforeAndAfter(COMMON_ALL_COLUMN, COMMON_UNIQUE_CONDITION, after, before, lastAfter, lastBefore);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public void queryWithStream(String sql, ResultSetConsumer resultSetConsumer) thr
"\tINFORMATION_SCHEMA.TABLES\n" +
"WHERE\n" +
"\tTABLE_SCHEMA = '%s' %s\n" +
"\tAND TABLE_TYPE = 'BASE TABLE'";
"\tAND (TABLE_TYPE = 'BASE TABLE' OR TABLE_TYPE = 'SYSTEM VERSIONED')";

private static final String MYSQL_ALL_COLUMN =
"SELECT TABLE_NAME `tableName`,\n" +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.tapdata.common.dml;

import io.tapdata.pdk.apis.entity.ConnectionOptions;
import io.tapdata.pdk.apis.entity.WriteListResult;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
Expand Down Expand Up @@ -40,7 +39,7 @@ void beforeEach() throws SQLException {
void testNormal() throws SQLException {
doAnswer(invocationOnMock -> null).when(recorder).insertUpdate(any(), any(), any());
doAnswer(invocationOnMock -> null).when(recorder).insertUpdate(any(), any(), any());
ReflectionTestUtils.setField(recorder, "updatePolicy", ConnectionOptions.DML_UPDATE_POLICY_IGNORE_ON_NON_EXISTS);
ReflectionTestUtils.setField(recorder, "updatePolicy", WritePolicyEnum.IGNORE_ON_NONEXISTS);
Map<String, Object> after = map(entry("id", 1), entry("name", "name"));
Map<String, Object> before = map(entry("id", 1));
doCallRealMethod().when(recorder).addUpdateBatch(any(), any(), any());
Expand All @@ -53,7 +52,7 @@ void testNormal() throws SQLException {
void testInsertUpdate() throws SQLException {
doAnswer(invocationOnMock -> null).when(recorder).insertUpdate(any(), any(), any());
doAnswer(invocationOnMock -> null).when(recorder).insertUpdate(any(), any(), any());
ReflectionTestUtils.setField(recorder, "updatePolicy", ConnectionOptions.DML_UPDATE_POLICY_INSERT_ON_NON_EXISTS);
ReflectionTestUtils.setField(recorder, "updatePolicy", WritePolicyEnum.INSERT_ON_NONEXISTS);
Map<String, Object> after = map(entry("id", 1), entry("name", "name"));
Map<String, Object> before = map(entry("id", 1));
doCallRealMethod().when(recorder).addUpdateBatch(any(), any(), any());
Expand All @@ -66,7 +65,7 @@ void testInsertUpdate() throws SQLException {
void testEmptyAfter() throws SQLException {
doAnswer(invocationOnMock -> null).when(recorder).insertUpdate(any(), any(), any());
doAnswer(invocationOnMock -> null).when(recorder).insertUpdate(any(), any(), any());
ReflectionTestUtils.setField(recorder, "updatePolicy", ConnectionOptions.DML_UPDATE_POLICY_INSERT_ON_NON_EXISTS);
ReflectionTestUtils.setField(recorder, "updatePolicy", WritePolicyEnum.INSERT_ON_NONEXISTS);
Map<String, Object> after = Collections.emptyMap();
Map<String, Object> before = map(entry("id", 1));
doCallRealMethod().when(recorder).addUpdateBatch(any(), any(), any());
Expand Down