This is an automated email from the ASF dual-hosted git repository. pvary 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 036dddd7a3 Build: Statically import Assumptions.assumeThat() (#13655) 036dddd7a3 is described below commit 036dddd7a390987fc3bd7061a7a668f13e16acda Author: Eduard Tudenhoefner <etudenhoef...@gmail.com> AuthorDate: Thu Jul 24 16:16:55 2025 +0200 Build: Statically import Assumptions.assumeThat() (#13655) --- .baseline/checkstyle/checkstyle.xml | 4 +++ .../aliyun/oss/mock/TestLocalAliyunOSS.java | 6 ++-- .../iceberg/aws/s3/TestS3FileIOIntegration.java | 14 ++++---- .../java/org/apache/iceberg/data/DataTestBase.java | 30 ++++++++-------- .../org/apache/iceberg/view/ViewCatalogTests.java | 41 ++++++--------------- .../flink/actions/TestRewriteDataFilesAction.java | 18 +++++----- .../flink/actions/TestRewriteDataFilesAction.java | 18 +++++----- .../flink/actions/TestRewriteDataFilesAction.java | 18 +++++----- .../apache/iceberg/parquet/TestVariantReaders.java | 6 ++-- .../iceberg/spark/data/AvroDataTestBase.java | 42 +++++++++++----------- .../iceberg/spark/data/AvroDataTestBase.java | 42 +++++++++++----------- .../iceberg/spark/data/AvroDataTestBase.java | 42 +++++++++++----------- 12 files changed, 127 insertions(+), 154 deletions(-) diff --git a/.baseline/checkstyle/checkstyle.xml b/.baseline/checkstyle/checkstyle.xml index 4ff8d93081..18fac62744 100644 --- a/.baseline/checkstyle/checkstyle.xml +++ b/.baseline/checkstyle/checkstyle.xml @@ -110,6 +110,10 @@ <property name="format" value="^\s*import\s+\Qorg.assertj.core.api.Assertions;\E" /> <property name="message" value="org.assertj.core.api.Assertions should only be used with static imports" /> </module> + <module name="RegexpMultiline"> + <property name="format" value="^\s*import\s+\Qorg.assertj.core.api.Assumptions;\E" /> + <property name="message" value="org.assertj.core.api.Assumptions should only be used with static imports" /> + </module> <module name="SuppressionFilter"> <!-- baseline-gradle: README.md --> <property name="file" value="${config_loc}/checkstyle-suppressions.xml"/> </module> diff --git a/aliyun/src/test/java/org/apache/iceberg/aliyun/oss/mock/TestLocalAliyunOSS.java b/aliyun/src/test/java/org/apache/iceberg/aliyun/oss/mock/TestLocalAliyunOSS.java index f51c4d0b8c..620e58cf78 100644 --- a/aliyun/src/test/java/org/apache/iceberg/aliyun/oss/mock/TestLocalAliyunOSS.java +++ b/aliyun/src/test/java/org/apache/iceberg/aliyun/oss/mock/TestLocalAliyunOSS.java @@ -20,6 +20,7 @@ package org.apache.iceberg.aliyun.oss.mock; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assumptions.assumeThat; import com.aliyun.oss.OSS; import com.aliyun.oss.OSSErrorCode; @@ -36,7 +37,6 @@ import java.util.UUID; import org.apache.iceberg.aliyun.TestUtility; import org.apache.iceberg.aliyun.oss.AliyunOSSExtension; import org.apache.iceberg.relocated.com.google.common.io.ByteStreams; -import org.assertj.core.api.Assumptions; import org.assertj.core.api.InstanceOfAssertFactories; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -73,7 +73,7 @@ public class TestLocalAliyunOSS { @Test public void testBuckets() { - Assumptions.assumeThat(OSS_TEST_EXTENSION.getClass()) + assumeThat(OSS_TEST_EXTENSION.getClass()) .as("Aliyun integration test cannot delete existing bucket from test environment.") .isEqualTo(AliyunOSSMockExtension.class); @@ -90,7 +90,7 @@ public class TestLocalAliyunOSS { @Test public void testDeleteBucket() { - Assumptions.assumeThat(OSS_TEST_EXTENSION.getClass()) + assumeThat(OSS_TEST_EXTENSION.getClass()) .as("Aliyun integration test cannot delete existing bucket from test environment.") .isEqualTo(AliyunOSSMockExtension.class); diff --git a/aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java b/aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java index 5fe410582c..249279054b 100644 --- a/aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java +++ b/aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java @@ -19,6 +19,7 @@ package org.apache.iceberg.aws.s3; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assumptions.assumeThat; import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -42,7 +43,6 @@ import org.apache.iceberg.io.OutputFile; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.relocated.com.google.common.collect.Maps; -import org.assertj.core.api.Assumptions; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -257,7 +257,7 @@ public class TestS3FileIOIntegration { @Test public void testNewInputStreamWithMultiRegionAccessPoint() throws Exception { - Assumptions.assumeThat(multiRegionAccessPointAlias).isNotEmpty(); + assumeThat(multiRegionAccessPointAlias).isNotEmpty(); clientFactory.initialize(ImmutableMap.of(S3FileIOProperties.USE_ARN_REGION_ENABLED, "true")); S3Client s3Client = clientFactory.s3(); s3Client.putObject( @@ -368,7 +368,7 @@ public class TestS3FileIOIntegration { @Test public void testNewOutputStreamWithMultiRegionAccessPoint() throws Exception { - Assumptions.assumeThat(multiRegionAccessPointAlias).isNotEmpty(); + assumeThat(multiRegionAccessPointAlias).isNotEmpty(); clientFactory.initialize(ImmutableMap.of(S3FileIOProperties.USE_ARN_REGION_ENABLED, "true")); S3FileIO s3FileIO = new S3FileIO(clientFactory::s3); s3FileIO.initialize( @@ -730,21 +730,21 @@ public class TestS3FileIOIntegration { /** S3 Express doesn't support access points */ private void requireAccessPointSupport() { - Assumptions.assumeThat(S3URI.isS3DirectoryBucket(bucketName)).isFalse(); + assumeThat(S3URI.isS3DirectoryBucket(bucketName)).isFalse(); } /** S3 Express doesn’t support KMS/custom encryption */ private void requireKMSEncryptionSupport() { - Assumptions.assumeThat(S3URI.isS3DirectoryBucket(bucketName)).isFalse(); + assumeThat(S3URI.isS3DirectoryBucket(bucketName)).isFalse(); } /** S3 Express doesn't support versioning */ private void requireVersioningSupport() { - Assumptions.assumeThat(S3URI.isS3DirectoryBucket(bucketName)).isFalse(); + assumeThat(S3URI.isS3DirectoryBucket(bucketName)).isFalse(); } /** File ACLs aren’t supported by S3 Express */ private void requireACLSupport() { - Assumptions.assumeThat(S3URI.isS3DirectoryBucket(bucketName)).isFalse(); + assumeThat(S3URI.isS3DirectoryBucket(bucketName)).isFalse(); } } diff --git a/core/src/test/java/org/apache/iceberg/data/DataTestBase.java b/core/src/test/java/org/apache/iceberg/data/DataTestBase.java index 6263715573..5a433fe0be 100644 --- a/core/src/test/java/org/apache/iceberg/data/DataTestBase.java +++ b/core/src/test/java/org/apache/iceberg/data/DataTestBase.java @@ -21,6 +21,7 @@ package org.apache.iceberg.data; import static org.apache.iceberg.types.Types.NestedField.optional; import static org.apache.iceberg.types.Types.NestedField.required; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assumptions.assumeThat; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -45,7 +46,6 @@ import org.apache.iceberg.types.Types.LongType; import org.apache.iceberg.types.Types.MapType; import org.apache.iceberg.types.Types.StructType; import org.apache.iceberg.util.DateTimeUtil; -import org.assertj.core.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; @@ -156,26 +156,26 @@ public abstract class DataTestBase { @ParameterizedTest @FieldSource("SIMPLE_TYPES") public void testTypeSchema(Type type) throws IOException { - Assumptions.assumeThat( + assumeThat( supportsUnknown() || TypeUtil.find(type, t -> t.typeId() == Type.TypeID.UNKNOWN) == null) .as("unknown is not yet implemented") .isTrue(); - Assumptions.assumeThat( + assumeThat( supportsTimestampNanos() || TypeUtil.find(type, t -> t.typeId() == Type.TypeID.TIMESTAMP_NANO) == null) .as("timestamp_ns is not yet implemented") .isTrue(); - Assumptions.assumeThat( + assumeThat( supportsVariant() || TypeUtil.find(type, t -> t.typeId() == Type.TypeID.VARIANT) == null) .as("variant is not yet implemented") .isTrue(); if (!supportsGeospatial()) { - Assumptions.assumeThat(TypeUtil.find(type, t -> t.typeId() == Type.TypeID.GEOMETRY) == null) + assumeThat(TypeUtil.find(type, t -> t.typeId() == Type.TypeID.GEOMETRY) == null) .as("geometry is not yet implemented") .isTrue(); - Assumptions.assumeThat(TypeUtil.find(type, t -> t.typeId() == Type.TypeID.GEOGRAPHY) == null) + assumeThat(TypeUtil.find(type, t -> t.typeId() == Type.TypeID.GEOGRAPHY) == null) .as("geography is not yet implemented") .isTrue(); } @@ -324,7 +324,7 @@ public abstract class DataTestBase { @Test public void testMissingRequiredWithoutDefault() { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema(required(1, "id", Types.LongType.get())); @@ -344,7 +344,7 @@ public abstract class DataTestBase { @Test public void testDefaultValues() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -380,7 +380,7 @@ public abstract class DataTestBase { @Test public void testNullDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -410,7 +410,7 @@ public abstract class DataTestBase { @Test public void testNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -453,7 +453,7 @@ public abstract class DataTestBase { @Test public void testMapNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -505,7 +505,7 @@ public abstract class DataTestBase { @Test public void testListNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -578,7 +578,7 @@ public abstract class DataTestBase { @MethodSource("primitiveTypesAndDefaults") public void testPrimitiveTypeDefaultValues(Type.PrimitiveType type, Literal<?> defaultValue) throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema(required(1, "id", Types.LongType.get())); @@ -616,9 +616,7 @@ public abstract class DataTestBase { @Test public void testRowLineage() throws Exception { - Assumptions.assumeThat(supportsRowLineage()) - .as("Row Lineage support is not implemented") - .isTrue(); + assumeThat(supportsRowLineage()).as("Row Lineage support is not implemented").isTrue(); Schema schema = new Schema( diff --git a/core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java b/core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java index 96afbe4878..e938c11b87 100644 --- a/core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java +++ b/core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java @@ -40,7 +40,6 @@ import org.apache.iceberg.exceptions.NoSuchNamespaceException; import org.apache.iceberg.exceptions.NoSuchViewException; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList; import org.apache.iceberg.types.Types; -import org.assertj.core.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; @@ -401,9 +400,7 @@ public abstract class ViewCatalogTests<C extends ViewCatalog & SupportsNamespace @Test public void createViewThatAlreadyExistsAsTable() { - Assumptions.assumeThat(tableCatalog()) - .as("Only valid for catalogs that support tables") - .isNotNull(); + assumeThat(tableCatalog()).as("Only valid for catalogs that support tables").isNotNull(); TableIdentifier tableIdentifier = TableIdentifier.of("ns", "table"); @@ -431,9 +428,7 @@ public abstract class ViewCatalogTests<C extends ViewCatalog & SupportsNamespace @Test public void createTableThatAlreadyExistsAsView() { - Assumptions.assumeThat(tableCatalog()) - .as("Only valid for catalogs that support tables") - .isNotNull(); + assumeThat(tableCatalog()).as("Only valid for catalogs that support tables").isNotNull(); TableIdentifier viewIdentifier = TableIdentifier.of("ns", "view"); @@ -459,9 +454,7 @@ public abstract class ViewCatalogTests<C extends ViewCatalog & SupportsNamespace @Test public void createTableViaTransactionThatAlreadyExistsAsView() { - Assumptions.assumeThat(tableCatalog()) - .as("Only valid for catalogs that support tables") - .isNotNull(); + assumeThat(tableCatalog()).as("Only valid for catalogs that support tables").isNotNull(); TableIdentifier viewIdentifier = TableIdentifier.of("ns", "view"); @@ -489,9 +482,7 @@ public abstract class ViewCatalogTests<C extends ViewCatalog & SupportsNamespace @Test public void replaceTableViaTransactionThatAlreadyExistsAsView() { - Assumptions.assumeThat(tableCatalog()) - .as("Only valid for catalogs that support tables") - .isNotNull(); + assumeThat(tableCatalog()).as("Only valid for catalogs that support tables").isNotNull(); TableIdentifier viewIdentifier = TableIdentifier.of("ns", "view"); @@ -522,9 +513,7 @@ public abstract class ViewCatalogTests<C extends ViewCatalog & SupportsNamespace @Test public void createOrReplaceTableViaTransactionThatAlreadyExistsAsView() { - Assumptions.assumeThat(tableCatalog()) - .as("Only valid for catalogs that support tables") - .isNotNull(); + assumeThat(tableCatalog()).as("Only valid for catalogs that support tables").isNotNull(); TableIdentifier viewIdentifier = TableIdentifier.of("ns", "view"); @@ -555,9 +544,7 @@ public abstract class ViewCatalogTests<C extends ViewCatalog & SupportsNamespace @Test public void replaceViewThatAlreadyExistsAsTable() { - Assumptions.assumeThat(tableCatalog()) - .as("Only valid for catalogs that support tables") - .isNotNull(); + assumeThat(tableCatalog()).as("Only valid for catalogs that support tables").isNotNull(); TableIdentifier tableIdentifier = TableIdentifier.of("ns", "table"); @@ -585,9 +572,7 @@ public abstract class ViewCatalogTests<C extends ViewCatalog & SupportsNamespace @Test public void createOrReplaceViewThatAlreadyExistsAsTable() { - Assumptions.assumeThat(tableCatalog()) - .as("Only valid for catalogs that support tables") - .isNotNull(); + assumeThat(tableCatalog()).as("Only valid for catalogs that support tables").isNotNull(); TableIdentifier tableIdentifier = TableIdentifier.of("ns", "table"); @@ -765,9 +750,7 @@ public abstract class ViewCatalogTests<C extends ViewCatalog & SupportsNamespace @Test public void renameViewTargetAlreadyExistsAsTable() { - Assumptions.assumeThat(tableCatalog()) - .as("Only valid for catalogs that support tables") - .isNotNull(); + assumeThat(tableCatalog()).as("Only valid for catalogs that support tables").isNotNull(); TableIdentifier viewIdentifier = TableIdentifier.of("ns", "view"); TableIdentifier tableIdentifier = TableIdentifier.of("ns", "table"); @@ -800,9 +783,7 @@ public abstract class ViewCatalogTests<C extends ViewCatalog & SupportsNamespace @Test public void renameTableTargetAlreadyExistsAsView() { - Assumptions.assumeThat(tableCatalog()) - .as("Only valid for catalogs that support tables") - .isNotNull(); + assumeThat(tableCatalog()).as("Only valid for catalogs that support tables").isNotNull(); TableIdentifier viewIdentifier = TableIdentifier.of("ns", "view"); TableIdentifier tableIdentifier = TableIdentifier.of("ns", "table"); @@ -928,9 +909,7 @@ public abstract class ViewCatalogTests<C extends ViewCatalog & SupportsNamespace @Test public void listViewsAndTables() { - Assumptions.assumeThat(tableCatalog()) - .as("Only valid for catalogs that support tables") - .isNotNull(); + assumeThat(tableCatalog()).as("Only valid for catalogs that support tables").isNotNull(); Namespace ns = Namespace.of("ns"); diff --git a/flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java b/flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java index 0117197802..131d3bcbb0 100644 --- a/flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java +++ b/flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java @@ -21,6 +21,7 @@ package org.apache.iceberg.flink.actions; import static org.apache.iceberg.flink.SimpleDataUtil.RECORD; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assumptions.assumeThat; import java.io.File; import java.io.IOException; @@ -65,7 +66,6 @@ import org.apache.iceberg.relocated.com.google.common.collect.Iterables; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.types.Types; import org.apache.iceberg.util.Pair; -import org.assertj.core.api.Assumptions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.TestTemplate; @@ -151,7 +151,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testFailureOnV3Table() { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isGreaterThanOrEqualTo(3); + assumeThat(formatVersion).isGreaterThanOrEqualTo(3); assertThatThrownBy( () -> Actions.forTable(icebergTableUnPartitioned).rewriteDataFiles().execute()) @@ -163,7 +163,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesEmptyTable() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); assertThat(icebergTableUnPartitioned.currentSnapshot()).isNull(); Actions.forTable(icebergTableUnPartitioned).rewriteDataFiles().execute(); @@ -173,7 +173,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesUnpartitionedTable() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); sql("INSERT INTO %s SELECT 1, 'hello'", TABLE_NAME_UNPARTITIONED); sql("INSERT INTO %s SELECT 2, 'world'", TABLE_NAME_UNPARTITIONED); @@ -206,7 +206,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesPartitionedTable() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); sql("INSERT INTO %s SELECT 1, 'hello' ,'a'", TABLE_NAME_PARTITIONED); sql("INSERT INTO %s SELECT 2, 'hello' ,'a'", TABLE_NAME_PARTITIONED); @@ -251,7 +251,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesWithFilter() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); sql("INSERT INTO %s SELECT 1, 'hello' ,'a'", TABLE_NAME_PARTITIONED); sql("INSERT INTO %s SELECT 2, 'hello' ,'a'", TABLE_NAME_PARTITIONED); @@ -301,7 +301,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteLargeTableHasResiduals() throws IOException { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); // all records belong to the same partition List<String> records1 = Lists.newArrayList(); @@ -366,7 +366,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteAvoidRepeateCompress() throws IOException { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); List<Record> expected = Lists.newArrayList(); Schema schema = icebergTableUnPartitioned.schema(); @@ -433,7 +433,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteNoConflictWithEqualityDeletes() throws IOException { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); // Add 2 data files sql("INSERT INTO %s SELECT 1, 'hello'", TABLE_NAME_WITH_PK); diff --git a/flink/v1.20/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java b/flink/v1.20/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java index 0117197802..131d3bcbb0 100644 --- a/flink/v1.20/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java +++ b/flink/v1.20/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java @@ -21,6 +21,7 @@ package org.apache.iceberg.flink.actions; import static org.apache.iceberg.flink.SimpleDataUtil.RECORD; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assumptions.assumeThat; import java.io.File; import java.io.IOException; @@ -65,7 +66,6 @@ import org.apache.iceberg.relocated.com.google.common.collect.Iterables; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.types.Types; import org.apache.iceberg.util.Pair; -import org.assertj.core.api.Assumptions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.TestTemplate; @@ -151,7 +151,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testFailureOnV3Table() { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isGreaterThanOrEqualTo(3); + assumeThat(formatVersion).isGreaterThanOrEqualTo(3); assertThatThrownBy( () -> Actions.forTable(icebergTableUnPartitioned).rewriteDataFiles().execute()) @@ -163,7 +163,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesEmptyTable() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); assertThat(icebergTableUnPartitioned.currentSnapshot()).isNull(); Actions.forTable(icebergTableUnPartitioned).rewriteDataFiles().execute(); @@ -173,7 +173,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesUnpartitionedTable() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); sql("INSERT INTO %s SELECT 1, 'hello'", TABLE_NAME_UNPARTITIONED); sql("INSERT INTO %s SELECT 2, 'world'", TABLE_NAME_UNPARTITIONED); @@ -206,7 +206,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesPartitionedTable() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); sql("INSERT INTO %s SELECT 1, 'hello' ,'a'", TABLE_NAME_PARTITIONED); sql("INSERT INTO %s SELECT 2, 'hello' ,'a'", TABLE_NAME_PARTITIONED); @@ -251,7 +251,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesWithFilter() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); sql("INSERT INTO %s SELECT 1, 'hello' ,'a'", TABLE_NAME_PARTITIONED); sql("INSERT INTO %s SELECT 2, 'hello' ,'a'", TABLE_NAME_PARTITIONED); @@ -301,7 +301,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteLargeTableHasResiduals() throws IOException { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); // all records belong to the same partition List<String> records1 = Lists.newArrayList(); @@ -366,7 +366,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteAvoidRepeateCompress() throws IOException { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); List<Record> expected = Lists.newArrayList(); Schema schema = icebergTableUnPartitioned.schema(); @@ -433,7 +433,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteNoConflictWithEqualityDeletes() throws IOException { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); // Add 2 data files sql("INSERT INTO %s SELECT 1, 'hello'", TABLE_NAME_WITH_PK); diff --git a/flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java b/flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java index 0117197802..131d3bcbb0 100644 --- a/flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java +++ b/flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java @@ -21,6 +21,7 @@ package org.apache.iceberg.flink.actions; import static org.apache.iceberg.flink.SimpleDataUtil.RECORD; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assumptions.assumeThat; import java.io.File; import java.io.IOException; @@ -65,7 +66,6 @@ import org.apache.iceberg.relocated.com.google.common.collect.Iterables; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.types.Types; import org.apache.iceberg.util.Pair; -import org.assertj.core.api.Assumptions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.TestTemplate; @@ -151,7 +151,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testFailureOnV3Table() { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isGreaterThanOrEqualTo(3); + assumeThat(formatVersion).isGreaterThanOrEqualTo(3); assertThatThrownBy( () -> Actions.forTable(icebergTableUnPartitioned).rewriteDataFiles().execute()) @@ -163,7 +163,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesEmptyTable() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); assertThat(icebergTableUnPartitioned.currentSnapshot()).isNull(); Actions.forTable(icebergTableUnPartitioned).rewriteDataFiles().execute(); @@ -173,7 +173,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesUnpartitionedTable() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); sql("INSERT INTO %s SELECT 1, 'hello'", TABLE_NAME_UNPARTITIONED); sql("INSERT INTO %s SELECT 2, 'world'", TABLE_NAME_UNPARTITIONED); @@ -206,7 +206,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesPartitionedTable() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); sql("INSERT INTO %s SELECT 1, 'hello' ,'a'", TABLE_NAME_PARTITIONED); sql("INSERT INTO %s SELECT 2, 'hello' ,'a'", TABLE_NAME_PARTITIONED); @@ -251,7 +251,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteDataFilesWithFilter() throws Exception { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); sql("INSERT INTO %s SELECT 1, 'hello' ,'a'", TABLE_NAME_PARTITIONED); sql("INSERT INTO %s SELECT 2, 'hello' ,'a'", TABLE_NAME_PARTITIONED); @@ -301,7 +301,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteLargeTableHasResiduals() throws IOException { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); // all records belong to the same partition List<String> records1 = Lists.newArrayList(); @@ -366,7 +366,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteAvoidRepeateCompress() throws IOException { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); List<Record> expected = Lists.newArrayList(); Schema schema = icebergTableUnPartitioned.schema(); @@ -433,7 +433,7 @@ public class TestRewriteDataFilesAction extends CatalogTestBase { @TestTemplate public void testRewriteNoConflictWithEqualityDeletes() throws IOException { // Flink does not support compaction on row lineage enabled tables (V3+) - Assumptions.assumeThat(formatVersion).isLessThan(3); + assumeThat(formatVersion).isLessThan(3); // Add 2 data files sql("INSERT INTO %s SELECT 1, 'hello'", TABLE_NAME_WITH_PK); diff --git a/parquet/src/test/java/org/apache/iceberg/parquet/TestVariantReaders.java b/parquet/src/test/java/org/apache/iceberg/parquet/TestVariantReaders.java index 23c6e9b328..ed2a8b61be 100644 --- a/parquet/src/test/java/org/apache/iceberg/parquet/TestVariantReaders.java +++ b/parquet/src/test/java/org/apache/iceberg/parquet/TestVariantReaders.java @@ -20,6 +20,7 @@ package org.apache.iceberg.parquet; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assumptions.assumeThat; import java.io.IOException; import java.math.BigDecimal; @@ -69,7 +70,6 @@ import org.apache.parquet.schema.MessageType; import org.apache.parquet.schema.PrimitiveType.PrimitiveTypeName; import org.apache.parquet.schema.Type; import org.apache.parquet.schema.Types; -import org.assertj.core.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -198,9 +198,7 @@ public class TestVariantReaders { @ParameterizedTest @FieldSource("PRIMITIVES") public void testShreddedVariantPrimitives(VariantPrimitive<?> primitive) throws IOException { - Assumptions.assumeThat(primitive.type() != PhysicalType.NULL) - .as("Null is not a shredded type") - .isTrue(); + assumeThat(primitive.type()).as("Null is not a shredded type").isNotEqualTo(PhysicalType.NULL); GroupType variantType = variant("var", 2, shreddedType(primitive)); MessageType parquetSchema = parquetSchema(variantType); diff --git a/spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java b/spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java index ae0af33612..0db6a65fd3 100644 --- a/spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java +++ b/spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java @@ -21,6 +21,7 @@ package org.apache.iceberg.spark.data; import static org.apache.iceberg.types.Types.NestedField.optional; import static org.apache.iceberg.types.Types.NestedField.required; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assumptions.assumeThat; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -46,7 +47,6 @@ import org.apache.iceberg.types.Types.LongType; import org.apache.iceberg.types.Types.MapType; import org.apache.iceberg.types.Types.StructType; import org.apache.iceberg.util.DateTimeUtil; -import org.assertj.core.api.Assumptions; import org.assertj.core.api.Condition; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -136,7 +136,7 @@ public abstract class AvroDataTestBase { @Test public void testNestedStruct() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); writeAndValidate( TypeUtil.assignIncreasingFreshIds(new Schema(required(1, "struct", SUPPORTED_PRIMITIVES)))); @@ -144,7 +144,7 @@ public abstract class AvroDataTestBase { @Test public void testArray() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -156,7 +156,7 @@ public abstract class AvroDataTestBase { @Test public void testArrayOfStructs() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = TypeUtil.assignIncreasingFreshIds( @@ -169,7 +169,7 @@ public abstract class AvroDataTestBase { @Test public void testMap() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -184,7 +184,7 @@ public abstract class AvroDataTestBase { @Test public void testNumericMapKey() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -197,7 +197,7 @@ public abstract class AvroDataTestBase { @Test public void testComplexMapKey() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -218,7 +218,7 @@ public abstract class AvroDataTestBase { @Test public void testMapOfStructs() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = TypeUtil.assignIncreasingFreshIds( @@ -234,7 +234,7 @@ public abstract class AvroDataTestBase { @Test public void testMixedTypes() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); StructType structType = StructType.of( @@ -293,7 +293,7 @@ public abstract class AvroDataTestBase { @Test public void testMissingRequiredWithoutDefault() { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema(required(1, "id", Types.LongType.get())); @@ -318,7 +318,7 @@ public abstract class AvroDataTestBase { @Test public void testDefaultValues() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -354,7 +354,7 @@ public abstract class AvroDataTestBase { @Test public void testNullDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -384,8 +384,8 @@ public abstract class AvroDataTestBase { @Test public void testNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema writeSchema = new Schema( @@ -428,8 +428,8 @@ public abstract class AvroDataTestBase { @Test public void testMapNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema writeSchema = new Schema( @@ -481,8 +481,8 @@ public abstract class AvroDataTestBase { @Test public void testListNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema writeSchema = new Schema( @@ -555,7 +555,7 @@ public abstract class AvroDataTestBase { @MethodSource("primitiveTypesAndDefaults") public void testPrimitiveTypeDefaultValues(Type.PrimitiveType type, Literal<?> defaultValue) throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema(required(1, "id", Types.LongType.get())); @@ -573,9 +573,7 @@ public abstract class AvroDataTestBase { @Test public void testRowLineage() throws Exception { - Assumptions.assumeThat(supportsRowLineage()) - .as("Row lineage support is not implemented") - .isTrue(); + assumeThat(supportsRowLineage()).as("Row lineage support is not implemented").isTrue(); Schema schema = new Schema( diff --git a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java index ae0af33612..0db6a65fd3 100644 --- a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java +++ b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java @@ -21,6 +21,7 @@ package org.apache.iceberg.spark.data; import static org.apache.iceberg.types.Types.NestedField.optional; import static org.apache.iceberg.types.Types.NestedField.required; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assumptions.assumeThat; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -46,7 +47,6 @@ import org.apache.iceberg.types.Types.LongType; import org.apache.iceberg.types.Types.MapType; import org.apache.iceberg.types.Types.StructType; import org.apache.iceberg.util.DateTimeUtil; -import org.assertj.core.api.Assumptions; import org.assertj.core.api.Condition; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -136,7 +136,7 @@ public abstract class AvroDataTestBase { @Test public void testNestedStruct() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); writeAndValidate( TypeUtil.assignIncreasingFreshIds(new Schema(required(1, "struct", SUPPORTED_PRIMITIVES)))); @@ -144,7 +144,7 @@ public abstract class AvroDataTestBase { @Test public void testArray() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -156,7 +156,7 @@ public abstract class AvroDataTestBase { @Test public void testArrayOfStructs() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = TypeUtil.assignIncreasingFreshIds( @@ -169,7 +169,7 @@ public abstract class AvroDataTestBase { @Test public void testMap() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -184,7 +184,7 @@ public abstract class AvroDataTestBase { @Test public void testNumericMapKey() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -197,7 +197,7 @@ public abstract class AvroDataTestBase { @Test public void testComplexMapKey() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -218,7 +218,7 @@ public abstract class AvroDataTestBase { @Test public void testMapOfStructs() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = TypeUtil.assignIncreasingFreshIds( @@ -234,7 +234,7 @@ public abstract class AvroDataTestBase { @Test public void testMixedTypes() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); StructType structType = StructType.of( @@ -293,7 +293,7 @@ public abstract class AvroDataTestBase { @Test public void testMissingRequiredWithoutDefault() { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema(required(1, "id", Types.LongType.get())); @@ -318,7 +318,7 @@ public abstract class AvroDataTestBase { @Test public void testDefaultValues() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -354,7 +354,7 @@ public abstract class AvroDataTestBase { @Test public void testNullDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -384,8 +384,8 @@ public abstract class AvroDataTestBase { @Test public void testNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema writeSchema = new Schema( @@ -428,8 +428,8 @@ public abstract class AvroDataTestBase { @Test public void testMapNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema writeSchema = new Schema( @@ -481,8 +481,8 @@ public abstract class AvroDataTestBase { @Test public void testListNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema writeSchema = new Schema( @@ -555,7 +555,7 @@ public abstract class AvroDataTestBase { @MethodSource("primitiveTypesAndDefaults") public void testPrimitiveTypeDefaultValues(Type.PrimitiveType type, Literal<?> defaultValue) throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema(required(1, "id", Types.LongType.get())); @@ -573,9 +573,7 @@ public abstract class AvroDataTestBase { @Test public void testRowLineage() throws Exception { - Assumptions.assumeThat(supportsRowLineage()) - .as("Row lineage support is not implemented") - .isTrue(); + assumeThat(supportsRowLineage()).as("Row lineage support is not implemented").isTrue(); Schema schema = new Schema( diff --git a/spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java b/spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java index ae0af33612..0db6a65fd3 100644 --- a/spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java +++ b/spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTestBase.java @@ -21,6 +21,7 @@ package org.apache.iceberg.spark.data; import static org.apache.iceberg.types.Types.NestedField.optional; import static org.apache.iceberg.types.Types.NestedField.required; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assumptions.assumeThat; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -46,7 +47,6 @@ import org.apache.iceberg.types.Types.LongType; import org.apache.iceberg.types.Types.MapType; import org.apache.iceberg.types.Types.StructType; import org.apache.iceberg.util.DateTimeUtil; -import org.assertj.core.api.Assumptions; import org.assertj.core.api.Condition; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -136,7 +136,7 @@ public abstract class AvroDataTestBase { @Test public void testNestedStruct() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); writeAndValidate( TypeUtil.assignIncreasingFreshIds(new Schema(required(1, "struct", SUPPORTED_PRIMITIVES)))); @@ -144,7 +144,7 @@ public abstract class AvroDataTestBase { @Test public void testArray() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -156,7 +156,7 @@ public abstract class AvroDataTestBase { @Test public void testArrayOfStructs() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = TypeUtil.assignIncreasingFreshIds( @@ -169,7 +169,7 @@ public abstract class AvroDataTestBase { @Test public void testMap() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -184,7 +184,7 @@ public abstract class AvroDataTestBase { @Test public void testNumericMapKey() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -197,7 +197,7 @@ public abstract class AvroDataTestBase { @Test public void testComplexMapKey() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = new Schema( @@ -218,7 +218,7 @@ public abstract class AvroDataTestBase { @Test public void testMapOfStructs() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema schema = TypeUtil.assignIncreasingFreshIds( @@ -234,7 +234,7 @@ public abstract class AvroDataTestBase { @Test public void testMixedTypes() throws IOException { - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); StructType structType = StructType.of( @@ -293,7 +293,7 @@ public abstract class AvroDataTestBase { @Test public void testMissingRequiredWithoutDefault() { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema(required(1, "id", Types.LongType.get())); @@ -318,7 +318,7 @@ public abstract class AvroDataTestBase { @Test public void testDefaultValues() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -354,7 +354,7 @@ public abstract class AvroDataTestBase { @Test public void testNullDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema( @@ -384,8 +384,8 @@ public abstract class AvroDataTestBase { @Test public void testNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema writeSchema = new Schema( @@ -428,8 +428,8 @@ public abstract class AvroDataTestBase { @Test public void testMapNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema writeSchema = new Schema( @@ -481,8 +481,8 @@ public abstract class AvroDataTestBase { @Test public void testListNestedDefaultValue() throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); - Assumptions.assumeThat(supportsNestedTypes()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsNestedTypes()).isTrue(); Schema writeSchema = new Schema( @@ -555,7 +555,7 @@ public abstract class AvroDataTestBase { @MethodSource("primitiveTypesAndDefaults") public void testPrimitiveTypeDefaultValues(Type.PrimitiveType type, Literal<?> defaultValue) throws IOException { - Assumptions.assumeThat(supportsDefaultValues()).isTrue(); + assumeThat(supportsDefaultValues()).isTrue(); Schema writeSchema = new Schema(required(1, "id", Types.LongType.get())); @@ -573,9 +573,7 @@ public abstract class AvroDataTestBase { @Test public void testRowLineage() throws Exception { - Assumptions.assumeThat(supportsRowLineage()) - .as("Row lineage support is not implemented") - .isTrue(); + assumeThat(supportsRowLineage()).as("Row lineage support is not implemented").isTrue(); Schema schema = new Schema(