0

I am new to Mockito. So I need to do this:

I have a method which is not expected to be triggered as part of my workflow. I know to verify if method runs, I can use

verify(updateRule,times(1)).test();

I tried

verify(updateRule,times(0)).test(); 

but this is not working. am I missing Anything?

Progman
  • 16,827
  • 6
  • 33
  • 48
  • Welcome to Stack Overflow. Please take the [tour] to learn how Stack Overflow works and read [ask] on how to improve the quality of your question. Then [edit] your question to include your source code as a working [mcve], which can be compiled and tested by others. Please see: [What Do You Mean “It Doesn't Work”?](https://meta.stackexchange.com/q/147616) – Progman Nov 24 '21 at 19:17
  • How is it not working? What do you mean is not working? – drum Nov 24 '21 at 19:22
  • Did you try `never()`? – Roddy of the Frozen Peas Nov 24 '21 at 19:25
  • It's explained here https://stackoverflow.com/questions/12862659/how-to-verify-that-a-specific-method-was-not-called-using-mockito – szachMati Nov 24 '21 at 22:52

0 Answers0