This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
The following commit(s) were added to refs/heads/master by this push:
new ed322ce1d [test-util] Remove redundant AssertionUtils (#2929)
ed322ce1d is described below
commit ed322ce1d98a276a3a3f1d45e82a9fe3383f5b62
Author: yuzelin <[email protected]>
AuthorDate: Fri Mar 1 15:26:26 2024 +0800
[test-util] Remove redundant AssertionUtils (#2929)
---
.../org/apache/paimon/catalog/CatalogTestBase.java | 2 +-
.../paimon/mergetree/compact/LoserTreeTest.java | 6 +-
.../paimon/operation/FileStoreCommitTest.java | 4 +-
.../apache/paimon/schema/SchemaBuilderTest.java | 11 +-
.../paimon/table/FileStoreTableTestBase.java | 20 +--
.../apache/paimon/table/SchemaEvolutionTest.java | 4 +-
.../snapshot/StaticFromTagStartingScannerTest.java | 4 +-
.../kafka/KafkaCanalSyncDatabaseActionITCase.java | 2 +-
.../cdc/kafka/KafkaCanalSyncTableActionITCase.java | 2 +-
.../cdc/kafka/KafkaSyncDatabaseActionITCase.java | 4 +-
.../cdc/kafka/KafkaSyncTableActionITCase.java | 2 +-
.../cdc/mysql/MySqlCdcTypeMappingITCase.java | 4 +-
.../cdc/mysql/MySqlSyncTableActionITCase.java | 2 +-
.../postgres/PostgresSyncTableActionITCase.java | 2 +-
.../apache/paimon/flink/CatalogTableITCase.java | 6 +-
.../apache/paimon/flink/ReadWriteTableITCase.java | 26 ++--
.../apache/paimon/flink/SchemaChangeITCase.java | 10 +-
.../paimon/flink/action/MergeIntoActionITCase.java | 10 +-
.../AlignedContinuousFileSplitEnumeratorTest.java | 5 +-
.../apache/paimon/hive/Hive23CatalogITCase.java | 4 +-
.../apache/paimon/hive/Hive31CatalogITCase.java | 4 +-
.../paimon/spark/SparkSchemaEvolutionITCase.java | 2 +-
.../apache/paimon/spark/SparkTimeTravelITCase.java | 4 +-
.../spark/SparkTimeTravelWithDataFrameITCase.java | 6 +-
.../paimon/testutils/assertj/AssertionUtils.java | 141 ---------------------
.../paimon/testutils/assertj/PaimonAssertions.java | 2 +-
26 files changed, 71 insertions(+), 218 deletions(-)
diff --git
a/paimon-core/src/test/java/org/apache/paimon/catalog/CatalogTestBase.java
b/paimon-core/src/test/java/org/apache/paimon/catalog/CatalogTestBase.java
index d85de5e76..378ebf159 100644
--- a/paimon-core/src/test/java/org/apache/paimon/catalog/CatalogTestBase.java
+++ b/paimon-core/src/test/java/org/apache/paimon/catalog/CatalogTestBase.java
@@ -42,7 +42,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import static
org.apache.paimon.testutils.assertj.AssertionUtils.anyCauseMatches;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
diff --git
a/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/LoserTreeTest.java
b/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/LoserTreeTest.java
index 8136d09c5..05be8304c 100644
---
a/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/LoserTreeTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/LoserTreeTest.java
@@ -20,7 +20,6 @@ package org.apache.paimon.mergetree.compact;
import org.apache.paimon.KeyValue;
import org.apache.paimon.reader.RecordReader;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.utils.ReusingTestData;
import org.apache.paimon.utils.TestReusingRecordReader;
@@ -37,6 +36,7 @@ import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -60,7 +60,7 @@ public class LoserTreeTest {
checkLoserTree(
loserTree,
kv -> {
- assertThat(expectedIterator.hasNext());
+ assertThat(expectedIterator.hasNext()).isTrue();
expectedIterator.next().assertEquals(kv);
});
assertThat(expectedIterator.hasNext()).isFalse();
@@ -88,7 +88,7 @@ public class LoserTreeTest {
LoserTree<KeyValue> loserTree =
new LoserTree<>(sortedTestReaders, KEY_COMPARATOR,
SEQUENCE_COMPARATOR);
assertThatThrownBy(() -> checkLoserTree(loserTree, kv -> {}))
- .satisfies(AssertionUtils.anyCauseMatches(IOException.class));
+ .satisfies(anyCauseMatches(IOException.class));
assertThatCode(loserTree::close).doesNotThrowAnyException();
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/operation/FileStoreCommitTest.java
b/paimon-core/src/test/java/org/apache/paimon/operation/FileStoreCommitTest.java
index 8d18abc16..488f74f67 100644
---
a/paimon-core/src/test/java/org/apache/paimon/operation/FileStoreCommitTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/operation/FileStoreCommitTest.java
@@ -38,7 +38,6 @@ import org.apache.paimon.schema.SchemaUtils;
import org.apache.paimon.stats.ColStats;
import org.apache.paimon.stats.Statistics;
import org.apache.paimon.stats.StatsFileHandler;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.types.DataField;
import org.apache.paimon.types.DataTypes;
import org.apache.paimon.types.RowKind;
@@ -72,6 +71,7 @@ import java.util.function.Supplier;
import java.util.stream.Collectors;
import static org.apache.paimon.index.HashIndexFile.HASH_INDEX;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -683,7 +683,7 @@ public class FileStoreCommitTest {
TestFileStore store = createStore(false);
assertThatThrownBy(() -> store.dropPartitions(Collections.emptyList()))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
"Partitions list cannot be empty."));
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/schema/SchemaBuilderTest.java
b/paimon-core/src/test/java/org/apache/paimon/schema/SchemaBuilderTest.java
index 881cffb87..50552db61 100644
--- a/paimon-core/src/test/java/org/apache/paimon/schema/SchemaBuilderTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/schema/SchemaBuilderTest.java
@@ -18,11 +18,11 @@
package org.apache.paimon.schema;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.types.DataTypes;
import org.junit.jupiter.api.Test;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -36,7 +36,7 @@ public class SchemaBuilderTest {
assertThatThrownBy(builder::build)
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalStateException.class,
"Table column [id, id] must not contain
duplicate fields. Found: [id]"));
}
@@ -48,7 +48,7 @@ public class SchemaBuilderTest {
assertThatThrownBy(builder::build)
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalStateException.class,
"Primary key constraint [id, id] must not
contain duplicate columns. Found: [id]"));
}
@@ -60,10 +60,9 @@ public class SchemaBuilderTest {
assertThatThrownBy(builder::build)
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalStateException.class,
- "Partition key constraint [id, id] must not
contain duplicate columns. Found: [id]"
- + ""));
+ "Partition key constraint [id, id] must not
contain duplicate columns. Found: [id]"));
}
@Test
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/FileStoreTableTestBase.java
b/paimon-core/src/test/java/org/apache/paimon/table/FileStoreTableTestBase.java
index b9b117182..4cd019568 100644
---
a/paimon-core/src/test/java/org/apache/paimon/table/FileStoreTableTestBase.java
+++
b/paimon-core/src/test/java/org/apache/paimon/table/FileStoreTableTestBase.java
@@ -59,7 +59,6 @@ import org.apache.paimon.table.source.ReadBuilder;
import org.apache.paimon.table.source.Split;
import org.apache.paimon.table.source.StreamTableScan;
import org.apache.paimon.table.source.TableRead;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.types.DataType;
import org.apache.paimon.types.DataTypes;
import org.apache.paimon.types.RowKind;
@@ -110,6 +109,7 @@ import static
org.apache.paimon.CoreOptions.SNAPSHOT_EXPIRE_LIMIT;
import static org.apache.paimon.CoreOptions.SNAPSHOT_NUM_RETAINED_MAX;
import static org.apache.paimon.CoreOptions.SNAPSHOT_NUM_RETAINED_MIN;
import static org.apache.paimon.CoreOptions.WRITE_ONLY;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.params.provider.Arguments.arguments;
@@ -693,7 +693,7 @@ public abstract class FileStoreTableTestBase {
StreamTableScan finalScan = scan;
assertThatThrownBy(finalScan::plan)
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
OutOfRangeException.class, "The snapshot with
id 5 has expired."));
write.close();
@@ -984,30 +984,30 @@ public abstract class FileStoreTableTestBase {
assertThatThrownBy(() -> table.createBranch("main", "tag1"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
"Branch name 'main' is the default branch and
cannot be used."));
assertThatThrownBy(() -> table.createBranch("branch-1", "tag1"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class, "Tag name
'tag1' not exists."));
assertThatThrownBy(() -> table.createBranch("branch0", "test-tag"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
"Branch name 'branch0' already exists."));
assertThatThrownBy(() -> table.createBranch("", "test-tag"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
String.format("Branch name '%s' is blank",
"")));
assertThatThrownBy(() -> table.createBranch("10", "test-tag"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
"Branch name cannot be pure numeric string but
is '10'."));
}
@@ -1032,7 +1032,7 @@ public abstract class FileStoreTableTestBase {
assertThatThrownBy(() -> table.deleteBranch("branch1"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
"Branch name 'branch1' doesn't exist."));
}
@@ -1049,7 +1049,7 @@ public abstract class FileStoreTableTestBase {
assertThatThrownBy(() -> table.createTag("", 1))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
String.format("Tag name '%s' is blank", "")));
}
@@ -1069,7 +1069,7 @@ public abstract class FileStoreTableTestBase {
assertThatThrownBy(() -> table.deleteTag("tag1"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class, "Tag 'tag1'
doesn't exist."));
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/SchemaEvolutionTest.java
b/paimon-core/src/test/java/org/apache/paimon/table/SchemaEvolutionTest.java
index 10a57ecb8..4db178eab 100644
--- a/paimon-core/src/test/java/org/apache/paimon/table/SchemaEvolutionTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/table/SchemaEvolutionTest.java
@@ -37,7 +37,6 @@ import org.apache.paimon.table.sink.TableCommitImpl;
import org.apache.paimon.table.source.InnerTableRead;
import org.apache.paimon.table.source.Split;
import org.apache.paimon.table.source.snapshot.SnapshotReader;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.types.DataType;
import org.apache.paimon.types.DataTypes;
import org.apache.paimon.types.RowType;
@@ -60,6 +59,7 @@ import java.util.function.Consumer;
import static org.apache.paimon.schema.SystemColumns.KEY_FIELD_PREFIX;
import static org.apache.paimon.schema.SystemColumns.SYSTEM_FIELD_NAMES;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -473,7 +473,7 @@ public class SchemaEvolutionTest {
Collections.singletonList(
SchemaChange.renameColumn("f0", "_VALUE_KIND"))))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
RuntimeException.class,
String.format(
"Field name[%s] in schema cannot be
exist in %s",
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/source/snapshot/StaticFromTagStartingScannerTest.java
b/paimon-core/src/test/java/org/apache/paimon/table/source/snapshot/StaticFromTagStartingScannerTest.java
index 6c08abf1b..357bb3386 100644
---
a/paimon-core/src/test/java/org/apache/paimon/table/source/snapshot/StaticFromTagStartingScannerTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/table/source/snapshot/StaticFromTagStartingScannerTest.java
@@ -20,13 +20,13 @@ package org.apache.paimon.table.source.snapshot;
import org.apache.paimon.table.sink.StreamTableCommit;
import org.apache.paimon.table.sink.StreamTableWrite;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.utils.SnapshotManager;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -74,7 +74,7 @@ public class StaticFromTagStartingScannerTest extends
ScannerTestBase {
new
StaticFromTagStartingScanner(snapshotManager, "non-existing")
.scan(snapshotReader))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
"Tag 'non-existing' doesn't exist"));
}
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaCanalSyncDatabaseActionITCase.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaCanalSyncDatabaseActionITCase.java
index d9530d85a..47b3419c8 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaCanalSyncDatabaseActionITCase.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaCanalSyncDatabaseActionITCase.java
@@ -40,7 +40,7 @@ import static
org.apache.flink.streaming.connectors.kafka.table.KafkaConnectorOp
import static
org.apache.flink.streaming.connectors.kafka.table.KafkaConnectorOptions.TOPIC_PATTERN;
import static
org.apache.flink.streaming.connectors.kafka.table.KafkaConnectorOptions.VALUE_FORMAT;
import static
org.apache.paimon.flink.action.cdc.TypeMapping.TypeMappingMode.TO_STRING;
-import static
org.apache.paimon.testutils.assertj.AssertionUtils.anyCauseMatches;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaCanalSyncTableActionITCase.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaCanalSyncTableActionITCase.java
index bd74864e4..148f647e7 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaCanalSyncTableActionITCase.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaCanalSyncTableActionITCase.java
@@ -50,7 +50,7 @@ import static
org.apache.flink.streaming.connectors.kafka.table.KafkaConnectorOp
import static
org.apache.flink.streaming.connectors.kafka.table.KafkaConnectorOptions.TOPIC_PATTERN;
import static
org.apache.flink.streaming.connectors.kafka.table.KafkaConnectorOptions.VALUE_FORMAT;
import static
org.apache.paimon.flink.action.cdc.TypeMapping.TypeMappingMode.TO_STRING;
-import static
org.apache.paimon.testutils.assertj.AssertionUtils.anyCauseMatches;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaSyncDatabaseActionITCase.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaSyncDatabaseActionITCase.java
index 66e704927..cdad175ea 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaSyncDatabaseActionITCase.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaSyncDatabaseActionITCase.java
@@ -20,7 +20,6 @@ package org.apache.paimon.flink.action.cdc.kafka;
import org.apache.paimon.catalog.FileSystemCatalogOptions;
import org.apache.paimon.table.FileStoreTable;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.types.DataType;
import org.apache.paimon.types.DataTypes;
import org.apache.paimon.types.RowType;
@@ -36,6 +35,7 @@ import java.util.concurrent.ThreadLocalRandom;
import static
org.apache.flink.streaming.connectors.kafka.table.KafkaConnectorOptions.TOPIC;
import static
org.apache.flink.streaming.connectors.kafka.table.KafkaConnectorOptions.VALUE_FORMAT;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
/** IT cases for {@link KafkaSyncDatabaseAction}. */
@@ -216,7 +216,7 @@ public class KafkaSyncDatabaseActionITCase extends
KafkaActionITCaseBase {
assertThatThrownBy(action::run)
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
"kafka_conf must and can only set one of the
following options: topic,topic-pattern."));
}
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaSyncTableActionITCase.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaSyncTableActionITCase.java
index 8bc5aaea2..f2f8fc246 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaSyncTableActionITCase.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/kafka/KafkaSyncTableActionITCase.java
@@ -48,7 +48,7 @@ import static
org.apache.flink.streaming.connectors.kafka.table.KafkaConnectorOp
import static
org.apache.flink.streaming.connectors.kafka.table.KafkaConnectorOptions.VALUE_FORMAT;
import static
org.apache.paimon.flink.action.cdc.kafka.KafkaActionUtils.getDataFormat;
import static
org.apache.paimon.flink.action.cdc.kafka.KafkaActionUtils.getKafkaEarliestConsumer;
-import static
org.apache.paimon.testutils.assertj.AssertionUtils.anyCauseMatches;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mysql/MySqlCdcTypeMappingITCase.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mysql/MySqlCdcTypeMappingITCase.java
index 38a99bc2a..7105335f3 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mysql/MySqlCdcTypeMappingITCase.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mysql/MySqlCdcTypeMappingITCase.java
@@ -20,7 +20,6 @@ package org.apache.paimon.flink.action.cdc.mysql;
import org.apache.paimon.flink.action.cdc.TypeMapping;
import org.apache.paimon.table.FileStoreTable;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.types.DataType;
import org.apache.paimon.types.DataTypes;
import org.apache.paimon.types.RowType;
@@ -44,6 +43,7 @@ import static
org.apache.paimon.flink.action.cdc.TypeMapping.TypeMappingMode.LON
import static
org.apache.paimon.flink.action.cdc.TypeMapping.TypeMappingMode.TINYINT1_NOT_BOOL;
import static
org.apache.paimon.flink.action.cdc.TypeMapping.TypeMappingMode.TO_NULLABLE;
import static
org.apache.paimon.flink.action.cdc.TypeMapping.TypeMappingMode.TO_STRING;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -135,7 +135,7 @@ public class MySqlCdcTypeMappingITCase extends
MySqlActionITCaseBase {
assertThatThrownBy(action::run)
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
"Type mapping option 'tinyint1-not-bool'
conflicts with "
+ "jdbc properties
'jdbc.properties.tinyInt1isBit=true'. "
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mysql/MySqlSyncTableActionITCase.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mysql/MySqlSyncTableActionITCase.java
index a1afcec93..aee4c484f 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mysql/MySqlSyncTableActionITCase.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mysql/MySqlSyncTableActionITCase.java
@@ -49,7 +49,7 @@ import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Collectors;
import static org.apache.paimon.CoreOptions.BUCKET;
-import static
org.apache.paimon.testutils.assertj.AssertionUtils.anyCauseMatches;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/postgres/PostgresSyncTableActionITCase.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/postgres/PostgresSyncTableActionITCase.java
index cbd6c7bd0..55dc58764 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/postgres/PostgresSyncTableActionITCase.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/postgres/PostgresSyncTableActionITCase.java
@@ -39,7 +39,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;
-import static
org.apache.paimon.testutils.assertj.AssertionUtils.anyCauseMatches;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
diff --git
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/CatalogTableITCase.java
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/CatalogTableITCase.java
index 60407710b..e6fb35098 100644
---
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/CatalogTableITCase.java
+++
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/CatalogTableITCase.java
@@ -23,7 +23,6 @@ import org.apache.paimon.table.system.AllTableOptionsTable;
import org.apache.paimon.table.system.CatalogOptionsTable;
import org.apache.paimon.table.system.SinkTableLineageTable;
import org.apache.paimon.table.system.SourceTableLineageTable;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.utils.BlockingIterator;
import org.apache.commons.lang3.StringUtils;
@@ -38,6 +37,7 @@ import java.util.List;
import java.util.stream.Collectors;
import static
org.apache.flink.table.api.config.TableConfigOptions.TABLE_DML_SYNC;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -752,14 +752,14 @@ public class CatalogTableITCase extends CatalogITCaseBase
{
assertThatThrownBy(() -> sql(ddl, "full-compaction"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
UnsupportedOperationException.class,
"Cannot set streaming-read-overwrite to true
when changelog producer "
+ "is full-compaction or lookup
because it will read duplicated changes."));
assertThatThrownBy(() -> sql(ddl, "lookup"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
UnsupportedOperationException.class,
"Cannot set streaming-read-overwrite to true
when changelog producer "
+ "is full-compaction or lookup
because it will read duplicated changes."));
diff --git
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/ReadWriteTableITCase.java
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/ReadWriteTableITCase.java
index 1ffa6fa7b..df8e317d4 100644
---
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/ReadWriteTableITCase.java
+++
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/ReadWriteTableITCase.java
@@ -26,7 +26,6 @@ import org.apache.paimon.fs.local.LocalFileIO;
import org.apache.paimon.schema.Schema;
import org.apache.paimon.schema.SchemaManager;
import org.apache.paimon.schema.TableSchema;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.types.DataTypes;
import org.apache.paimon.utils.BlockingIterator;
@@ -102,6 +101,7 @@ import static
org.apache.paimon.flink.util.ReadWriteTableTestUtil.testBatchRead;
import static
org.apache.paimon.flink.util.ReadWriteTableTestUtil.testStreamingRead;
import static
org.apache.paimon.flink.util.ReadWriteTableTestUtil.validateStreamingReadResult;
import static org.apache.paimon.flink.util.ReadWriteTableTestUtil.warehouse;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -799,7 +799,7 @@ public class ReadWriteTableITCase extends AbstractTestBase {
Collections.singletonList("dt"),
streamingReadOverwrite))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
RuntimeException.class,
"Doesn't support streaming read the changes
from overwrite when the primary keys are not defined."));
}
@@ -1388,7 +1388,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
testBatchRead(querySql, expectedRecords);
} else {
assertThatThrownBy(() -> bEnv.executeSql(updateStatement).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
}
@@ -1496,7 +1496,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
// Step4: execute update statement
assertThatThrownBy(() -> bEnv.executeSql(updateStatement).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
//
----------------------------------------------------------------------------------------------------------------
@@ -1547,7 +1547,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
testBatchRead(querySql, expectedRecords);
} else {
assertThatThrownBy(() -> bEnv.executeSql(deleteStatement).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
}
@@ -1583,7 +1583,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
changelogRow("+I", 3L, "Euro", 119L, "2022-01-02"));
assertThatThrownBy(() -> bEnv.executeSql(deleteStatement).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
@ParameterizedTest
@@ -1640,7 +1640,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
testBatchRead(querySql, expectedRecords);
} else {
assertThatThrownBy(() -> bEnv.executeSql(deleteStatement).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
// Test2 delete statement no where
@@ -1651,7 +1651,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
testBatchRead(querySql, Collections.emptyList());
} else {
assertThatThrownBy(() -> bEnv.executeSql(deleteStatement2).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
// Test3 delete statement where pt
@@ -1662,7 +1662,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
testBatchRead(querySql, Collections.emptyList());
} else {
assertThatThrownBy(() -> bEnv.executeSql(deleteStatement3).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
}
@@ -1723,7 +1723,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
testBatchRead(querySql, expectedRecords);
} else {
assertThatThrownBy(() -> bEnv.executeSql(deleteStatement).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
// Step5: partition key not push down
@@ -1742,7 +1742,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
testBatchRead(querySql, expectedRecords1);
} else {
assertThatThrownBy(() -> bEnv.executeSql(deleteStatement1).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
// Step6: partition key delete push down
@@ -1762,7 +1762,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
testBatchRead(querySql, expectedRecords2);
} else {
assertThatThrownBy(() -> bEnv.executeSql(deleteStatement2).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
// Step8: partition key delete push down
@@ -1779,7 +1779,7 @@ public class ReadWriteTableITCase extends
AbstractTestBase {
testBatchRead(querySql, expectedRecords3);
} else {
assertThatThrownBy(() -> bEnv.executeSql(deleteStatement3).await())
-
.satisfies(AssertionUtils.anyCauseMatches(UnsupportedOperationException.class));
+
.satisfies(anyCauseMatches(UnsupportedOperationException.class));
}
}
diff --git
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/SchemaChangeITCase.java
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/SchemaChangeITCase.java
index af113e7c1..dca0bc619 100644
---
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/SchemaChangeITCase.java
+++
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/SchemaChangeITCase.java
@@ -19,7 +19,6 @@
package org.apache.paimon.flink;
import org.apache.paimon.data.BinaryString;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.utils.DateTimeUtils;
import org.apache.flink.table.api.TableException;
@@ -33,6 +32,7 @@ import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -638,14 +638,14 @@ public class SchemaChangeITCase extends CatalogITCaseBase
{
// move self to first test
assertThatThrownBy(() -> sql("ALTER TABLE T MODIFY b STRING FIRST"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
UnsupportedOperationException.class,
"Cannot move itself for column b"));
// move self to after test
assertThatThrownBy(() -> sql("ALTER TABLE T MODIFY b STRING AFTER b"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
UnsupportedOperationException.class,
"Cannot move itself for column b"));
@@ -677,7 +677,7 @@ public class SchemaChangeITCase extends CatalogITCaseBase {
sql(
"INSERT INTO T VALUES('aaa', 'bbb',
'ccc', 1, CAST(NULL AS FLOAT))"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
TableException.class,
"Column 'e' is NOT NULL, however, a null value
is being written into it."));
@@ -709,7 +709,7 @@ public class SchemaChangeITCase extends CatalogITCaseBase {
sql(
"INSERT INTO T VALUES('aaa', 'bbb',
CAST(NULL AS STRING), 1, CAST(NULL AS FLOAT))"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
TableException.class,
"Column 'c' is NOT NULL, however, a null value
is being written into it."));
diff --git
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/MergeIntoActionITCase.java
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/MergeIntoActionITCase.java
index 5012a1732..a1ca5eb55 100644
---
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/MergeIntoActionITCase.java
+++
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/MergeIntoActionITCase.java
@@ -19,7 +19,6 @@
package org.apache.paimon.flink.action;
import org.apache.paimon.CoreOptions;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.utils.BlockingIterator;
import org.apache.flink.table.api.ValidationException;
@@ -58,6 +57,7 @@ import static
org.apache.paimon.flink.util.ReadWriteTableTestUtil.sEnv;
import static
org.apache.paimon.flink.util.ReadWriteTableTestUtil.testBatchRead;
import static
org.apache.paimon.flink.util.ReadWriteTableTestUtil.testStreamingRead;
import static
org.apache.paimon.flink.util.ReadWriteTableTestUtil.validateStreamingReadResult;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.params.provider.Arguments.arguments;
@@ -495,9 +495,7 @@ public class MergeIntoActionITCase extends ActionITCaseBase
{
.withMatchedDelete("S.v IS NULL");
assertThatThrownBy(() -> action.build().run())
- .satisfies(
- AssertionUtils.anyCauseMatches(
- ValidationException.class, "Object 'S' not
found"));
+ .satisfies(anyCauseMatches(ValidationException.class, "Object
'S' not found"));
}
@Test
@@ -515,9 +513,7 @@ public class MergeIntoActionITCase extends ActionITCaseBase
{
.withMatchedDelete("S.v IS NULL");
assertThatThrownBy(() -> action.build().run())
- .satisfies(
- AssertionUtils.anyCauseMatches(
- ValidationException.class, "Object 'S' not
found"));
+ .satisfies(anyCauseMatches(ValidationException.class, "Object
'S' not found"));
}
private void validateActionRunResult(
diff --git
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/align/AlignedContinuousFileSplitEnumeratorTest.java
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/align/AlignedContinuousFileSplitEnumeratorTest.java
index 24c8754f5..867ae9192 100644
---
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/align/AlignedContinuousFileSplitEnumeratorTest.java
+++
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/align/AlignedContinuousFileSplitEnumeratorTest.java
@@ -34,7 +34,6 @@ import org.apache.paimon.table.BucketMode;
import org.apache.paimon.table.FileStoreTable;
import org.apache.paimon.table.FileStoreTableFactory;
import org.apache.paimon.table.source.StreamTableScan;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.paimon.types.DataType;
import org.apache.paimon.types.DataTypes;
import org.apache.paimon.types.RowType;
@@ -54,6 +53,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -149,8 +149,7 @@ public class AlignedContinuousFileSplitEnumeratorTest
extends FileSplitEnumerato
.build();
assertThatThrownBy(() -> enumerator.snapshotState(1L))
.satisfies(
- AssertionUtils.anyCauseMatches(
- "Timeout while waiting for snapshot from
paimon source."));
+ anyCauseMatches("Timeout while waiting for snapshot
from paimon source."));
List<FileStoreSourceSplit> splits = new ArrayList<>();
for (int i = 1; i <= 2; i++) {
diff --git
a/paimon-hive/paimon-hive-connector-2.3/src/test/java/org/apache/paimon/hive/Hive23CatalogITCase.java
b/paimon-hive/paimon-hive-connector-2.3/src/test/java/org/apache/paimon/hive/Hive23CatalogITCase.java
index 1c3800aa0..1f86fa9e3 100644
---
a/paimon-hive/paimon-hive-connector-2.3/src/test/java/org/apache/paimon/hive/Hive23CatalogITCase.java
+++
b/paimon-hive/paimon-hive-connector-2.3/src/test/java/org/apache/paimon/hive/Hive23CatalogITCase.java
@@ -21,7 +21,6 @@ package org.apache.paimon.hive;
import org.apache.paimon.fs.local.LocalFileIO;
import org.apache.paimon.hive.runner.PaimonEmbeddedHiveRunner;
import org.apache.paimon.schema.SchemaManager;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import com.klarna.hiverunner.annotations.HiveRunnerSetup;
import com.klarna.hiverunner.config.HiveRunnerConfig;
@@ -38,6 +37,7 @@ import java.util.Arrays;
import static org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_IN_TEST;
import static
org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY;
import static org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_TXN_MANAGER;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -141,7 +141,7 @@ public class Hive23CatalogITCase extends
HiveCatalogITCaseBase {
assertThatThrownBy(() -> tEnv.executeSql("ALTER TABLE
alter_failed_table SET ('aa'='bb')"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
TableException.class,
"Could not execute AlterTable in path
`my_alter_hive`.`test_db`.`alter_failed_table`"));
diff --git
a/paimon-hive/paimon-hive-connector-3.1/src/test/java/org/apache/paimon/hive/Hive31CatalogITCase.java
b/paimon-hive/paimon-hive-connector-3.1/src/test/java/org/apache/paimon/hive/Hive31CatalogITCase.java
index da79b8ae4..5963faf42 100644
---
a/paimon-hive/paimon-hive-connector-3.1/src/test/java/org/apache/paimon/hive/Hive31CatalogITCase.java
+++
b/paimon-hive/paimon-hive-connector-3.1/src/test/java/org/apache/paimon/hive/Hive31CatalogITCase.java
@@ -21,7 +21,6 @@ package org.apache.paimon.hive;
import org.apache.paimon.fs.local.LocalFileIO;
import org.apache.paimon.hive.runner.PaimonEmbeddedHiveRunner;
import org.apache.paimon.schema.SchemaManager;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import com.klarna.hiverunner.annotations.HiveRunnerSetup;
import com.klarna.hiverunner.config.HiveRunnerConfig;
@@ -38,6 +37,7 @@ import java.util.Arrays;
import static org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_IN_TEST;
import static
org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY;
import static org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_TXN_MANAGER;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -140,7 +140,7 @@ public class Hive31CatalogITCase extends
HiveCatalogITCaseBase {
assertThatThrownBy(() -> tEnv.executeSql("ALTER TABLE
alter_failed_table SET ('aa'='bb')"))
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
TableException.class,
"Could not execute AlterTable in path
`my_alter_hive`.`test_db`.`alter_failed_table`"));
diff --git
a/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkSchemaEvolutionITCase.java
b/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkSchemaEvolutionITCase.java
index 56b47d868..9fa5d21ed 100644
---
a/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkSchemaEvolutionITCase.java
+++
b/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkSchemaEvolutionITCase.java
@@ -29,7 +29,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
-import static
org.apache.paimon.testutils.assertj.AssertionUtils.anyCauseMatches;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
diff --git
a/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkTimeTravelITCase.java
b/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkTimeTravelITCase.java
index bc77da589..8345c9a9d 100644
---
a/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkTimeTravelITCase.java
+++
b/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkTimeTravelITCase.java
@@ -22,7 +22,6 @@ import org.apache.paimon.CoreOptions;
import org.apache.paimon.data.BinaryString;
import org.apache.paimon.data.GenericRow;
import org.apache.paimon.table.FileStoreTable;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.junit.jupiter.api.Test;
@@ -30,6 +29,7 @@ import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -234,7 +234,7 @@ public class SparkTimeTravelITCase extends
SparkReadTestBase {
assertThatThrownBy(
() -> spark.sql("SELECT * FROM t VERSION AS OF
'unknown'").collectAsList())
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
RuntimeException.class,
"Cannot find a time travel version for
unknown"));
}
diff --git
a/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkTimeTravelWithDataFrameITCase.java
b/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkTimeTravelWithDataFrameITCase.java
index 109b8fc02..a03851caa 100644
---
a/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkTimeTravelWithDataFrameITCase.java
+++
b/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/SparkTimeTravelWithDataFrameITCase.java
@@ -21,7 +21,6 @@ package org.apache.paimon.spark;
import org.apache.paimon.CoreOptions;
import org.apache.paimon.data.BinaryString;
import org.apache.paimon.data.GenericRow;
-import org.apache.paimon.testutils.assertj.AssertionUtils;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
@@ -29,6 +28,7 @@ import org.junit.jupiter.api.Test;
import java.util.List;
+import static
org.apache.paimon.testutils.assertj.PaimonAssertions.anyCauseMatches;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -119,7 +119,7 @@ public class SparkTimeTravelWithDataFrameITCase extends
SparkReadTestBase {
.load()
.collectAsList())
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
RuntimeException.class, "Fails to read
snapshot from path file"));
}
@@ -170,7 +170,7 @@ public class SparkTimeTravelWithDataFrameITCase extends
SparkReadTestBase {
.load()
.collectAsList())
.satisfies(
- AssertionUtils.anyCauseMatches(
+ anyCauseMatches(
IllegalArgumentException.class,
"Could not parse value '1.5' for key
'scan.snapshot-id'"));
}
diff --git
a/paimon-test-utils/src/main/java/org/apache/paimon/testutils/assertj/AssertionUtils.java
b/paimon-test-utils/src/main/java/org/apache/paimon/testutils/assertj/AssertionUtils.java
deleted file mode 100644
index 57cce3ed8..000000000
---
a/paimon-test-utils/src/main/java/org/apache/paimon/testutils/assertj/AssertionUtils.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * 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.paimon.testutils.assertj;
-
-import org.assertj.core.api.AbstractThrowableAssert;
-import org.assertj.core.api.Assertions;
-import org.assertj.core.api.InstanceOfAssertFactory;
-import org.assertj.core.api.ListAssert;
-import org.assertj.core.api.ThrowingConsumer;
-
-import java.util.function.Function;
-import java.util.stream.Stream;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/** Some reusable assertions and utilities for AssertJ. Copied from
FlinkAssertions. */
-public final class AssertionUtils {
-
- private AssertionUtils() {}
-
- /** @see #chainOfCauses(Throwable) */
- @SuppressWarnings({"rawtypes", "unused"})
- public static final InstanceOfAssertFactory<Stream, ListAssert<Throwable>>
STREAM_THROWABLE =
- new InstanceOfAssertFactory<>(Stream.class,
Assertions::<Throwable>assertThat);
-
- /**
- * Shorthand to assert the chain of causes includes a {@link Throwable}
matching a specific
- * {@link Class} and containing the provided message. Same as:
- *
- * <pre>{@code
- * assertThatChainOfCauses(throwable)
- * .anySatisfy(
- * cause ->
- * assertThat(cause)
- * .isInstanceOf(clazz)
- * .hasMessageContaining(containsMessage));
- * }</pre>
- */
- public static ThrowingConsumer<? super Throwable> anyCauseMatches(
- Class<? extends Throwable> clazz, String containsMessage) {
- return t ->
- assertThatChainOfCauses(t)
- .as(
- "Any cause is instance of class '%s' and
contains message '%s'",
- clazz, containsMessage)
- .anySatisfy(
- cause ->
- assertThat(cause)
- .isInstanceOf(clazz)
-
.hasMessageContaining(containsMessage));
- }
-
- /**
- * Shorthand to assert the chain of causes includes a {@link Throwable}
matching a specific
- * {@link Class}. Same as:
- *
- * <pre>{@code
- * assertThatChainOfCauses(throwable)
- * .anySatisfy(
- * cause ->
- * assertThat(cause)
- * .isInstanceOf(clazz));
- * }</pre>
- */
- public static ThrowingConsumer<? super Throwable> anyCauseMatches(
- Class<? extends Throwable> clazz) {
- return t ->
- assertThatChainOfCauses(t)
- .as("Any cause is instance of class '%s'", clazz)
- .anySatisfy(cause ->
assertThat(cause).isInstanceOf(clazz));
- }
-
- /**
- * Shorthand to assert the chain of causes includes a {@link Throwable}
matching a specific
- * {@link Class} and containing the provided message. Same as:
- *
- * <pre>{@code
- * assertThatChainOfCauses(throwable)
- * .anySatisfy(
- * cause ->
- * assertThat(cause)
- * .hasMessageContaining(containsMessage));
- * }</pre>
- */
- public static ThrowingConsumer<? super Throwable> anyCauseMatches(String
containsMessage) {
- return t ->
- assertThatChainOfCauses(t)
- .as("Any cause contains message '%s'", containsMessage)
- .anySatisfy(t1 ->
assertThat(t1).hasMessageContaining(containsMessage));
- }
-
- /**
- * Shorthand to assert chain of causes. Same as:
- *
- * <pre>{@code
- * assertThat(throwable)
- * .extracting(AssertionUtils::chainOfCauses,
AssertionUtils.STREAM_THROWABLE)
- * }</pre>
- */
- public static ListAssert<Throwable> assertThatChainOfCauses(Throwable
root) {
- return assertThat(root).extracting(AssertionUtils::chainOfCauses,
STREAM_THROWABLE);
- }
-
- /**
- * You can use this method in combination with {@link
- * AbstractThrowableAssert#extracting(Function, InstanceOfAssertFactory)}
to perform assertions
- * on a chain of causes. For example:
- *
- * <pre>{@code
- * assertThat(throwable)
- * .extracting(AssertionUtils::chainOfCauses,
AssertionUtils.STREAM_THROWABLE)
- * }</pre>
- *
- * @return the list is ordered from the current {@link Throwable} up to
the root cause.
- */
- public static Stream<Throwable> chainOfCauses(Throwable throwable) {
- if (throwable == null) {
- return Stream.empty();
- }
- if (throwable.getCause() == null) {
- return Stream.of(throwable);
- }
- return Stream.concat(Stream.of(throwable),
chainOfCauses(throwable.getCause()));
- }
-}
diff --git
a/paimon-test-utils/src/main/java/org/apache/paimon/testutils/assertj/PaimonAssertions.java
b/paimon-test-utils/src/main/java/org/apache/paimon/testutils/assertj/PaimonAssertions.java
index 0c3a5f5bd..04d236e7b 100644
---
a/paimon-test-utils/src/main/java/org/apache/paimon/testutils/assertj/PaimonAssertions.java
+++
b/paimon-test-utils/src/main/java/org/apache/paimon/testutils/assertj/PaimonAssertions.java
@@ -110,7 +110,7 @@ public final class PaimonAssertions {
*
* <pre>{@code
* assertThat(throwable)
- * .extracting(FlinkAssertions::chainOfCauses,
FlinkAssertions.STREAM_THROWABLE)
+ * .extracting(PaimonAssertions::chainOfCauses,
PaimonAssertions.STREAM_THROWABLE)
* }</pre>
*/
public static ListAssert<Throwable> assertThatChainOfCauses(Throwable
root) {