views:

27

answers:

1

Hi,

It's easy enough in EasyMock to do:

EasyMock.expect(service.methodCall());

but I noticed that this does not test the order in which I execute the calls, which in a case that I am trying to test is very important. Is there anyway to do this with EasyMock?

+2  A: 

Hi,
You can use the EasyMock.createStrictMock() for creating a mock thats capable of checking the order of method calls.

http://easymock.org/EasyMock3_0_Documentation.html
(search for "Checking Method Call Order Between Mocks" in the above link for examples).

Best Regards,
Keshav

keshav.veerapaneni