You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2022/11/02 07:09:54 UTC
[flink] 04/05: [hotfix] Remove deprecated Assertj API usages
This is an automated email from the ASF dual-hosted git repository.
chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 2df4f53a44abe80b246161b71dce2bbf997b0289
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Tue Nov 1 15:27:53 2022 +0100
[hotfix] Remove deprecated Assertj API usages
---
.../apache/flink/client/program/rest/RestClusterClientTest.java | 4 ++--
.../base/sink/throwable/FatalExceptionClassifierTest.java | 4 ++--
.../java/org/apache/flink/connectors/hive/HiveDialectITCase.java | 2 +-
.../org/apache/flink/table/codesplit/JavaCodeSplitterTest.java | 8 ++++----
.../java/org/apache/flink/table/utils/TypeMappingUtilsTest.java | 2 +-
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/flink-clients/src/test/java/org/apache/flink/client/program/rest/RestClusterClientTest.java b/flink-clients/src/test/java/org/apache/flink/client/program/rest/RestClusterClientTest.java
index 9daa4e48f82..6c091ebf9a7 100644
--- a/flink-clients/src/test/java/org/apache/flink/client/program/rest/RestClusterClientTest.java
+++ b/flink-clients/src/test/java/org/apache/flink/client/program/rest/RestClusterClientTest.java
@@ -809,8 +809,8 @@ class RestClusterClientTest {
createRestClusterClient(serverAddress.getPort(), clientConfig)) {
assertThatThrownBy(() -> restClusterClient.submitJob(jobGraph).get())
.isInstanceOf(ExecutionException.class)
- .getCause()
- .getCause()
+ .cause()
+ .cause()
.isInstanceOf(FutureUtils.RetryException.class);
assertThat(failedRequest).hasValue(maxRetryAttempts + 1);
diff --git a/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/sink/throwable/FatalExceptionClassifierTest.java b/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/sink/throwable/FatalExceptionClassifierTest.java
index 60a856882c8..8e4350c8f64 100644
--- a/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/sink/throwable/FatalExceptionClassifierTest.java
+++ b/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/sink/throwable/FatalExceptionClassifierTest.java
@@ -101,7 +101,7 @@ public class FatalExceptionClassifierTest {
assertThat(caughtException.get())
.isInstanceOf(RuntimeException.class)
.hasMessage("Buffer manipulation calculations resulted in a reference exception")
- .getCause()
+ .cause()
.isInstanceOf(NullPointerException.class)
.hasMessage("Base NullPointerException");
}
@@ -131,7 +131,7 @@ public class FatalExceptionClassifierTest {
assertThat(caughtException)
.isInstanceOf(RuntimeException.class)
.hasMessage("Buffer manipulation calculations resulted in a calculation exception")
- .getCause()
+ .cause()
.isInstanceOf(ArithmeticException.class)
.hasMessage("Base arithmetic exception");
}
diff --git a/flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveDialectITCase.java b/flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveDialectITCase.java
index 32548dd731a..f88d4346fcc 100644
--- a/flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveDialectITCase.java
+++ b/flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveDialectITCase.java
@@ -1287,7 +1287,7 @@ public class HiveDialectITCase {
private void verifyUnsupportedOperation(String ddl) {
assertThatThrownBy(() -> tableEnv.executeSql(ddl))
.isInstanceOf(ValidationException.class)
- .getCause()
+ .cause()
.isInstanceOf(UnsupportedOperationException.class);
}
diff --git a/flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java b/flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java
index 4a8742ab119..0072c51f0a7 100644
--- a/flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java
+++ b/flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java
@@ -59,14 +59,14 @@ class JavaCodeSplitterTest {
@Test
public void testNullCode() {
assertThatThrownBy(() -> JavaCodeSplitter.split(null, 4000, 10000))
- .getCause()
+ .cause()
.hasMessage("code cannot be empty");
}
@Test
public void testEmptyCode() {
assertThatThrownBy(() -> JavaCodeSplitter.split("", 4000, 10000))
- .getCause()
+ .cause()
.hasMessage("code cannot be empty");
}
@@ -76,7 +76,7 @@ class JavaCodeSplitterTest {
() ->
JavaCodeSplitter.split(
"public interface DummyInterface {}", 0, 10000))
- .getCause()
+ .cause()
.hasMessage("maxMethodLength must be greater than 0");
}
@@ -84,7 +84,7 @@ class JavaCodeSplitterTest {
public void testWrongMaxClassMemberCount() {
assertThatThrownBy(
() -> JavaCodeSplitter.split("public interface DummyInterface {}", 10, 0))
- .getCause()
+ .cause()
.hasMessage("maxClassMemberCount must be greater than 0");
}
diff --git a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/utils/TypeMappingUtilsTest.java b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/utils/TypeMappingUtilsTest.java
index e6ac3e1bd25..c4a28ccb36b 100644
--- a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/utils/TypeMappingUtilsTest.java
+++ b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/utils/TypeMappingUtilsTest.java
@@ -160,7 +160,7 @@ class TypeMappingUtilsTest {
"Type DECIMAL(38, 10) of table field 'f0' does not match with the "
+ "physical type LEGACY('DECIMAL', 'DECIMAL') of the "
+ "'f0' field of the TableSource return type.")
- .getCause()
+ .cause()
.isInstanceOf(ValidationException.class)
.hasMessage("Legacy decimal type can only be mapped to DECIMAL(38, 18).");
}