When I define useJUnit {} in a test task, the default test configuration is overridden. If I run gradle test, it takes the last includeCategories defined in my build script. Running the unitTest or integrationTest task works fine. I am using Gradle 2.13.
Example configuration:
test {
useJUnit {
includeCategories 'com.company.test.categories.UT'
}
}
task unitTest(type: Test) {
useJUnit {
includeCategories 'com.company.test.categories.UT'
}
}
task integrationTest(type: Test) {
useJUnit {
includeCategories 'com.company.test.categories.SIT'
}
}
```