java - EasyMock: call order on mocks created with @Mock -
is there way verify methods call order between mocks if created @mock annotation?
as described in documentation can done mock control. easymockrule not expose control object. have looked @ easymocksupport implementation, have not found way force use 1 control injected mocks. :(
public class test extends easymocksupport { @rule public easymockrule mocks = new easymockrule(this); @mock private someclass first; @mock private otherclass second; @testsubject private undertest subject = new undertest (); @test public void test() { expect(first.call()); expect(second.call()); .... //verify calls in order first.call(), second.call() } }
you right, not possible. enhancement allow set control in @mock annotation. can please file issue?
in case, have create mocks manually using same imockscontrol explained in documentation.
Comments
Post a Comment