You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by fo...@apache.org on 2025/03/28 08:38:50 UTC
(iceberg) branch main updated: AWS: Use assertThat instead of JUnit4 assertions (#12668)
This is an automated email from the ASF dual-hosted git repository.
fokko 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 12f5d0886f AWS: Use assertThat instead of JUnit4 assertions (#12668)
12f5d0886f is described below
commit 12f5d0886f3aa1a1ffad25e96507485326974975
Author: Eduard Tudenhoefner <et...@gmail.com>
AuthorDate: Fri Mar 28 09:38:44 2025 +0100
AWS: Use assertThat instead of JUnit4 assertions (#12668)
---
.../org/apache/iceberg/aws/s3/TestS3FileIO.java | 30 ++++++++++------------
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/aws/src/test/java/org/apache/iceberg/aws/s3/TestS3FileIO.java b/aws/src/test/java/org/apache/iceberg/aws/s3/TestS3FileIO.java
index cda6216fe8..cdf0e00b70 100644
--- a/aws/src/test/java/org/apache/iceberg/aws/s3/TestS3FileIO.java
+++ b/aws/src/test/java/org/apache/iceberg/aws/s3/TestS3FileIO.java
@@ -20,8 +20,6 @@ package org.apache.iceberg.aws.s3;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
import static org.mockito.AdditionalAnswers.delegatesTo;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
@@ -340,21 +338,19 @@ public class TestS3FileIO {
.collect(Collectors.toList());
// Assert that the returned FileInfo instances match the expected values
- assertEquals(2, fileInfoList.size());
- assertTrue(
- fileInfoList.stream()
- .anyMatch(
- fi ->
- fi.location().endsWith("file1.txt")
- && fi.size() == 1024
- && fi.createdAtMillis() > Instant.now().minusSeconds(120).toEpochMilli()));
- assertTrue(
- fileInfoList.stream()
- .anyMatch(
- fi ->
- fi.location().endsWith("file2.txt")
- && fi.size() == 2048
- && fi.createdAtMillis() < Instant.now().minusSeconds(30).toEpochMilli()));
+ assertThat(fileInfoList).hasSize(2);
+ assertThat(fileInfoList)
+ .anyMatch(
+ fi ->
+ fi.location().endsWith("file1.txt")
+ && fi.size() == 1024
+ && fi.createdAtMillis() > Instant.now().minusSeconds(120).toEpochMilli());
+ assertThat(fileInfoList)
+ .anyMatch(
+ fi ->
+ fi.location().endsWith("file2.txt")
+ && fi.size() == 2048
+ && fi.createdAtMillis() < Instant.now().minusSeconds(30).toEpochMilli());
}
/**