Exception : mockito wanted but not invoked, Actually there were zero interactions with this mock

后端 未结 4 1860
旧时难觅i
旧时难觅i 2020-12-08 06:20

I have interface

Interface MyInterface {
  myMethodToBeVerified (String, String);
}

And implementation of interface is

clas         


        
4条回答
  •  爱一瞬间的悲伤
    2020-12-08 07:00

    Your class MyClass creates a new MyClassToBeTested, instead of using your mock. My article on the Mockito wiki describes two ways of dealing with this.

提交回复
热议问题