From 32cc331bdef259f0412dc67df2403eb8bff3f0c5 Mon Sep 17 00:00:00 2001 From: lisirrx Date: Tue, 5 Dec 2023 22:02:15 +0800 Subject: [PATCH] fix some test using new api --- .../test/java/org/apache/iceberg/TestBase.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/core/src/test/java/org/apache/iceberg/TestBase.java b/core/src/test/java/org/apache/iceberg/TestBase.java index 5345c481da55..5700385c3e7a 100644 --- a/core/src/test/java/org/apache/iceberg/TestBase.java +++ b/core/src/test/java/org/apache/iceberg/TestBase.java @@ -399,9 +399,9 @@ void validateSnapshot(Snapshot old, Snapshot snap, Long sequenceNumber, DataFile .isTrue(); } - Assertions.assertThat(newManifests.size()) + Assertions.assertThat(newManifests) .as("Should create 1 new manifest and reuse old manifests") - .isEqualTo(1); + .hasSize(1); ManifestFile manifest = newManifests.get(0); long id = snap.snapshotId(); @@ -542,9 +542,7 @@ void validateManifest( } } - Assertions.assertThat(expectedFiles.hasNext()) - .as("Should find all files in the manifest") - .isFalse(); + Assertions.assertThat(expectedFiles).as("Should find all files in the manifest").isExhausted(); } void validateDeleteManifest( @@ -572,9 +570,7 @@ void validateDeleteManifest( .isEqualTo(statuses.next()); } - Assertions.assertThat(expectedFiles.hasNext()) - .as("Should find all files in the manifest") - .isFalse(); + Assertions.assertThat(expectedFiles).as("Should find all files in the manifest").isExhausted(); } private > void validateManifestSequenceNumbers( @@ -697,9 +693,7 @@ static void validateManifestEntries( .isEqualTo(expectedStatus); } - Assertions.assertThat(expectedFiles.hasNext()) - .as("Should find all files in the manifest") - .isFalse(); + Assertions.assertThat(expectedFiles).as("Should find all files in the manifest").isExhausted(); } static Iterator statuses(ManifestEntry.Status... statuses) {