Hi,

Am 11.01.2017 um 13:45 schrieb Florian Stendel (Apache):
> 
> Imho, the later is a easy to read and understand as your assertj example
> (without introducing the dependency to another library).
> Not to mention, you have one line per test assertion (one for the
> NotNull check, and one for the size check)
> 


The problem with the old matchers is the order of the arguments - which
one is expected/actual.

If you have more complex test assertions/setups you may easily want to
have a more fluent way to check your assertions instead of a chain of
"older" asserts.

Furthermore fluent assertions improve the readability when they mix a
plain logical assertions (e.g. a specific value of 4711) with more
languageSpecific stuff like checkin for (absence/existence) of null or a
particular size of a collection.

But it's merely a matter of taste :-)

Cheers,
Phil

Reply via email to