Unit Testing with Maven

Overview

The execution of unit tests is handled by the Maven Surefire Plugin.

If you already familiar with Maven you know where to put your unit tests. The Maven way is to put unit tests into src/test/java and their appropriate resources into src/test/resources.

First simple example

The first unit test example will show you a simple project with unit tests and how a execution will look like.

The other examples like the unit test multiple usage shows how to reuse a classes which are defined in src/test/java area.