Cannot use mocked function calls in parameters of verify: too many invocations

后端 未结 2 1481
挽巷
挽巷 2021-01-21 16:31

The setup is as follows:

//call doA a bunch of times, call doB once using some value that depends on doA()
verify(mockedThing).doB(eq(mockedThing.doA())); //remo         


        
2条回答
  •  借酒劲吻你
    2021-01-21 17:01

    Jeff Bowman's answer helps explain what is going on.

    A lot of Mockito is based on the last-called function, and calls to mocks implicitly check state in ways that aren't compatible with the syntax you're trying to use. I wrote a bit more on this answer here. – Jeff Bowman yesterday

提交回复
热议问题