Update: Its a bug and it\'s been reported, please star: https://code.google.com/p/android/issues/detail?id=209832&thanks=209832&ts=1463161330
My tests are in src/test/java folder and adding test.setRoot('test') to sourceSets worked for me.
src/test/java
test.setRoot('test')
sourceSets
sourceSets { test.setRoot('test') }