Consider assertThat() in place of assertEquals()
Join the DZone community and get the full member experience.
Join For FreeJUnit 4.4 added a new assertion mechanism with the method assertThat(). Have a look and consider using it in place of assertEquals().
assertThat(result, is(42));
assertThat(output, containsString("foo"));
JUnit
Assertion (software development)
Published at DZone with permission of Mike Christianson, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
Boosting Application Performance With MicroStream and Redis Integration
-
How To Design Reliable IIoT Architecture
-
Effortlessly Streamlining Test-Driven Development and CI Testing for Kafka Developers
-
A Complete Guide to AWS File Handling and How It Is Revolutionizing Cloud Storage
Comments