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
It's is the almost the exact same thing.
Recent versions of JUnit now include hamcrest.
Infact org.junit.Assert.assertThat 's method signature is
public static <T> void assertThat(T actual, org.hamcrest.Matcher<T> matcher)
which you will notice uses hamcrest matchers.
You may still want to include your own version of hamcrest becuase JUnit isn't updated very often and may not always use the latest version of hamcrest.
According to the maven pom, JUnit 4.11 uses hamcrest 1.3 which I believe is the most current as of this writing.
I've just read your second article http://blog.code-cop.org/2014/02/assert-or-matcherassert.html and it describes 2 slight differences in the hamcrest
assertThat that make it more useful:
assertThatsignature is different in hamcrest using
T actual, Matcher<? super T> matcherwhich allows matchers to be super types (like Matcher to compare Integers and Doubles). This usually doesn't matter but when you need it this is a nice feature to have.