This depends on the version of JUnit you're using. You can check this by looking in lib/junit/junit/jars
. I think this is 4.10 by default. If so, please upgrade to 4.11. You can do this by explictly specifying it in the BuildConfig.groovy I believe:
dependencies {
test 'junit:junit:4.11'
test 'org.hamcrest:hamcrest-all:1.3'
}
For an explanation, before 4.11 a version of the hamcrest libraries were included in the JUnit distribution. This is no longer the case with 4.11, and you sometimes get a mismatch between class versions.