I am using Mockito 1.9 with Grails 1.3.7 and I have a strange bug.
The following test case in java works:
im
The problem is Groovy is intercepting your method call before it reaches someVoidMethod
. The method actually being called is getMetaClass
which is not a void method.
You can verify this is happening by replacing:
doNothing().when(testClassMock).someVoidMethod()
with:
doReturn(testClassMock.getMetaClass()).when(testClassMock).someVoidMethod()
I'm not sure you will be able to get around this issue using stock Mockito
and Groovy.