Integration Testing with Maven

Overview

If you already familiar with Maven you know where to put your unit tests but unfortunately there does not exist a definition like this for integration tests. There are some suggestions circulating around like src/it/java, but these are only rumors.

In this guide i suggest to put them into the same directory structure like the unit tests which means in other words src/test/java and make them distinguishable by the naming conventions, but in future Maven releases this might be changed.

The execution of integration tests is handled by the Maven Failsafe Plugin.

  • In Module Integration Test Examples
  • Simple integration test example (CLI Example in module)
  • separate module for integration tests.
  • IT example separate module...
  • Complex examples

    Integration Test of a implementation against an Interface with at least two implementations; Injection for example via guice.

  • Integration test of a web app (war + tomcat?)
  • Plugin Development integration tests