I'm new to JUnit and Hamcrest and would like best-practice advice so I can decided which documentation to study first.
For starters, which of these assertThat
methods is better?
- org.junit.Assert.assertThat (from junit-4.11.jar)
- org.hamcrest.MatcherAssert.assertThat (from hamcrest-core-1.3.jar)
According to one person last year, "JUnit has the assertThat method, but hamcrest has its own assertThat method that does the same thing.".
According to someone earlier this year, Hamcrest "could potentially give better error messages because the matcher is called to describe the mismatch".
It's hard to tell which versions of Junit and Hamcrest were compared in those posts. So I'd like a recommendation based on the most current released versions.