I’ve read about this annotation in the Grails documentation (Chapter 9: Testing).
But I can’t understand what is it…
The problem is that I need to mock the dynamic methods of the GORM, there’s a way to mock them automatically without that I have to write all the methods I need?
This is true in grails 2.x:
When you add the annotation @Mock(A), grails will add the dynamic methods to A, for your unit test. You don’t have to mock them yourself.
You will be able to do in your test, or in objects called by your test:
etc
Grails mocks these methods with an in-memory implementation of GORM, not jdbc.
You will be able to use criteria queries too.