3.1. Running JUnit 4 Tests on the JUnit Platform
Just make sure that the junit-vintage-engine
artifact is in your test runtime path. In that case JUnit 3 and JUnit 4 tests will automatically be picked up by the JUnit Platform launcher.
See the example projects in the junit5-samples
repository to find out how this is done with Gradle and Maven.
3.1.1. Categories Support
For test classes or methods that are annotated with @Category
, the JUnit Vintage test engine exposes the category’s fully qualified class name as a tag of the corresponding test identifier. For example, if a test method is annotated with @Category(Example.class)
, it will be tagged with "com.acme.Example"
. Similar to the Categories
runner in JUnit 4, this information can be used to filter the discovered tests before executing them (see Running Tests for details).