Skip to content

Latest commit

 

History

History
25 lines (13 loc) · 1016 Bytes

README.md

File metadata and controls

25 lines (13 loc) · 1016 Bytes

fast-and-furious-testing

A guide on using JUnit categories using maven-failsafe-plugin

Maven failsafe plugin can run JUnit categories.

The API says that "Only classes/methods/etc decorated with one of the groups specified here will be included in test run"

And indeed running

	mvn verify -Pfast

Runs both MyFastTest and MyFastAndFuriousTest.

But it turns out you can use group additivity to run a test class/method that has a all of the listed groups.

A use case example is running a test annotated with a category that includes {Sanity.class, Slow.class} in a custom Maven profile.

This can be achieved by combining profiles with "AND". See this project's pom.xml

Running

	mvn verify -Pfast-and-furious

Runs only MyFastAndFuriousTest since it has both annotations.