You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2022/10/21 19:57:11 UTC

[iceberg] branch master updated: Core: Rename TableTestBase.Assertions to not conflict with AssertJ Assertions (#6022)

This is an automated email from the ASF dual-hosted git repository.

blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/master by this push:
     new fa5da72b20 Core: Rename TableTestBase.Assertions to not conflict with AssertJ Assertions (#6022)
fa5da72b20 is described below

commit fa5da72b20e0db137ce582b76bd7670e19645a02
Author: Eduard Tudenhöfner <et...@gmail.com>
AuthorDate: Fri Oct 21 21:57:04 2022 +0200

    Core: Rename TableTestBase.Assertions to not conflict with AssertJ Assertions (#6022)
---
 core/src/test/java/org/apache/iceberg/TableTestBase.java     | 12 ++++++------
 .../test/java/org/apache/iceberg/TestSortOrderParser.java    |  7 +++----
 core/src/test/java/org/apache/iceberg/TestTransaction.java   |  3 ++-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/core/src/test/java/org/apache/iceberg/TableTestBase.java b/core/src/test/java/org/apache/iceberg/TableTestBase.java
index 65461b465e..5cc35279ad 100644
--- a/core/src/test/java/org/apache/iceberg/TableTestBase.java
+++ b/core/src/test/java/org/apache/iceberg/TableTestBase.java
@@ -172,15 +172,15 @@ public class TableTestBase {
   protected final int formatVersion;
 
   @SuppressWarnings("checkstyle:MemberName")
-  protected final Assertions V1Assert;
+  protected final TableAssertions V1Assert;
 
   @SuppressWarnings("checkstyle:MemberName")
-  protected final Assertions V2Assert;
+  protected final TableAssertions V2Assert;
 
   public TableTestBase(int formatVersion) {
     this.formatVersion = formatVersion;
-    this.V1Assert = new Assertions(1, formatVersion);
-    this.V2Assert = new Assertions(2, formatVersion);
+    this.V1Assert = new TableAssertions(1, formatVersion);
+    this.V2Assert = new TableAssertions(2, formatVersion);
   }
 
   @Before
@@ -676,10 +676,10 @@ public class TableTestBase {
   }
 
   /** Used for assertions that only apply if the table version is v2. */
-  protected static class Assertions {
+  protected static class TableAssertions {
     private boolean enabled;
 
-    private Assertions(int validForVersion, int formatVersion) {
+    private TableAssertions(int validForVersion, int formatVersion) {
       this.enabled = validForVersion == formatVersion;
     }
 
diff --git a/core/src/test/java/org/apache/iceberg/TestSortOrderParser.java b/core/src/test/java/org/apache/iceberg/TestSortOrderParser.java
index 2bd5b1e62b..5aba9e9ad5 100644
--- a/core/src/test/java/org/apache/iceberg/TestSortOrderParser.java
+++ b/core/src/test/java/org/apache/iceberg/TestSortOrderParser.java
@@ -22,6 +22,7 @@ import static org.apache.iceberg.NullOrder.NULLS_FIRST;
 import static org.apache.iceberg.SortDirection.DESC;
 
 import org.apache.iceberg.transforms.UnknownTransform;
+import org.assertj.core.api.Assertions;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -47,8 +48,7 @@ public class TestSortOrderParser extends TableTestBase {
 
     Assert.assertEquals(10, order.orderId());
     Assert.assertEquals(1, order.fields().size());
-    org.assertj.core.api.Assertions.assertThat(order.fields().get(0).transform())
-        .isInstanceOf(UnknownTransform.class);
+    Assertions.assertThat(order.fields().get(0).transform()).isInstanceOf(UnknownTransform.class);
     Assert.assertEquals("custom_transform", order.fields().get(0).transform().toString());
     Assert.assertEquals(2, order.fields().get(0).sourceId());
     Assert.assertEquals(DESC, order.fields().get(0).direction());
@@ -68,8 +68,7 @@ public class TestSortOrderParser extends TableTestBase {
             + "  } ]\n"
             + "}";
 
-    org.assertj.core.api.Assertions.assertThatThrownBy(
-            () -> SortOrderParser.fromJson(table.schema(), jsonString))
+    Assertions.assertThatThrownBy(() -> SortOrderParser.fromJson(table.schema(), jsonString))
         .isInstanceOf(IllegalArgumentException.class)
         .hasMessage("Invalid sort direction: invalid");
   }
diff --git a/core/src/test/java/org/apache/iceberg/TestTransaction.java b/core/src/test/java/org/apache/iceberg/TestTransaction.java
index 970a2310d7..f1c133633d 100644
--- a/core/src/test/java/org/apache/iceberg/TestTransaction.java
+++ b/core/src/test/java/org/apache/iceberg/TestTransaction.java
@@ -30,6 +30,7 @@ import org.apache.iceberg.io.OutputFile;
 import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
 import org.apache.iceberg.relocated.com.google.common.collect.Sets;
 import org.apache.iceberg.types.Types;
+import org.assertj.core.api.Assertions;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -140,7 +141,7 @@ public class TestTransaction extends TableTestBase {
         files(FILE_A, FILE_B),
         statuses(Status.ADDED, Status.ADDED));
 
-    org.assertj.core.api.Assertions.assertThat(table.history()).containsAll(initialHistory);
+    Assertions.assertThat(table.history()).containsAll(initialHistory);
   }
 
   @Test