Briefly (i.e., in no more than 2 sentences) describe the benefit(s) of using Hamcrest (i.e., "assertThat" and associated matchers) over "assertTrue", "assertFalse" and "assertEquals."
1
Expert's answer
2020-05-05T18:34:51-0400
The benefits of using Hamcrest:
assertThat is more readable than the other assert methods,
much better error messages,
generic and type-safe.
An additional benefit to hamcrest library is its portability. It can be used with both JUnit and TestNG.
In the same way that custom assert methods can be written, custom matcher can also be written.
Comments
Leave a comment