We have been fortunate to encounter Maven's handling of unit tests on several occasions already in this book. This should come as no surprise, because Maven so closely links this type of test to the build lifecycle of all of the default packaging types.
To revise briefly, in Chapter 1, Maven in a Nutshell, we had an overview of the Surefire plugin, how Maven picks up tests automatically, and how to treat unit test failures. We also saw how to write a basic unit test with TestNG and configure that to be used instead of JUnit. If you are interested in learning the basics of how to write your own unit tests and have them configured in the build, take a look back at this section.