I have a mock, for which I expect object1
for 1st call and object2
for next 2 calls.
Is this expression correct?
EasyMock.expect(result.get(0)).andReturn(object1).andReturn(object2).times(2);
or should I use
EasyMock.expect(result.get(0)).andReturn(object1).andReturn(object2).andReturn(object2);
Specifically, does adding times
at the end make the entire group of expectations be expected twice, or only the last expectation in the chain?