Tests should read like prose
Expressing solutions to problems is at the heart of programming. Cognitive load slows you down. Not using natural language adds to the cognitive load. Writing software benefits from using natural language. This is something I think of very often in my work.
When using JUnit I use the Junit4 API
assertThat whenever possible.
This enables me to write
Compare this to Junit3
Junit5 is in development.
It surprised me to see that they are using what I perceived as “Junit3 syntax”.
we find the explanation.
assertThat API is reserved for third party assertion libraries like hamcrest or assertj.
The more powerful API is open to extension and pluggable.
An excellent choice.