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/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new d6da5f2119 [test] Static import of assertion classes (#5338)
d6da5f2119 is described below
commit d6da5f21192a726364078777728d0d2e69749277
Author: yangjf2019 <[email protected]>
AuthorDate: Wed Mar 26 10:04:43 2025 +0800
[test] Static import of assertion classes (#5338)
---
.../paimon/sort/zorder/TestZOrderByteUtil.java | 93 +++++++++++-----------
.../org/apache/paimon/disk/InMemoryBufferTest.java | 4 +-
.../paimon/index/HashBucketAssignerTest.java | 9 +--
.../paimon/index/SimpleHashBucketAssignerTest.java | 27 +++----
.../paimon/rest/DefaultErrorHandlerTest.java | 2 +-
.../org/apache/paimon/rest/HttpClientTest.java | 4 +-
.../apache/paimon/rest/RESTObjectMapperTest.java | 4 +-
.../apache/paimon/rest/auth/AuthSessionTest.java | 13 ++-
.../paimon/rest/auth/DLFAuthSignatureTest.java | 5 +-
.../apache/paimon/sort/zorder/ZIndexerTest.java | 8 +-
.../apache/paimon/table/ChangelogExpireTest.java | 4 +-
.../paimon/table/DynamicBucketTableTest.java | 7 +-
.../paimon/table/TableFormatReadWriteTest.java | 5 +-
.../table/TableFormatReadWriteWithPkTest.java | 5 +-
.../table/source/snapshot/TimeTravelUtilsTest.java | 4 +-
.../paimon/table/system/ManifestsTableTest.java | 6 +-
.../test/java/org/apache/paimon/tag/TagTest.java | 9 ++-
.../apache/paimon/utils/ConvertBinaryUtilTest.java | 4 +-
.../action/cdc/SyncDatabaseActionBaseTest.java | 19 ++---
.../flink/action/cdc/TableNameConverterTest.java | 19 ++---
.../format/aliyun/AliyunJsonRecordParserTest.java | 53 ++++++------
.../kafka/KafkaCanalSyncDatabaseActionITCase.java | 2 +-
.../flink/action/cdc/mongodb/MongoDBContainer.java | 6 +-
.../UpdatedDataFieldsProcessFunctionBaseTest.java | 27 +++----
.../paimon/flink/action/BranchActionITCase.java | 8 +-
.../paimon/flink/source/IteratorSourcesITCase.java | 2 +-
.../org/apache/paimon/hive/TestHiveMetastore.java | 4 +-
.../IcebergHiveMetadataCommitterITCaseBase.java | 31 ++++----
28 files changed, 194 insertions(+), 190 deletions(-)
diff --git
a/paimon-common/src/test/java/org/apache/paimon/sort/zorder/TestZOrderByteUtil.java
b/paimon-common/src/test/java/org/apache/paimon/sort/zorder/TestZOrderByteUtil.java
index 72ffc17121..bd59230ae6 100644
---
a/paimon-common/src/test/java/org/apache/paimon/sort/zorder/TestZOrderByteUtil.java
+++
b/paimon-common/src/test/java/org/apache/paimon/sort/zorder/TestZOrderByteUtil.java
@@ -18,7 +18,6 @@
package org.apache.paimon.sort.zorder;
-import org.junit.Assert;
import org.junit.Test;
import org.testcontainers.shaded.com.google.common.primitives.UnsignedBytes;
@@ -28,6 +27,8 @@ import java.util.Random;
import static org.apache.paimon.utils.RandomUtil.randomBytes;
import static org.apache.paimon.utils.RandomUtil.randomString;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
/* This file is based on source code from the Iceberg Project
(http://iceberg.apache.org/), licensed by the Apache
* Software Foundation (ASF) under the Apache License, Version 2.0. See the
NOTICE file distributed with this work for
@@ -108,10 +109,10 @@ public class TestZOrderByteUtil {
String stringResult = interleaveStrings(testStrings);
- Assert.assertEquals(
- "String interleave didn't match byte interleave",
+ assertEquals(
stringResult,
- byteResultAsString);
+ byteResultAsString,
+ "String interleave didn't match byte interleave");
}
}
@@ -135,10 +136,10 @@ public class TestZOrderByteUtil {
String stringResult = interleaveStrings(testStrings);
- Assert.assertEquals(
- "String interleave didn't match byte interleave",
+ assertEquals(
stringResult,
- byteResultAsString);
+ byteResultAsString,
+ "String interleave didn't match byte interleave");
}
}
@@ -147,8 +148,8 @@ public class TestZOrderByteUtil {
byte[][] test = new byte[4][10];
byte[] expected = new byte[40];
- Assert.assertArrayEquals(
- "Should combine empty arrays", expected,
ZOrderByteUtils.interleaveBits(test, 40));
+ assertArrayEquals(
+ expected, ZOrderByteUtils.interleaveBits(test, 40), "Should
combine empty arrays");
}
@Test
@@ -160,8 +161,8 @@ public class TestZOrderByteUtil {
test[3] = new byte[] {IIIIIIII, IIIIIIII, IIIIIIII};
byte[] expected = new byte[] {IIIIIIII, IIIIIIII, IIIIIIII, IIIIIIII,
IIIIIIII, IIIIIIII};
- Assert.assertArrayEquals(
- "Should combine full arrays", expected,
ZOrderByteUtils.interleaveBits(test, 6));
+ assertArrayEquals(
+ expected, ZOrderByteUtils.interleaveBits(test, 6), "Should
combine full arrays");
}
@Test
@@ -176,10 +177,10 @@ public class TestZOrderByteUtil {
OOOOOOOO, OOOOOOOO, OOOOOOOO, OOOOIIII, IOIOIOIO,
IOIOIOIO, OIOIOIOI, OIOIOIOI,
OOOOIIII
};
- Assert.assertArrayEquals(
- "Should combine mixed byte arrays",
+ assertArrayEquals(
expected,
- ZOrderByteUtils.interleaveBits(test, 9));
+ ZOrderByteUtils.interleaveBits(test, 9),
+ "Should combine mixed byte arrays");
}
@Test
@@ -196,7 +197,9 @@ public class TestZOrderByteUtil {
Integer.signum(
UnsignedBytes.lexicographicalComparator().compare(aBytes, bBytes));
- Assert.assertEquals(
+ assertEquals(
+ intCompare,
+ byteCompare,
String.format(
"Ordering of ints should match ordering of bytes,
%s ~ %s -> %s != %s ~ %s -> %s ",
aInt,
@@ -204,9 +207,7 @@ public class TestZOrderByteUtil {
intCompare,
Arrays.toString(aBytes),
Arrays.toString(bBytes),
- byteCompare),
- intCompare,
- byteCompare);
+ byteCompare));
}
}
@@ -224,7 +225,9 @@ public class TestZOrderByteUtil {
Integer.signum(
UnsignedBytes.lexicographicalComparator().compare(aBytes, bBytes));
- Assert.assertEquals(
+ assertEquals(
+ longCompare,
+ byteCompare,
String.format(
"Ordering of longs should match ordering of bytes,
%s ~ %s -> %s != %s ~ %s -> %s ",
aLong,
@@ -232,9 +235,7 @@ public class TestZOrderByteUtil {
longCompare,
Arrays.toString(aBytes),
Arrays.toString(bBytes),
- byteCompare),
- longCompare,
- byteCompare);
+ byteCompare));
}
}
@@ -252,7 +253,9 @@ public class TestZOrderByteUtil {
Integer.signum(
UnsignedBytes.lexicographicalComparator().compare(aBytes, bBytes));
- Assert.assertEquals(
+ assertEquals(
+ longCompare,
+ byteCompare,
String.format(
"Ordering of longs should match ordering of bytes,
%s ~ %s -> %s != %s ~ %s -> %s ",
aShort,
@@ -260,9 +263,7 @@ public class TestZOrderByteUtil {
longCompare,
Arrays.toString(aBytes),
Arrays.toString(bBytes),
- byteCompare),
- longCompare,
- byteCompare);
+ byteCompare));
}
}
@@ -280,7 +281,9 @@ public class TestZOrderByteUtil {
Integer.signum(
UnsignedBytes.lexicographicalComparator().compare(aBytes, bBytes));
- Assert.assertEquals(
+ assertEquals(
+ longCompare,
+ byteCompare,
String.format(
"Ordering of longs should match ordering of bytes,
%s ~ %s -> %s != %s ~ %s -> %s ",
aByte,
@@ -288,9 +291,7 @@ public class TestZOrderByteUtil {
longCompare,
Arrays.toString(aBytes),
Arrays.toString(bBytes),
- byteCompare),
- longCompare,
- byteCompare);
+ byteCompare));
}
}
@@ -308,7 +309,9 @@ public class TestZOrderByteUtil {
Integer.signum(
UnsignedBytes.lexicographicalComparator().compare(aBytes, bBytes));
- Assert.assertEquals(
+ assertEquals(
+ floatCompare,
+ byteCompare,
String.format(
"Ordering of floats should match ordering of
bytes, %s ~ %s -> %s != %s ~ %s -> %s ",
aFloat,
@@ -316,9 +319,7 @@ public class TestZOrderByteUtil {
floatCompare,
Arrays.toString(aBytes),
Arrays.toString(bBytes),
- byteCompare),
- floatCompare,
- byteCompare);
+ byteCompare));
}
}
@@ -336,7 +337,9 @@ public class TestZOrderByteUtil {
Integer.signum(
UnsignedBytes.lexicographicalComparator().compare(aBytes, bBytes));
- Assert.assertEquals(
+ assertEquals(
+ doubleCompare,
+ byteCompare,
String.format(
"Ordering of doubles should match ordering of
bytes, %s ~ %s -> %s != %s ~ %s -> %s ",
aDouble,
@@ -344,9 +347,7 @@ public class TestZOrderByteUtil {
doubleCompare,
Arrays.toString(aBytes),
Arrays.toString(bBytes),
- byteCompare),
- doubleCompare,
- byteCompare);
+ byteCompare));
}
}
@@ -364,7 +365,9 @@ public class TestZOrderByteUtil {
Integer.signum(
UnsignedBytes.lexicographicalComparator().compare(aBytes, bBytes));
- Assert.assertEquals(
+ assertEquals(
+ stringCompare,
+ byteCompare,
String.format(
"Ordering of strings should match ordering of
bytes, %s ~ %s -> %s != %s ~ %s -> %s ",
aString,
@@ -372,9 +375,7 @@ public class TestZOrderByteUtil {
stringCompare,
Arrays.toString(aBytes),
Arrays.toString(bBytes),
- byteCompare),
- stringCompare,
- byteCompare);
+ byteCompare));
}
}
@@ -395,7 +396,9 @@ public class TestZOrderByteUtil {
Integer.signum(
UnsignedBytes.lexicographicalComparator().compare(aBytes, bBytes));
- Assert.assertEquals(
+ assertEquals(
+ stringCompare,
+ byteCompare,
String.format(
"Ordering of strings should match ordering of
bytes, %s ~ %s -> %s != %s ~ %s -> %s ",
aBytesRaw,
@@ -403,9 +406,7 @@ public class TestZOrderByteUtil {
stringCompare,
Arrays.toString(aBytes),
Arrays.toString(bBytes),
- byteCompare),
- stringCompare,
- byteCompare);
+ byteCompare));
}
}
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/disk/InMemoryBufferTest.java
b/paimon-core/src/test/java/org/apache/paimon/disk/InMemoryBufferTest.java
index c197fcb8bb..039be29398 100644
--- a/paimon-core/src/test/java/org/apache/paimon/disk/InMemoryBufferTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/disk/InMemoryBufferTest.java
@@ -29,7 +29,6 @@ import org.apache.paimon.memory.MemoryPoolFactory;
import org.apache.paimon.memory.MemorySegmentPool;
import org.apache.paimon.types.DataTypes;
-import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -37,6 +36,7 @@ import java.util.Arrays;
import static org.apache.paimon.memory.MemorySegmentPool.DEFAULT_PAGE_SIZE;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatCode;
/** Tests for {@link InMemoryBuffer}. */
public class InMemoryBufferTest {
@@ -163,7 +163,7 @@ public class InMemoryBufferTest {
owner1.reset();
for (int i = 0; i < 100; i++) {
- Assertions.assertThatCode(owner2::put).doesNotThrowAnyException();
+ assertThatCode(owner2::put).doesNotThrowAnyException();
}
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/index/HashBucketAssignerTest.java
b/paimon-core/src/test/java/org/apache/paimon/index/HashBucketAssignerTest.java
index b9c6a28378..df71f204b7 100644
---
a/paimon-core/src/test/java/org/apache/paimon/index/HashBucketAssignerTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/index/HashBucketAssignerTest.java
@@ -27,7 +27,6 @@ import org.apache.paimon.table.sink.CommitMessage;
import org.apache.paimon.table.sink.CommitMessageImpl;
import org.apache.paimon.table.sink.StreamTableCommit;
-import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -141,13 +140,13 @@ public class HashBucketAssignerTest extends
PrimaryKeyTableTestBase {
int hash = 18;
for (int i = 0; i < 200; i++) {
int bucket = assigner.assign(row(1), hash += 2);
- Assertions.assertThat(bucket).isIn(0, 2);
+ assertThat(bucket).isIn(0, 2);
}
// partition 2
hash = 12;
for (int i = 0; i < 200; i++) {
int bucket = assigner.assign(row(2), hash += 2);
- Assertions.assertThat(bucket).isIn(0, 2);
+ assertThat(bucket).isIn(0, 2);
}
}
@@ -174,7 +173,7 @@ public class HashBucketAssignerTest extends
PrimaryKeyTableTestBase {
int hash = 18;
for (int i = 0; i < 200; i++) {
int bucket = assigner0.assign(row(2), hash += 2);
- Assertions.assertThat(bucket).isIn(0, 2);
+ assertThat(bucket).isIn(0, 2);
}
// assigner1: assign
@@ -188,7 +187,7 @@ public class HashBucketAssignerTest extends
PrimaryKeyTableTestBase {
hash = 9;
for (int i = 0; i < 200; i++) {
int bucket = assigner1.assign(row(2), hash += 2);
- Assertions.assertThat(bucket).isIn(1);
+ assertThat(bucket).isIn(1);
}
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/index/SimpleHashBucketAssignerTest.java
b/paimon-core/src/test/java/org/apache/paimon/index/SimpleHashBucketAssignerTest.java
index 2e2e53b7ef..662a68f1d9 100644
---
a/paimon-core/src/test/java/org/apache/paimon/index/SimpleHashBucketAssignerTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/index/SimpleHashBucketAssignerTest.java
@@ -20,7 +20,6 @@ package org.apache.paimon.index;
import org.apache.paimon.data.BinaryRow;
-import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
@@ -41,16 +40,16 @@ public class SimpleHashBucketAssignerTest {
for (int i = 0; i < 100; i++) {
int bucket = simpleHashBucketAssigner.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isEqualTo(0);
+ assertThat(bucket).isEqualTo(0);
}
for (int i = 0; i < 100; i++) {
int bucket = simpleHashBucketAssigner.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isEqualTo(2);
+ assertThat(bucket).isEqualTo(2);
}
int bucket = simpleHashBucketAssigner.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isEqualTo(4);
+ assertThat(bucket).isEqualTo(4);
}
@Test
@@ -63,18 +62,18 @@ public class SimpleHashBucketAssignerTest {
for (int i = 0; i < 100; i++) {
int bucket = simpleHashBucketAssigner.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isEqualTo(0);
+ assertThat(bucket).isEqualTo(0);
}
for (int i = 0; i < 100; i++) {
int bucket = simpleHashBucketAssigner.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isEqualTo(2);
+ assertThat(bucket).isEqualTo(2);
}
// exceed upper bound
for (int i = 0; i < 200; i++) {
int bucket = simpleHashBucketAssigner.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isIn(0, 2);
+ assertThat(bucket).isIn(0, 2);
}
}
@@ -90,27 +89,27 @@ public class SimpleHashBucketAssignerTest {
for (int i = 0; i < 100; i++) {
int bucket = simpleHashBucketAssigner0.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isEqualTo(0);
+ assertThat(bucket).isEqualTo(0);
}
for (int i = 0; i < 100; i++) {
int bucket = simpleHashBucketAssigner1.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isEqualTo(1);
+ assertThat(bucket).isEqualTo(1);
}
for (int i = 0; i < 100; i++) {
int bucket = simpleHashBucketAssigner0.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isEqualTo(2);
+ assertThat(bucket).isEqualTo(2);
}
// exceed upper bound
for (int i = 0; i < 200; i++) {
int bucket = simpleHashBucketAssigner0.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isIn(0, 2);
+ assertThat(bucket).isIn(0, 2);
}
for (int i = 0; i < 200; i++) {
int bucket = simpleHashBucketAssigner1.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isIn(1);
+ assertThat(bucket).isIn(1);
}
}
@@ -125,14 +124,14 @@ public class SimpleHashBucketAssignerTest {
for (int i = 0; i < 100; i++) {
int bucket = simpleHashBucketAssigner.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isEqualTo(0);
+ assertThat(bucket).isEqualTo(0);
}
// reset hash, the record will go into bucket 0
hash = 0;
for (int i = 0; i < 100; i++) {
int bucket = simpleHashBucketAssigner.assign(binaryRow, hash++);
- Assertions.assertThat(bucket).isEqualTo(0);
+ assertThat(bucket).isEqualTo(0);
}
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/rest/DefaultErrorHandlerTest.java
b/paimon-core/src/test/java/org/apache/paimon/rest/DefaultErrorHandlerTest.java
index 99c5460e86..42758799c4 100644
---
a/paimon-core/src/test/java/org/apache/paimon/rest/DefaultErrorHandlerTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/rest/DefaultErrorHandlerTest.java
@@ -34,7 +34,7 @@ import org.junit.Test;
import java.io.IOException;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertThrows;
/** Test for {@link DefaultErrorHandler}. */
public class DefaultErrorHandlerTest {
diff --git
a/paimon-core/src/test/java/org/apache/paimon/rest/HttpClientTest.java
b/paimon-core/src/test/java/org/apache/paimon/rest/HttpClientTest.java
index 13418d439b..c688665c69 100644
--- a/paimon-core/src/test/java/org/apache/paimon/rest/HttpClientTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/rest/HttpClientTest.java
@@ -50,9 +50,9 @@ import java.util.stream.Collectors;
import static okhttp3.ConnectionSpec.CLEARTEXT;
import static okhttp3.ConnectionSpec.COMPATIBLE_TLS;
import static okhttp3.ConnectionSpec.MODERN_TLS;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.spy;
diff --git
a/paimon-core/src/test/java/org/apache/paimon/rest/RESTObjectMapperTest.java
b/paimon-core/src/test/java/org/apache/paimon/rest/RESTObjectMapperTest.java
index 9951544e04..974837c69a 100644
--- a/paimon-core/src/test/java/org/apache/paimon/rest/RESTObjectMapperTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/rest/RESTObjectMapperTest.java
@@ -47,8 +47,8 @@ import java.util.HashMap;
import java.util.Map;
import static org.apache.paimon.rest.RESTObjectMapper.OBJECT_MAPPER;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/** Test for {@link RESTObjectMapper}. */
public class RESTObjectMapperTest {
diff --git
a/paimon-core/src/test/java/org/apache/paimon/rest/auth/AuthSessionTest.java
b/paimon-core/src/test/java/org/apache/paimon/rest/auth/AuthSessionTest.java
index 9a17f08906..16285e734d 100644
--- a/paimon-core/src/test/java/org/apache/paimon/rest/auth/AuthSessionTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/rest/auth/AuthSessionTest.java
@@ -26,7 +26,6 @@ import org.apache.paimon.utils.ThreadPoolUtils;
import
org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.io.FileUtils;
-import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -58,9 +57,9 @@ import static
org.apache.paimon.rest.auth.AuthSession.REFRESH_NUM_RETRIES;
import static
org.apache.paimon.rest.auth.DLFAuthProvider.DLF_AUTHORIZATION_HEADER_KEY;
import static org.apache.paimon.rest.auth.DLFAuthProvider.DLF_DATE_HEADER_KEY;
import static org.apache.paimon.rest.auth.DLFAuthProvider.TOKEN_DATE_FORMATTER;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -288,9 +287,9 @@ public class AuthSessionTest {
AuthSession session = AuthSession.fromRefreshAuthProvider(executor,
authProvider);
DLFAuthProvider dlfAuthProvider = (DLFAuthProvider)
session.getAuthProvider();
DLFToken fetchToken = dlfAuthProvider.token;
- Assert.assertEquals(fetchToken.getAccessKeyId(),
customToken.getAccessKeyId());
- Assert.assertEquals(fetchToken.getAccessKeySecret(),
customToken.getAccessKeySecret());
- Assert.assertEquals(fetchToken.getSecurityToken(),
customToken.getSecurityToken());
+ assertEquals(fetchToken.getAccessKeyId(),
customToken.getAccessKeyId());
+ assertEquals(fetchToken.getAccessKeySecret(),
customToken.getAccessKeySecret());
+ assertEquals(fetchToken.getSecurityToken(),
customToken.getSecurityToken());
}
@Test
diff --git
a/paimon-core/src/test/java/org/apache/paimon/rest/auth/DLFAuthSignatureTest.java
b/paimon-core/src/test/java/org/apache/paimon/rest/auth/DLFAuthSignatureTest.java
index 71ea068cdb..e58b360ee2 100644
---
a/paimon-core/src/test/java/org/apache/paimon/rest/auth/DLFAuthSignatureTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/rest/auth/DLFAuthSignatureTest.java
@@ -21,12 +21,13 @@ package org.apache.paimon.rest.auth;
import org.apache.paimon.rest.MockRESTMessage;
import org.apache.paimon.rest.RESTObjectMapper;
-import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.HashMap;
import java.util.Map;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
/** Test for {@link DLFAuthSignature}. */
public class DLFAuthSignatureTest {
@@ -50,7 +51,7 @@ public class DLFAuthSignatureTest {
String authorization =
DLFAuthSignature.getAuthorization(
restAuthParameter, token, region, signHeaders,
dateTime, date);
- Assertions.assertEquals(
+ assertEquals(
"DLF4-HMAC-SHA256
Credential=access-key-id/20231203/cn-hangzhou/DlfNext/aliyun_v4_request,Signature=c72caf1d40b55b1905d891ee3e3de48a2f8bebefa7e39e4f277acc93c269c5e3",
authorization);
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/sort/zorder/ZIndexerTest.java
b/paimon-core/src/test/java/org/apache/paimon/sort/zorder/ZIndexerTest.java
index fbaf9f90aa..05e96a9aaf 100644
--- a/paimon-core/src/test/java/org/apache/paimon/sort/zorder/ZIndexerTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/sort/zorder/ZIndexerTest.java
@@ -26,7 +26,6 @@ import org.apache.paimon.types.IntType;
import org.apache.paimon.types.RowType;
import org.apache.paimon.types.VarCharType;
-import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import java.nio.ByteBuffer;
@@ -34,6 +33,7 @@ import java.util.Arrays;
import java.util.Random;
import static org.apache.paimon.utils.RandomUtil.randomString;
+import static org.assertj.core.api.Assertions.assertThat;
/** Tests for {@link ZIndexer}. */
public class ZIndexerTest {
@@ -66,7 +66,7 @@ public class ZIndexerTest {
byte[] expectedZOrder = ZOrderByteUtils.interleaveBits(zCache, 16);
for (int j = 0; j < 16; j++) {
- Assertions.assertThat(zOrder[j]).isEqualTo(expectedZOrder[j]);
+ assertThat(zOrder[j]).isEqualTo(expectedZOrder[j]);
}
}
}
@@ -99,7 +99,7 @@ public class ZIndexerTest {
ZOrderByteUtils.interleaveBits(zCache, zCache.length *
varTypeSize);
for (int j = 0; j < zCache.length * varTypeSize; j++) {
- Assertions.assertThat(zOrder[j]).isEqualTo(expectedZOrder[j]);
+ assertThat(zOrder[j]).isEqualTo(expectedZOrder[j]);
}
}
}
@@ -132,7 +132,7 @@ public class ZIndexerTest {
ZOrderByteUtils.interleaveBits(zCache, zCache.length *
varTypeSize);
for (int j = 0; j < zCache.length * varTypeSize; j++) {
- Assertions.assertThat(zOrder[j]).isEqualTo(expectedZOrder[j]);
+ assertThat(zOrder[j]).isEqualTo(expectedZOrder[j]);
}
}
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/ChangelogExpireTest.java
b/paimon-core/src/test/java/org/apache/paimon/table/ChangelogExpireTest.java
index db6ee74967..c6eab6dd19 100644
--- a/paimon-core/src/test/java/org/apache/paimon/table/ChangelogExpireTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/table/ChangelogExpireTest.java
@@ -28,13 +28,13 @@ import org.apache.paimon.schema.Schema;
import org.apache.paimon.types.DataTypes;
import org.apache.paimon.utils.TraceableFileIO;
-import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.UUID;
import static org.apache.paimon.options.CatalogOptions.CACHE_ENABLED;
+import static org.assertj.core.api.Assertions.assertThatCode;
/** Test for changelog expire. */
public class ChangelogExpireTest extends IndexFileExpireTableTest {
@@ -76,6 +76,6 @@ public class ChangelogExpireTest extends
IndexFileExpireTableTest {
ExpireSnapshotsImpl expireSnapshots =
(ExpireSnapshotsImpl)
table.newExpireSnapshots().config(expireConfig);
expireSnapshots.expireUntil(1, 7);
- Assertions.assertThatCode(() -> expire.expireUntil(1,
6)).doesNotThrowAnyException();
+ assertThatCode(() -> expire.expireUntil(1,
6)).doesNotThrowAnyException();
}
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/DynamicBucketTableTest.java
b/paimon-core/src/test/java/org/apache/paimon/table/DynamicBucketTableTest.java
index 544d249709..5a53ba8748 100644
---
a/paimon-core/src/test/java/org/apache/paimon/table/DynamicBucketTableTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/table/DynamicBucketTableTest.java
@@ -33,11 +33,12 @@ import org.apache.paimon.table.sink.TableWriteImpl;
import org.apache.paimon.types.DataTypes;
import org.apache.paimon.utils.Pair;
-import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
+import static org.assertj.core.api.Assertions.assertThat;
+
/** Tests for Dynamic Bucket Table. */
public class DynamicBucketTableTest extends TableTestBase {
@@ -56,10 +57,10 @@ public class DynamicBucketTableTest extends TableTestBase {
.createWriterContainer(BinaryRow.EMPTY_ROW, 0,
true)
.indexMaintainer;
- Assertions.assertThat(indexMaintainer.isEmpty()).isTrue();
+ assertThat(indexMaintainer.isEmpty()).isTrue();
Pair<InternalRow, Integer> rowWithBucket = data(0);
batchTableWrite.write(rowWithBucket.getKey(),
rowWithBucket.getValue());
- Assertions.assertThat(
+ assertThat(
((CommitMessageImpl)
batchTableWrite.prepareCommit().get(0))
.indexIncrement()
.newIndexFiles()
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/TableFormatReadWriteTest.java
b/paimon-core/src/test/java/org/apache/paimon/table/TableFormatReadWriteTest.java
index d303dd862e..cfd2425d75 100644
---
a/paimon-core/src/test/java/org/apache/paimon/table/TableFormatReadWriteTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/table/TableFormatReadWriteTest.java
@@ -25,11 +25,12 @@ import org.apache.paimon.data.Timestamp;
import org.apache.paimon.schema.Schema;
import org.apache.paimon.types.DataTypes;
-import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
+import static org.assertj.core.api.Assertions.assertThat;
+
/** Test write read equals in append only table. */
public class TableFormatReadWriteTest extends TableTestBase {
@@ -79,7 +80,7 @@ public class TableFormatReadWriteTest extends TableTestBase {
List<InternalRow> readed = read(table);
- Assertions.assertThat(readed).containsExactlyInAnyOrder(datas);
+ assertThat(readed).containsExactlyInAnyOrder(datas);
dropTableDefault();
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/TableFormatReadWriteWithPkTest.java
b/paimon-core/src/test/java/org/apache/paimon/table/TableFormatReadWriteWithPkTest.java
index 8adfcdc894..3cefdd42eb 100644
---
a/paimon-core/src/test/java/org/apache/paimon/table/TableFormatReadWriteWithPkTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/table/TableFormatReadWriteWithPkTest.java
@@ -25,11 +25,12 @@ import org.apache.paimon.data.Timestamp;
import org.apache.paimon.schema.Schema;
import org.apache.paimon.types.DataTypes;
-import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
+import static org.assertj.core.api.Assertions.assertThat;
+
/** Test write read equals in primary key table. */
public class TableFormatReadWriteWithPkTest extends TableTestBase {
@@ -80,7 +81,7 @@ public class TableFormatReadWriteWithPkTest extends
TableTestBase {
List<InternalRow> readed = read(table);
- Assertions.assertThat(readed).containsExactlyInAnyOrder(datas);
+ assertThat(readed).containsExactlyInAnyOrder(datas);
dropTableDefault();
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/source/snapshot/TimeTravelUtilsTest.java
b/paimon-core/src/test/java/org/apache/paimon/table/source/snapshot/TimeTravelUtilsTest.java
index 4d5ea873f1..6c5484abae 100644
---
a/paimon-core/src/test/java/org/apache/paimon/table/source/snapshot/TimeTravelUtilsTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/table/source/snapshot/TimeTravelUtilsTest.java
@@ -28,9 +28,9 @@ import org.junit.jupiter.api.Test;
import java.util.HashMap;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/** Tests for {@link TimeTravelUtil}. */
public class TimeTravelUtilsTest extends ScannerTestBase {
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/system/ManifestsTableTest.java
b/paimon-core/src/test/java/org/apache/paimon/table/system/ManifestsTableTest.java
index b16d0f82a8..c5bb5282fd 100644
---
a/paimon-core/src/test/java/org/apache/paimon/table/system/ManifestsTableTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/table/system/ManifestsTableTest.java
@@ -48,7 +48,7 @@ import java.util.List;
import static org.apache.paimon.SnapshotTest.newSnapshotManager;
import static
org.apache.paimon.utils.FileStorePathFactoryTest.createNonPartFactory;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertThrows;
/** Unit tests for {@link ManifestsTable}. */
public class ManifestsTableTest extends TableTestBase {
@@ -157,9 +157,9 @@ public class ManifestsTableTest extends TableTestBase {
manifestsTable.copy(
Collections.singletonMap(CoreOptions.SCAN_SNAPSHOT_ID.key(), "3"));
assertThrows(
- "Specified parameter scan.snapshot-id = 3 is not exist, you
can set it in range from 1 to 2",
SnapshotNotExistException.class,
- () -> read(manifestsTable));
+ () -> read(manifestsTable),
+ "Specified parameter scan.snapshot-id = 3 is not exist, you
can set it in range from 1 to 2");
}
private List<InternalRow> getExpectedResult(long snapshotId) {
diff --git a/paimon-core/src/test/java/org/apache/paimon/tag/TagTest.java
b/paimon-core/src/test/java/org/apache/paimon/tag/TagTest.java
index e877463fab..af7ef7ce7b 100644
--- a/paimon-core/src/test/java/org/apache/paimon/tag/TagTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/tag/TagTest.java
@@ -20,12 +20,13 @@ package org.apache.paimon.tag;
import org.apache.paimon.Snapshot;
-import org.junit.Assert;
import org.junit.Test;
import java.time.Duration;
import java.time.LocalDateTime;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
/** Test for {@link Tag}. */
public class TagTest {
@@ -54,7 +55,7 @@ public class TagTest {
@Test
public void testFromJson() {
Tag tag = Tag.fromJson(snapshot.toJson());
- Assert.assertEquals(
+ assertEquals(
"{\n"
+ " \"version\" : 3,\n"
+ " \"id\" : 0,\n"
@@ -80,7 +81,7 @@ public class TagTest {
Duration.ofSeconds(5),
LocalDateTime.of(1969, 1, 1, 0, 0, 0, 123456789));
String tagJson = tag.toJson();
- Assert.assertEquals(
+ assertEquals(
"{\n"
+ " \"version\" : 3,\n"
+ " \"id\" : 0,\n"
@@ -100,6 +101,6 @@ public class TagTest {
tagJson);
Tag newTag = Tag.fromJson(tagJson);
- Assert.assertEquals(tag, newTag);
+ assertEquals(tag, newTag);
}
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/utils/ConvertBinaryUtilTest.java
b/paimon-core/src/test/java/org/apache/paimon/utils/ConvertBinaryUtilTest.java
index 0a5efcfec6..191e2aa592 100644
---
a/paimon-core/src/test/java/org/apache/paimon/utils/ConvertBinaryUtilTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/utils/ConvertBinaryUtilTest.java
@@ -18,7 +18,6 @@
package org.apache.paimon.utils;
-import org.junit.Assert;
import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets;
@@ -26,6 +25,7 @@ import java.util.Random;
import static org.apache.paimon.utils.ConvertBinaryUtil.convertBytesToLong;
import static org.apache.paimon.utils.ConvertBinaryUtil.convertStringToLong;
+import static org.junit.jupiter.api.Assertions.assertEquals;
/** Test for {@link ConvertBinaryUtil}. */
public class ConvertBinaryUtilTest {
@@ -37,7 +37,7 @@ public class ConvertBinaryUtilTest {
Long convertStringValue = convertStringToLong(randomString);
Long convertBytesValue = convertBytesToLong(randomStringBytes);
- Assert.assertEquals(convertStringValue, convertBytesValue);
+ assertEquals(convertStringValue, convertBytesValue);
}
public static String generateRandomString() {
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/SyncDatabaseActionBaseTest.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/SyncDatabaseActionBaseTest.java
index 7d8d83ca2e..0e0843837c 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/SyncDatabaseActionBaseTest.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/SyncDatabaseActionBaseTest.java
@@ -26,7 +26,6 @@ import org.apache.paimon.fs.Path;
import org.apache.paimon.fs.local.LocalFileIO;
import org.apache.paimon.types.RowKind;
-import org.junit.Assert;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
@@ -37,6 +36,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
/** Tests for {@link SyncDatabaseActionBase}. */
public class SyncDatabaseActionBaseTest {
private static final String ANY_DB = "any_db";
@@ -93,11 +94,11 @@ public class SyncDatabaseActionBaseTest {
parser.setRawEvent(whiteAnyDbCdcRecord);
parsedRecords = parser.parseRecords();
- Assert.assertEquals(1, parsedRecords.size());
+ assertEquals(1, parsedRecords.size());
parser.setRawEvent(blackAnyDbCdcRecord);
parsedRecords = parser.parseRecords();
- Assert.assertEquals(0, parsedRecords.size());
+ assertEquals(0, parsedRecords.size());
}
@Test
@@ -111,20 +112,20 @@ public class SyncDatabaseActionBaseTest {
parser.setRawEvent(whiteAnyDbCdcRecord);
parsedRecords = parser.parseRecords();
- Assert.assertEquals(0, parsedRecords.size());
+ assertEquals(0, parsedRecords.size());
parser.setRawEvent(blackAnyDbCdcRecord);
parsedRecords = parser.parseRecords();
- Assert.assertEquals(0, parsedRecords.size());
+ assertEquals(0, parsedRecords.size());
// white db and white table
parser.setRawEvent(whiteCdcRecord);
parsedRecords = parser.parseRecords();
- Assert.assertEquals(1, parsedRecords.size());
+ assertEquals(1, parsedRecords.size());
parser.setRawEvent(blackAnyDbCdcRecord);
parsedRecords = parser.parseRecords();
- Assert.assertEquals(0, parsedRecords.size());
+ assertEquals(0, parsedRecords.size());
}
@Test
@@ -138,9 +139,9 @@ public class SyncDatabaseActionBaseTest {
List<CdcRecord> parsedRecords;
parser.setRawEvent(whiteDbBlackTblCdcRecord);
parsedRecords = parser.parseRecords();
- Assert.assertEquals(0, parsedRecords.size());
+ assertEquals(0, parsedRecords.size());
parser.setRawEvent(blackDbWhiteTblCdcRecord);
parsedRecords = parser.parseRecords();
- Assert.assertEquals(0, parsedRecords.size());
+ assertEquals(0, parsedRecords.size());
}
}
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/TableNameConverterTest.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/TableNameConverterTest.java
index 89bbadfeb8..34c69ee5b5 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/TableNameConverterTest.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/TableNameConverterTest.java
@@ -18,12 +18,13 @@
package org.apache.paimon.flink.action.cdc;
-import org.junit.Assert;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
/** Tests for {@link TableNameConverter}. */
public class TableNameConverterTest {
@@ -33,14 +34,14 @@ public class TableNameConverterTest {
tableMapping.put("mapped_src", "mapped_TGT");
TableNameConverter caseConverter =
new TableNameConverter(true, true, "pre_", "_pos",
tableMapping);
- Assert.assertEquals(caseConverter.convert("", "mapped_SRC"),
"mapped_TGT");
+ assertEquals(caseConverter.convert("", "mapped_SRC"), "mapped_TGT");
- Assert.assertEquals(caseConverter.convert("", "unmapped_src"),
"pre_unmapped_src_pos");
+ assertEquals(caseConverter.convert("", "unmapped_src"),
"pre_unmapped_src_pos");
TableNameConverter noCaseConverter =
new TableNameConverter(false, true, "pre_", "_pos",
tableMapping);
- Assert.assertEquals(noCaseConverter.convert("", "mapped_src"),
"mapped_tgt");
- Assert.assertEquals(noCaseConverter.convert("", "unmapped_src"),
"pre_unmapped_src_pos");
+ assertEquals(noCaseConverter.convert("", "mapped_src"), "mapped_tgt");
+ assertEquals(noCaseConverter.convert("", "unmapped_src"),
"pre_unmapped_src_pos");
}
@Test
@@ -59,20 +60,20 @@ public class TableNameConverterTest {
// Tables in the specified db should have the specified prefix and
suffix.
// db prefix + normal suffix
- Assert.assertEquals(
+ assertEquals(
"db_pref_table_name_suf",
tblNameConverter.convert("db_with_prefix", "table_name"));
// normal prefix + db suffix
- Assert.assertEquals(
+ assertEquals(
"pre_table_name_db_suff",
tblNameConverter.convert("db_with_suffix", "table_name"));
// db prefix + db suffix
- Assert.assertEquals(
+ assertEquals(
"db_pref_table_name_db_suff",
tblNameConverter.convert("db_with_prefix_suffix",
"table_name"));
// only normal prefix and suffix
- Assert.assertEquals(
+ assertEquals(
"pre_table_name_suf",
tblNameConverter.convert("db_without_prefix_suffix",
"table_name"));
}
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/format/aliyun/AliyunJsonRecordParserTest.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/format/aliyun/AliyunJsonRecordParserTest.java
index 6dea3ee547..167f871c73 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/format/aliyun/AliyunJsonRecordParserTest.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/format/aliyun/AliyunJsonRecordParserTest.java
@@ -34,7 +34,6 @@ import org.apache.paimon.utils.BinaryStringUtils;
import
org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.JsonNode;
import
org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
@@ -49,6 +48,10 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
/** Test for AliyunJsonRecordParser. */
public class AliyunJsonRecordParserTest extends KafkaActionITCaseBase {
@@ -106,22 +109,22 @@ public class AliyunJsonRecordParserTest extends
KafkaActionITCaseBase {
JsonNode rootNode = objMapper.readValue(json, JsonNode.class);
CdcSourceRecord cdcRecord = new CdcSourceRecord(rootNode);
Schema schema = parser.buildSchema(cdcRecord);
- Assert.assertEquals(schema.primaryKeys(), Arrays.asList("id"));
+ assertEquals(schema.primaryKeys(), Arrays.asList("id"));
List<RichCdcMultiplexRecord> records = parser.extractRecords();
- Assert.assertEquals(records.size(), 1);
+ assertEquals(records.size(), 1);
CdcRecord result = records.get(0).toRichCdcRecord().toCdcRecord();
- Assert.assertEquals(result.kind(), RowKind.INSERT);
+ assertEquals(result.kind(), RowKind.INSERT);
String dbName = parser.getDatabaseName();
- Assert.assertEquals(dbName, "bigdata_test");
+ assertEquals(dbName, "bigdata_test");
String tableName = parser.getTableName();
- Assert.assertEquals(tableName, "sync_test_table");
+ assertEquals(tableName, "sync_test_table");
MessageQueueCdcTimestampExtractor extractor = new
MessageQueueCdcTimestampExtractor();
- Assert.assertTrue(extractor.extractTimestamp(cdcRecord) > 0);
+ assertTrue(extractor.extractTimestamp(cdcRecord) > 0);
Map<String, String> data =
records.get(0).toRichCdcRecord().toCdcRecord().data();
String createTime = data.get("etl_create_time");
@@ -136,8 +139,8 @@ public class AliyunJsonRecordParserTest extends
KafkaActionITCaseBase {
BinaryStringUtils.toTimestamp(BinaryString.fromString(updateTime), 6)
.toString();
- Assert.assertTrue(createTime.matches(dateTimeRegex));
- Assert.assertTrue(updateTime.matches(dateTimeRegex));
+ assertTrue(createTime.matches(dateTimeRegex));
+ assertTrue(updateTime.matches(dateTimeRegex));
}
}
@@ -150,33 +153,33 @@ public class AliyunJsonRecordParserTest extends
KafkaActionITCaseBase {
JsonNode jsonNode = objMapper.readValue(json, JsonNode.class);
CdcSourceRecord cdcRecord = new CdcSourceRecord(jsonNode);
Schema schema = parser.buildSchema(cdcRecord);
- Assert.assertEquals(schema.primaryKeys(), Arrays.asList("id"));
+ assertEquals(schema.primaryKeys(), Arrays.asList("id"));
List<RichCdcMultiplexRecord> records = parser.extractRecords();
- Assert.assertEquals(records.size(), 1);
+ assertEquals(records.size(), 1);
CdcRecord result = records.get(0).toRichCdcRecord().toCdcRecord();
- Assert.assertEquals(result.kind(), RowKind.UPDATE_AFTER);
+ assertEquals(result.kind(), RowKind.UPDATE_AFTER);
String dbName = parser.getDatabaseName();
- Assert.assertEquals(dbName, "bigdata_test");
+ assertEquals(dbName, "bigdata_test");
String tableName = parser.getTableName();
- Assert.assertEquals(tableName, "sync_test_table");
+ assertEquals(tableName, "sync_test_table");
MessageQueueCdcTimestampExtractor extractor = new
MessageQueueCdcTimestampExtractor();
- Assert.assertTrue(extractor.extractTimestamp(cdcRecord) > 0);
+ assertTrue(extractor.extractTimestamp(cdcRecord) > 0);
Map<String, String> data =
records.get(0).toRichCdcRecord().toCdcRecord().data();
String createTime = data.get("etl_create_time");
String updateTime = data.get("etl_update_time");
- Assert.assertNotNull(createTime);
+ assertNotNull(createTime);
updateTime =
BinaryStringUtils.toTimestamp(BinaryString.fromString(updateTime), 6)
.toString();
- Assert.assertTrue(updateTime.matches(dateTimeRegex));
+ assertTrue(updateTime.matches(dateTimeRegex));
}
}
@@ -189,33 +192,33 @@ public class AliyunJsonRecordParserTest extends
KafkaActionITCaseBase {
JsonNode jsonNode = objMapper.readValue(json, JsonNode.class);
CdcSourceRecord cdcRecord = new CdcSourceRecord(jsonNode);
Schema schema = parser.buildSchema(cdcRecord);
- Assert.assertEquals(schema.primaryKeys(), Arrays.asList("id"));
+ assertEquals(schema.primaryKeys(), Arrays.asList("id"));
List<RichCdcMultiplexRecord> records = parser.extractRecords();
- Assert.assertEquals(records.size(), 1);
+ assertEquals(records.size(), 1);
CdcRecord result = records.get(0).toRichCdcRecord().toCdcRecord();
- Assert.assertEquals(result.kind(), RowKind.DELETE);
+ assertEquals(result.kind(), RowKind.DELETE);
String dbName = parser.getDatabaseName();
- Assert.assertEquals(dbName, "bigdata_test");
+ assertEquals(dbName, "bigdata_test");
String tableName = parser.getTableName();
- Assert.assertEquals(tableName, "sync_test_table");
+ assertEquals(tableName, "sync_test_table");
MessageQueueCdcTimestampExtractor extractor = new
MessageQueueCdcTimestampExtractor();
- Assert.assertTrue(extractor.extractTimestamp(cdcRecord) > 0);
+ assertTrue(extractor.extractTimestamp(cdcRecord) > 0);
Map<String, String> data =
records.get(0).toRichCdcRecord().toCdcRecord().data();
String createTime = data.get("etl_create_time");
String updateTime = data.get("etl_update_time");
- Assert.assertNotNull(createTime);
+ assertNotNull(createTime);
updateTime =
BinaryStringUtils.toTimestamp(BinaryString.fromString(updateTime), 6)
.toString();
- Assert.assertTrue(updateTime.matches(dateTimeRegex));
+ assertTrue(updateTime.matches(dateTimeRegex));
}
}
}
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 767400d475..53daeebc25 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
@@ -645,7 +645,7 @@ public class KafkaCanalSyncDatabaseActionITCase extends
KafkaActionITCaseBase {
}
@Test
- @Timeout(120)
+ @Timeout(240)
public void testExpressionNow() throws Exception {
final String topic = "expression-now";
createTestTopic(topic, 1, 1);
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBContainer.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBContainer.java
index 8fc6a6b16b..5bf4e2912b 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBContainer.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/action/cdc/mongodb/MongoDBContainer.java
@@ -37,7 +37,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
/** Container for testing MongoDB >= 5.0.3. */
public class MongoDBContainer extends
org.testcontainers.containers.MongoDBContainer {
@@ -63,7 +63,7 @@ public class MongoDBContainer extends
org.testcontainers.containers.MongoDBConta
final String setupFilePath = "mongodb/docker/setup.js";
final URL setupFile =
MongoDBContainer.class.getClassLoader().getResource(setupFilePath);
- assertNotNull("Cannot locate " + setupFilePath, setupFile);
+ assertNotNull(setupFile, "Cannot locate " + setupFilePath);
try {
String createUserCommand =
Files.readAllLines(Paths.get(setupFile.toURI())).stream()
@@ -162,7 +162,7 @@ public class MongoDBContainer extends
org.testcontainers.containers.MongoDBConta
final String dbName = databaseName != null ? databaseName :
fileNameIgnoreSuffix;
final String ddlFile = String.format("mongodb/%s/%s.js", content,
fileNameIgnoreSuffix);
final URL ddlTestFile =
MongoDBContainer.class.getClassLoader().getResource(ddlFile);
- assertNotNull("Cannot locate " + ddlFile, ddlTestFile);
+ assertNotNull(ddlTestFile, "Cannot locate " + ddlFile);
try {
String command0 = String.format("db = db.getSiblingDB('%s');\n",
dbName);
diff --git
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/sink/cdc/UpdatedDataFieldsProcessFunctionBaseTest.java
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/sink/cdc/UpdatedDataFieldsProcessFunctionBaseTest.java
index a042c79ad5..24d0a51453 100644
---
a/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/sink/cdc/UpdatedDataFieldsProcessFunctionBaseTest.java
+++
b/paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/sink/cdc/UpdatedDataFieldsProcessFunctionBaseTest.java
@@ -26,9 +26,10 @@ import org.apache.paimon.types.SmallIntType;
import org.apache.paimon.types.TimestampType;
import org.apache.paimon.types.VarCharType;
-import org.junit.Assert;
import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
/** IT cases for {@link UpdatedDataFieldsProcessFunctionBaseTest}. */
public class UpdatedDataFieldsProcessFunctionBaseTest {
@@ -42,14 +43,12 @@ public class UpdatedDataFieldsProcessFunctionBaseTest {
convertAction =
UpdatedDataFieldsProcessFunctionBase.canConvert(
oldVarchar, biggerLengthVarchar,
TypeMapping.defaultMapping());
- Assert.assertEquals(
- UpdatedDataFieldsProcessFunctionBase.ConvertAction.CONVERT,
convertAction);
+
assertEquals(UpdatedDataFieldsProcessFunctionBase.ConvertAction.CONVERT,
convertAction);
convertAction =
UpdatedDataFieldsProcessFunctionBase.canConvert(
oldVarchar, smallerLengthVarchar,
TypeMapping.defaultMapping());
- Assert.assertEquals(
- UpdatedDataFieldsProcessFunctionBase.ConvertAction.IGNORE,
convertAction);
+
assertEquals(UpdatedDataFieldsProcessFunctionBase.ConvertAction.IGNORE,
convertAction);
}
@Test
@@ -62,14 +61,12 @@ public class UpdatedDataFieldsProcessFunctionBaseTest {
convertAction =
UpdatedDataFieldsProcessFunctionBase.canConvert(
oldType, bigintType, TypeMapping.defaultMapping());
- Assert.assertEquals(
- UpdatedDataFieldsProcessFunctionBase.ConvertAction.CONVERT,
convertAction);
+
assertEquals(UpdatedDataFieldsProcessFunctionBase.ConvertAction.CONVERT,
convertAction);
convertAction =
UpdatedDataFieldsProcessFunctionBase.canConvert(
oldType, smallintType, TypeMapping.defaultMapping());
- Assert.assertEquals(
- UpdatedDataFieldsProcessFunctionBase.ConvertAction.IGNORE,
convertAction);
+
assertEquals(UpdatedDataFieldsProcessFunctionBase.ConvertAction.IGNORE,
convertAction);
}
@Test
@@ -82,14 +79,12 @@ public class UpdatedDataFieldsProcessFunctionBaseTest {
convertAction =
UpdatedDataFieldsProcessFunctionBase.canConvert(
oldType, biggerRangeType,
TypeMapping.defaultMapping());
- Assert.assertEquals(
- UpdatedDataFieldsProcessFunctionBase.ConvertAction.CONVERT,
convertAction);
+
assertEquals(UpdatedDataFieldsProcessFunctionBase.ConvertAction.CONVERT,
convertAction);
convertAction =
UpdatedDataFieldsProcessFunctionBase.canConvert(
oldType, smallerRangeType,
TypeMapping.defaultMapping());
- Assert.assertEquals(
- UpdatedDataFieldsProcessFunctionBase.ConvertAction.IGNORE,
convertAction);
+
assertEquals(UpdatedDataFieldsProcessFunctionBase.ConvertAction.IGNORE,
convertAction);
}
@Test
@@ -102,13 +97,11 @@ public class UpdatedDataFieldsProcessFunctionBaseTest {
convertAction =
UpdatedDataFieldsProcessFunctionBase.canConvert(
oldType, biggerLengthTimestamp,
TypeMapping.defaultMapping());
- Assert.assertEquals(
- UpdatedDataFieldsProcessFunctionBase.ConvertAction.CONVERT,
convertAction);
+
assertEquals(UpdatedDataFieldsProcessFunctionBase.ConvertAction.CONVERT,
convertAction);
convertAction =
UpdatedDataFieldsProcessFunctionBase.canConvert(
oldType, smallerLengthTimestamp,
TypeMapping.defaultMapping());
- Assert.assertEquals(
- UpdatedDataFieldsProcessFunctionBase.ConvertAction.IGNORE,
convertAction);
+
assertEquals(UpdatedDataFieldsProcessFunctionBase.ConvertAction.IGNORE,
convertAction);
}
}
diff --git
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/BranchActionITCase.java
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/BranchActionITCase.java
index 7f574cdec3..23ed04b4a6 100644
---
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/BranchActionITCase.java
+++
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/BranchActionITCase.java
@@ -30,7 +30,6 @@ import org.apache.paimon.utils.BranchManager;
import org.apache.paimon.utils.SnapshotManager;
import org.apache.paimon.utils.TagManager;
-import org.junit.Assert;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
@@ -40,6 +39,7 @@ import java.util.List;
import static org.apache.paimon.flink.util.ReadWriteTableTestUtil.init;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
/** IT cases for branch management actions. */
public class BranchActionITCase extends ActionITCaseBase {
@@ -320,7 +320,7 @@ public class BranchActionITCase extends ActionITCaseBase {
"+I[11, new.data_11]",
"+I[12, new.data_12]",
"+I[13, new.data_13]");
- Assert.assertEquals(expected, sortedActual);
+ assertEquals(expected, sortedActual);
// Fast-forward branch branch_name again
executeSQL(
@@ -332,7 +332,7 @@ public class BranchActionITCase extends ActionITCaseBase {
result = readTableData(table);
sortedActual = new ArrayList<>(result);
expected = Arrays.asList("+I[1, Hi]", "+I[2, Hello]");
- Assert.assertEquals(expected, sortedActual);
+ assertEquals(expected, sortedActual);
// Fast-forward branch branch_name_action again
createAction(
@@ -352,7 +352,7 @@ public class BranchActionITCase extends ActionITCaseBase {
result = readTableData(table);
sortedActual = new ArrayList<>(result);
expected = Arrays.asList("+I[1, Hi]", "+I[2, Hello]", "+I[3, Paimon]");
- Assert.assertEquals(expected, sortedActual);
+ assertEquals(expected, sortedActual);
}
protected List<String> readTableData(FileStoreTable table) throws
Exception {
diff --git
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/IteratorSourcesITCase.java
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/IteratorSourcesITCase.java
index 0c5d485af7..d8e4e3f137 100644
---
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/IteratorSourcesITCase.java
+++
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/IteratorSourcesITCase.java
@@ -32,7 +32,7 @@ import org.junit.Test;
import java.util.List;
import java.util.stream.Collectors;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
/**
* An integration test for the sources based on iterators.
diff --git
a/paimon-hive/paimon-hive-common/src/test/java/org/apache/paimon/hive/TestHiveMetastore.java
b/paimon-hive/paimon-hive-common/src/test/java/org/apache/paimon/hive/TestHiveMetastore.java
index 73bb0418cd..2f92fb37b8 100644
---
a/paimon-hive/paimon-hive-common/src/test/java/org/apache/paimon/hive/TestHiveMetastore.java
+++
b/paimon-hive/paimon-hive-common/src/test/java/org/apache/paimon/hive/TestHiveMetastore.java
@@ -32,7 +32,6 @@ import org.apache.thrift.server.TServer;
import org.apache.thrift.server.TThreadPoolServer;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TTransportFactory;
-import org.junit.Assert;
import java.io.File;
import java.io.IOException;
@@ -50,6 +49,7 @@ import java.util.concurrent.Executors;
import static java.nio.file.Files.createTempDirectory;
import static java.nio.file.attribute.PosixFilePermissions.asFileAttribute;
import static java.nio.file.attribute.PosixFilePermissions.fromString;
+import static org.junit.jupiter.api.Assertions.assertFalse;
/* This file is based on source code from the Iceberg Project
(http://iceberg.apache.org/), licensed by the Apache
* Software Foundation (ASF) under the Apache License, Version 2.0. See the
NOTICE file distributed with this work for
@@ -99,7 +99,7 @@ public class TestHiveMetastore {
String errMsg = "Failed to delete " +
localDirPath;
try {
if (!fs.delete(localDirPath,
true)) {
- Assert.assertFalse(errMsg,
fs.exists(localDirPath));
+
assertFalse(fs.exists(localDirPath), errMsg);
}
} catch (IOException e) {
throw new RuntimeException(errMsg,
e);
diff --git
a/paimon-hive/paimon-hive-connector-common/src/test/java/org/apache/paimon/iceberg/IcebergHiveMetadataCommitterITCaseBase.java
b/paimon-hive/paimon-hive-connector-common/src/test/java/org/apache/paimon/iceberg/IcebergHiveMetadataCommitterITCaseBase.java
index baadf9c3de..e783abba88 100644
---
a/paimon-hive/paimon-hive-connector-common/src/test/java/org/apache/paimon/iceberg/IcebergHiveMetadataCommitterITCaseBase.java
+++
b/paimon-hive/paimon-hive-connector-common/src/test/java/org/apache/paimon/iceberg/IcebergHiveMetadataCommitterITCaseBase.java
@@ -29,7 +29,6 @@ import
org.apache.flink.table.api.internal.TableEnvironmentImpl;
import org.apache.flink.types.Row;
import org.apache.flink.util.CloseableIterator;
import org.junit.After;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -40,6 +39,10 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
/** IT cases for {@link IcebergHiveMetadataCommitter}. */
@RunWith(PaimonEmbeddedHiveRunner.class)
public abstract class IcebergHiveMetadataCommitterITCaseBase {
@@ -88,7 +91,7 @@ public abstract class IcebergHiveMetadataCommitterITCaseBase {
+ "( 'type' = 'iceberg', 'catalog-type' = 'hive',
'uri' = '', 'warehouse' = '"
+ path
+ "', 'cache-enabled' = 'false' )");
- Assert.assertEquals(
+ assertEquals(
Arrays.asList(Row.of("pear", 2, 1), Row.of("dog", 2, 2)),
collect(
tEnv.executeSql(
@@ -98,7 +101,7 @@ public abstract class IcebergHiveMetadataCommitterITCaseBase
{
"INSERT INTO my_paimon.test_db.t VALUES "
+ "(1, 1, 'cherry'), (2, 2, 'elephant')")
.await();
- Assert.assertEquals(
+ assertEquals(
Arrays.asList(
Row.of(1, 1, "cherry"),
Row.of(1, 2, "pear"),
@@ -108,11 +111,11 @@ public abstract class
IcebergHiveMetadataCommitterITCaseBase {
// test drop partition
tEnv.executeSql("ALTER TABLE my_paimon.test_db.t DROP PARTITION (pt =
1)").await();
- Assert.assertEquals(
+ assertEquals(
Arrays.asList(Row.of(2, 1, "cat"), Row.of(2, 2, "elephant")),
collect(tEnv.executeSql("SELECT * FROM my_iceberg.test_db.t
ORDER BY pt, id")));
- Assert.assertTrue(
+ assertTrue(
hiveShell
.executeQuery("DESC DATABASE EXTENDED test_db")
.toString()
@@ -131,7 +134,7 @@ public abstract class
IcebergHiveMetadataCommitterITCaseBase {
+ "(1, 1, 'apple'), (1, 2, 'pear'), (2, 1,
'cat'), (2, 2, 'dog')")
.await();
- Assert.assertEquals(
+ assertEquals(
Arrays.asList(Row.of("pear", 2, 1), Row.of("dog", 2, 2)),
collect(
tEnv.executeSql(
@@ -141,7 +144,7 @@ public abstract class
IcebergHiveMetadataCommitterITCaseBase {
"INSERT INTO my_paimon.test_db.t1 VALUES "
+ "(1, 1, 'cherry'), (2, 2, 'elephant')")
.await();
- Assert.assertEquals(
+ assertEquals(
Arrays.asList(
Row.of(1, 1, "cherry"),
Row.of(1, 2, "pear"),
@@ -151,7 +154,7 @@ public abstract class
IcebergHiveMetadataCommitterITCaseBase {
tEnv.executeSql(
"SELECT * FROM
my_iceberg.test_db_iceberg.t1_iceberg ORDER BY pt, id")));
- Assert.assertTrue(
+ assertTrue(
hiveShell
.executeQuery("DESC DATABASE EXTENDED test_db_iceberg")
.toString()
@@ -182,7 +185,7 @@ public abstract class
IcebergHiveMetadataCommitterITCaseBase {
+ "( 'type' = 'iceberg', 'catalog-type' = 'hive',
'uri' = '', 'warehouse' = '"
+ path
+ "', 'cache-enabled' = 'false' )");
- Assert.assertEquals(
+ assertEquals(
Arrays.asList(Row.of("pear", 2, 1), Row.of("dog", 2, 2)),
collect(
tEnv.executeSql(
@@ -192,7 +195,7 @@ public abstract class
IcebergHiveMetadataCommitterITCaseBase {
"INSERT INTO my_paimon.test_db.t VALUES "
+ "(1, 3, 'cherry'), (2, 3, 'elephant')")
.await();
- Assert.assertEquals(
+ assertEquals(
Arrays.asList(
Row.of("pear", 2, 1),
Row.of("cherry", 3, 1),
@@ -204,7 +207,7 @@ public abstract class
IcebergHiveMetadataCommitterITCaseBase {
// test drop partition
tEnv.executeSql("ALTER TABLE my_paimon.test_db.t DROP PARTITION (pt =
2)").await();
- Assert.assertEquals(
+ assertEquals(
Arrays.asList(Row.of("pear", 2, 1), Row.of("cherry", 3, 1)),
collect(
tEnv.executeSql(
@@ -220,7 +223,7 @@ public abstract class
IcebergHiveMetadataCommitterITCaseBase {
+ "(1, 1, 'apple'), (1, 2, 'pear'), (2, 1,
'cat'), (2, 2, 'dog')")
.await();
- Assert.assertEquals(
+ assertEquals(
Arrays.asList(Row.of("pear", 2, 1), Row.of("dog", 2, 2)),
collect(
tEnv.executeSql(
@@ -230,7 +233,7 @@ public abstract class
IcebergHiveMetadataCommitterITCaseBase {
"INSERT INTO my_paimon.test_db.t1 VALUES "
+ "(1, 3, 'cherry'), (2, 3, 'elephant')")
.await();
- Assert.assertEquals(
+ assertEquals(
Arrays.asList(
Row.of("pear", 2, 1),
Row.of("cherry", 3, 1),
@@ -260,7 +263,7 @@ public abstract class
IcebergHiveMetadataCommitterITCaseBase {
+ "'file.format' = 'avro', "
+ "'metadata.iceberg.hive-client-class' =
'%s')",
createFailHiveMetaStoreClient()));
- Assert.assertThrows(
+ assertThrows(
Exception.class,
() ->
tEnv.executeSql(