Having trouble implementing custom hamcrest matcher to use in Grails. Running the tests using my matcher fails with:
java.lang.NoSuchMethodError: org.hamcrest.Matcher.describeMismatch(Ljava/lang/Object;Lorg/hamcrest/Description;)V
After a bit of googling it seems that this is caused by the order of the loaded libraries: JUnit and Hamcrest. I have added the following dependency to my BuildConfig.groovy:
dependencies {
test 'org.hamcrest:hamcrest-all:1.3'
}
Accordingly to instructions I was able to found, this could be fixed by making sure that hamcrest classes are loaded before JUnit ones. I do not know how to achieve this in Grails though or how to solve this in any other way.
Using Grails 2.2.1