Skip to content

Commit

Permalink
Spark 3.4: Remove usage of AssertHelpers (apache#8963)
Browse files Browse the repository at this point in the history
  • Loading branch information
coded9 authored Nov 1, 2023
1 parent da392f2 commit 8387b50
Show file tree
Hide file tree
Showing 5 changed files with 561 additions and 646 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.iceberg.spark.extensions;

import static org.apache.iceberg.AssertHelpers.assertThrows;
import static org.apache.iceberg.TableProperties.FORMAT_VERSION;
import static org.apache.iceberg.TableProperties.MANIFEST_MERGE_ENABLED;
import static org.apache.iceberg.TableProperties.MANIFEST_MIN_MERGE_COUNT;
Expand All @@ -35,6 +34,7 @@
import org.apache.iceberg.spark.source.SparkChangelogTable;
import org.apache.spark.sql.DataFrameReader;
import org.apache.spark.sql.Row;
import org.assertj.core.api.Assertions;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
Expand Down Expand Up @@ -202,10 +202,10 @@ public void testTimeRangeValidation() {
Snapshot snap3 = table.currentSnapshot();
long rightAfterSnap3 = waitUntilAfter(snap3.timestampMillis());

assertThrows(
"Should fail if start time is after end time",
IllegalArgumentException.class,
() -> changelogRecords(snap3.timestampMillis(), snap2.timestampMillis()));
Assertions.assertThatThrownBy(
() -> changelogRecords(snap3.timestampMillis(), snap2.timestampMillis()))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Cannot set start-timestamp to be greater than end-timestamp for changelogs");
}

@Test
Expand Down
Loading

0 comments on commit 8387b50

Please sign in to comment.