Tests
Last updated
Was this helpful?
Last updated
Was this helpful?
Maven divides tests into two phases, one for unit tests and another for integration ones. Running the integration tests will run both the unit and integration tests.
In a general way, unit tests are small and fast tests, where the components use fake dependencies, or no dependencies at all. While integration tests connect several components and services.
It is recommended using the default test search methods, which will run all the test clases with "Test" in the name as unit test, and those with "IT" as integration tests. They will be found by scanning the packages in the test code folder.
To run both unit and integration tests the use the following command:
To run only unit tests use the following command:
Maven uses two plugins to take care of the tests:
runs unit tests.
runs integration tests.
Some additional plugins can be used to improve testing results:
, generates coverage reports from Surefire and Failsafe.
, generates the unit tests report.