How to check the order of mocking calls with EasyMock

This is easy enough in EasyMock :

EasyMock.expect(service.methodCall());

but I noticed that this does not check the order of the calls, which in the case when I try to check, is very important. Is there any way to do this with EasyMock?

+3
source share
2 answers

You can use EasyMock.createStrictMock()to create a layout that can check the order of method calls.

http://easymock.org/EasyMock3_0_Documentation.html

(find examples of "Checking the order of calls between Mocks" in the link above).

+5
source

, EasyMock.createStrictControl() , replay() verify().

: http://www.michaelminella.com/testing/mock-controls-with-easymock.html

+1

Source: https://habr.com/ru/post/1765395/


All Articles