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();
有关更多转换示例,请参阅文档。