I'm just wondering if it is possible using Junit and easymock to ignore unexpected method calls?
I.e. instead of the test failing I want to be able to say - "at this point - ignore any unexpected method calls and just continue with the test as normal'
Thanks
With EasyMock you can create a nice mock, which unlike a normal mock object does not throw assertion errors if an unexpected/recorded call occurs. To quote the easymock documentation...
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.
To create a nice mock, use the static createNiceMock(Class class) method on the Easymock class...
SomeClass someClassNiceMock = EasyMock.createNiceMock(SomeClass.class);