I've been experimenting the Mockito equivalent of the
EasyMock.expect(someMethod()).andReturn(someMockObject).times(n);
but I can't figure it out.
A little help on this, please?
Thanks in advance.
when(myObject.someMethod()).thenReturn(someMockObject);
// run test
verify(myObject, times(n)).someMethod();
See the documentation for more conversion examples.