mockito 多层调用
Sometimes we want to mock different responses for the consecutive calls on the same method. We can create then*
methods chain with when()
to specify iterator style stubbing in Mockito.
有时,我们想对同一方法的连续调用模拟不同的响应。 我们可以使用when()
创建then*
方法链,以在Mockito中指定迭代器样式存根。
Mockito存根连续呼叫 (Mockito Stubbing Consecutive Calls)
Let’s look at a simple example of