Summary

This chapter covered the JUnit best practices and explained the underlying principles. The best practices are writing meaningful tests, automating unit tests, test configuration, working with assertions, exception handling in test cases, identifying test smells, and refactoring test smells.

Now you will be able to write clean and maintainable test cases.

Get Mastering Unit Testing Using Mockito and JUnit 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.