This is an automated email from the ASF dual-hosted git repository.
etudenhoefner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/main by this push:
new 5f3809c515 Core, Flink, Spark: Import the right assertThatThrownBy
method from AssertJ (#10512)
5f3809c515 is described below
commit 5f3809c5159694618e0619cffd563077f1b56c12
Author: Piotr Findeisen <[email protected]>
AuthorDate: Mon Jun 17 14:59:32 2024 +0200
Core, Flink, Spark: Import the right assertThatThrownBy method from AssertJ
(#10512)
---
.baseline/checkstyle/checkstyle.xml | 4 ++++
core/src/test/java/org/apache/iceberg/TestClientPoolImpl.java | 2 +-
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java | 2 +-
.../src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java | 2 +-
.../src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java | 2 +-
.../src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java | 2 +-
.../org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java | 2 +-
.../org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java | 2 +-
.../org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java | 2 +-
9 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/.baseline/checkstyle/checkstyle.xml
b/.baseline/checkstyle/checkstyle.xml
index 16b06c6bb1..8df46a5c68 100644
--- a/.baseline/checkstyle/checkstyle.xml
+++ b/.baseline/checkstyle/checkstyle.xml
@@ -88,6 +88,10 @@
<property name="format"
value="Preconditions\.checkArgument\([^;]+%d[^;]+\);"/>
<property name="message" value="Preconditions.checkArgument does not
support %d. use %s instead"/>
</module>
+ <module name="RegexpMultiline">
+ <property name="format"
value="^\s*import\s+static\s+(?!\Qorg.assertj.core.api.Assertions.\E).*\.assertThatThrownBy;"/>
+ <property name="message" value="assertThatThrownBy() should be
statically imported from org.assertj.core.api.Assertions"/>
+ </module>
<module name="SuppressionFilter"> <!-- baseline-gradle: README.md -->
<property name="file"
value="${config_loc}/checkstyle-suppressions.xml"/>
</module>
diff --git a/core/src/test/java/org/apache/iceberg/TestClientPoolImpl.java
b/core/src/test/java/org/apache/iceberg/TestClientPoolImpl.java
index 3a6666bac3..ba5d5af622 100644
--- a/core/src/test/java/org/apache/iceberg/TestClientPoolImpl.java
+++ b/core/src/test/java/org/apache/iceberg/TestClientPoolImpl.java
@@ -19,7 +19,7 @@
package org.apache.iceberg;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.junit.jupiter.api.Test;
diff --git a/core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java
b/core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java
index 95380424e7..34d088cb60 100644
--- a/core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java
+++ b/core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java
@@ -20,7 +20,7 @@ package org.apache.iceberg.rest;
import static org.apache.iceberg.types.Types.NestedField.required;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeastOnce;
diff --git
a/flink/v1.17/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
b/flink/v1.17/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
index eaa92e32c4..3aea32e4ec 100644
---
a/flink/v1.17/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
+++
b/flink/v1.17/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
@@ -19,7 +19,7 @@
package org.apache.iceberg.flink;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.Assumptions.assumeThat;
import java.util.Arrays;
diff --git
a/flink/v1.18/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
b/flink/v1.18/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
index eaa92e32c4..3aea32e4ec 100644
---
a/flink/v1.18/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
+++
b/flink/v1.18/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
@@ -19,7 +19,7 @@
package org.apache.iceberg.flink;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.Assumptions.assumeThat;
import java.util.Arrays;
diff --git
a/flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
b/flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
index f3af2c3cbe..e5b1d61b2f 100644
---
a/flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
+++
b/flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogTable.java
@@ -19,7 +19,7 @@
package org.apache.iceberg.flink;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.Assumptions.assumeThat;
import java.util.Arrays;
diff --git
a/spark/v3.3/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
b/spark/v3.3/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
index de94a7c8bf..e5ebd327db 100644
---
a/spark/v3.3/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
+++
b/spark/v3.3/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
@@ -19,7 +19,7 @@
package org.apache.iceberg.spark.source;
import static org.apache.iceberg.expressions.Expressions.ref;
-import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.io.File;
import java.io.IOException;
diff --git
a/spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
b/spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
index 47e9333601..190a189f88 100644
---
a/spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
+++
b/spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
@@ -19,7 +19,7 @@
package org.apache.iceberg.spark.source;
import static org.apache.iceberg.expressions.Expressions.ref;
-import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.io.File;
import java.io.IOException;
diff --git
a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
index 5a8d4deec7..86d65ba0e5 100644
---
a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
+++
b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java
@@ -20,7 +20,7 @@ package org.apache.iceberg.spark.source;
import static org.apache.iceberg.expressions.Expressions.ref;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.io.File;
import java.io.IOException;