Hi everyone,

I was wondering what the appetite would be for introducing AssertJ
<https://assertj.github.io/doc/> to the project?
I believe it's a really good testing library that makes writing assertions
much more intuitive, as the assertions are written in kind-of a fluent way.
The test code ends up being more readable and it provides an actually
useful error message when assertions fail.

There are some good examples of how AssertJ is used here
<https://assertj.github.io/doc/#assertj-core-assertions-guide>, but
personally what I like most about AssertJ is testing exceptional code
<https://assertj.github.io/doc/#assertj-core-exception-assertions-assertThatThrownBy>,
where you want to make sure some code throws a particular exception and
also has message Xyz or some other property that you want to assert on (no
more *@Test(expected = SomeException.class)* or *try-catch *code with Assert
.fail()).

I've seen that the project already has the *AssertHelpers* class, but I
believe we can improve some stuff there as well and make overall testing
nicer.

I took the liberty and opened PR#2684
<https://github.com/apache/iceberg/pull/2684>, which introduces AssertJ to
a subset of tests just to show its usage and its benefit.

Please let me know what you think

Eduard

Reply via email to