You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by et...@apache.org on 2025/06/03 05:46:02 UTC

(iceberg) branch main updated: Build, Core: Move assertions to AssertJ / Fix checkstyle rules (#13213)

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 1d8b91a345 Build, Core: Move assertions to AssertJ / Fix checkstyle rules (#13213)
1d8b91a345 is described below

commit 1d8b91a345175ab09a69cf0ea8d74c6cb297ee87
Author: Prashant Singh <35...@users.noreply.github.com>
AuthorDate: Mon Jun 2 22:45:57 2025 -0700

    Build, Core: Move assertions to AssertJ / Fix checkstyle rules (#13213)
---
 .baseline/checkstyle/checkstyle.xml                        |  4 ++--
 .../test/java/org/apache/iceberg/rest/TestRESTCatalog.java | 14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/.baseline/checkstyle/checkstyle.xml b/.baseline/checkstyle/checkstyle.xml
index 8410a90345..4dfa737774 100644
--- a/.baseline/checkstyle/checkstyle.xml
+++ b/.baseline/checkstyle/checkstyle.xml
@@ -441,7 +441,7 @@
         </module>
         <module name="IllegalImport">
             <property name="id" value="BanJUnit5AssumptionsUsage"/>
-            <property name="illegalPkgs" value="org.junit.jupiter.api.Assumptions"/>
+            <property name="illegalClasses" value="org.junit.jupiter.api.Assumptions"/>
             <message key="import.illegal" value="Prefer using Assertions.assumeThat(...).isTrue() instead."/>
         </module>
         <module name="IllegalImport">
@@ -451,7 +451,7 @@
         </module>
         <module name="IllegalImport">
             <property name="id" value="BanJUnit5Assertions"/>
-            <property name="illegalPkgs" value="org.junit.jupiter.api.Assertions"/>
+            <property name="illegalClasses" value="org.junit.jupiter.api.Assertions"/>
             <message key="import.illegal" value="Prefer using org.assertj.core.api.Assertions instead."/>
         </module>
         <module name="IllegalImport">
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 df199959c5..a3b1892424 100644
--- a/core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java
+++ b/core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java
@@ -95,7 +95,6 @@ import org.eclipse.jetty.server.handler.gzip.GzipHandler;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
 import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.io.TempDir;
@@ -2655,19 +2654,20 @@ public class TestRESTCatalog extends CatalogTests<RESTCatalog> {
   @Test
   public void testErrorHandlingForConflicts() {
     Consumer<ErrorResponse> errorResponseConsumer = ErrorHandlers.tableCommitHandler();
+
     // server returning 409 with client without retrying
     ErrorResponse errorResponse409WithoutRetries =
         ErrorResponse.builder().responseCode(409).wasRetried(false).build();
-    Assertions.assertThrows(
-        CommitFailedException.class,
-        () -> errorResponseConsumer.accept(errorResponse409WithoutRetries));
+    assertThatThrownBy(() -> errorResponseConsumer.accept(errorResponse409WithoutRetries))
+        .hasMessageContaining("Commit failed")
+        .isInstanceOf(CommitFailedException.class);
 
     // server returning 409, with retries.
     ErrorResponse errorResponse409WithRetries =
         ErrorResponse.builder().responseCode(409).wasRetried(true).build();
-    Assertions.assertThrows(
-        CommitStateUnknownException.class,
-        () -> errorResponseConsumer.accept(errorResponse409WithRetries));
+    assertThatThrownBy(() -> errorResponseConsumer.accept(errorResponse409WithRetries))
+        .hasMessageContaining("Commit status unknown")
+        .isInstanceOf(CommitStateUnknownException.class);
   }
 
   private void verifyTableExistsFallbackToGETRequest(ConfigResponse configResponse) {