I have a class with a method which returns XML. Along with this I have a Spock unit test. The test works fine in isolation ie if I do test-app :unit TestSpec.
However it throws an error -
Cannot cast object 'com.mypackage.SequencePartResponse@518a824' with class 'com.mypackage.SequencePartResponse' to class 'grails.converters.XML'
when I run ALL my tests (test-app :unit). I found a similar problem on stackOverflow (12098289) which suggested using 'addConvertors(offendingClassName)' to cure this but that isn't working with Spock. it just throws a method not found error.
Anyone any ideas how to sort this?