You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "jackye1995 (via GitHub)" <gi...@apache.org> on 2023/03/09 18:39:38 UTC

[GitHub] [iceberg] jackye1995 commented on a diff in pull request #6977: API: Deprecate AssertHelpers

jackye1995 commented on code in PR #6977:
URL: https://github.com/apache/iceberg/pull/6977#discussion_r1131448557


##########
api/src/test/java/org/apache/iceberg/AssertHelpers.java:
##########
@@ -23,7 +23,22 @@
 import org.apache.avro.generic.GenericRecord;
 import org.assertj.core.api.AbstractThrowableAssert;
 import org.assertj.core.api.Assertions;
+import org.assertj.core.api.ThrowableAssert;
 
+/**
+ * This class is deprecated. Please use {@link
+ * Assertions#assertThatThrownBy(ThrowableAssert.ThrowingCallable)} directly as shown below:
+ *
+ * <pre>
+ * Assertions.assertThatThrownBy(() -> throwingCallable)
+ *    .isInstanceOf(ExpectedException.class)
+ *    .hasMessage(expectedErrorMsg)
+ * </pre>
+ *
+ * @deprecated Use {@link Assertions#assertThatThrownBy(ThrowableAssert.ThrowingCallable)} directly
+ *     as it provides a more fluent way of asserting on exceptions.

Review Comment:
   I did some small tests, there is a small difference in IDE: if only the static method is imported the user won't see deprecation warning in code unless he/she looks at the import block, so it might still be beneficial to mark methods as deprecated as well.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org