partially mock all instances of a GORM domain class

10 views
Skip to first unread message

Don

unread,
Dec 3, 2009, 10:42:31 AM12/3/09
to gmock-user
Hi,

Is there any way that I can use GMock to partially mock all instances
of a particular class? I've tried using regular meta-programming to
achieve this, but for some reason GORM domain classes seem to be
resistant to meta-programming.

Specifically what I want to do is just mock the getName() method of a
GORM domain class. This is a real method, i.e. there is no setName()
method or property 'name'.

Thanks,
Don

Johnny Jian

unread,
Dec 3, 2009, 11:17:29 PM12/3/09
to gmock-user
You can mock the static methods of the domain class, and return a
mocked instance of that class.
Reply all
Reply to author
Forward
0 new messages