我一直在试验Mockito相当于
EasyMock.expect(someMethod()).andReturn(someMockObject).times(n);
但我无法弄清楚。
对此有点帮助,拜托?
提前致谢。
答案 0 :(得分:22)
when(myObject.someMethod()).thenReturn(someMockObject);
// run test
verify(myObject, times(n)).someMethod();
有关更多转换示例,请参阅documentation。