SYSTEM Cited by 1 source
Maven Surefire Plugin¶
Maven Surefire is Apache Maven's default test runner. It
attaches to the test phase of Maven's default lifecycle and
executes test classes by naming convention:
**/Test*.java**/*Test.java**/*Tests.java**/*TestCase.java
Designed for unit tests — it fails the build immediately on test failure (no post-test hooks), which is the desired semantics for fast-feedback unit suites. Supports JUnit 3/4/5, TestNG, and custom providers via pluggable API.
Relevance to Testcontainers ingest¶
In the Zalando ZMS stack, Surefire runs the fast, hermetic
unit tests in the test phase — the only tests
mvn test executes. Slower integration tests get pushed to
Failsafe in the
integration-test phase, gated by a profile. See
patterns/failsafe-integration-test-separation.
The naming-convention split — FooTest for Surefire,
FooIntegrationTest for Failsafe — is the mechanical
enforcement of which suite a test belongs to.
Seen in¶
- sources/2021-02-24-zalando-integration-tests-with-testcontainers —
Zalando ZMS's Maven configuration uses Surefire for unit
tests in the default
testphase, Failsafe for ITs behind thewith-integration-testsprofile.
Related¶
- systems/maven-failsafe-plugin — complement for the integration-test phase.
- systems/junit5 — canonical test framework Surefire invokes.
- patterns/failsafe-integration-test-separation — the two-phase split pattern.