Mockito: Verify Mock (with “RETURNS_DEEP_STUBS”) Returns More Calls Than Expected

后端 未结 3 2111
广开言路
广开言路 2021-02-18 20:22

Looking at the code below, I only expect the call to getSand() to happen once, but the test is failing with four calls to it. Where are these calls happening? I wan

3条回答
  •  既然无缘
    2021-02-18 21:13

    From documention: " Verification API does not support 'chaining' so deep stub doesn't change how you do verification."

    Source: http://mockito.googlecode.com/svn/tags/1.8.3/javadoc/org/mockito/Mockito.html#RETURNS_DEEP_STUBS

提交回复
热议问题