When we had only JUnit4 tests, we used
test {
useJUnit{
excludeCategories "SlowTests"
}
}
Now migrating to JUnit5 and still having JUnit4 tests around, how do we use it in JUnitPlattform to let tests marked with a JUnit test category out?
test {
useJUnitPlatform{
// ???
}
}
JUnit4's categories are mapped to tags according to the full class name of the category
So the following should work:
tasks.test {
useJUnitPlatform {
includeTags.add("com.acme.Example")
// or the following to exclude the tag: includeTags.add("!com.acme.Example")
}
}