As per title, just wondering if there is a mechanism with easymock to test if a method wasn't called during it's lifetime.
A:
By default, Easymock will throw an exception for any methods that are called that you didn't explicitly set expectations for.
Daniel Alexiuc
2009-12-29 02:10:39
+2
A:
From the EasyMock documentation:
Nice Mocks
On a Mock Object returned by createMock() the default behavior for all methods is to throw an AssertionError for all unexpected method calls. If you would like a "nice" Mock Object that by default allows all method calls and returns appropriate empty values (0, null or false), use createNiceMock() instead.
So what you are asking is the default behavior.
Wim Coenen
2009-12-29 02:11:04