Summary

This JUnit refresher chapter covered both basic and advanced applications of JUnit. We also covered annotation-based JUnit testing, assertion, the @RunWith annotation, exception handling, setting up Eclipse for running JUnit tests, matchers, assertThat, and the custom lessThanOrEqual() matcher.

Then the Mockito framework was described in depth, and technical examples were provided to demonstrate the capability of Mockito.

The next chapter focuses on getting the reader quickly started with Spring Framework unit testing. It provides an overview of Spring integration testing and explores the test APIs.

Get Mockito for Spring now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.