When using gradle 5.1.1 the build gives an error in the plugin:
Could not get unknown property 'classesDir' for mock local test classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.
It seems classesDir is deprecated and removed and SourceSetOutput.getClassesDir() should be used instead.