title: Exception : mockito wanted but not invoked, Actually there were zero interactions with this mock
body: <p>I have interface</p>
  <pre><code>Interface MyInterface {
    myMethodToBeVerified (String, String);
  }
  </code></pre>
  <p>And implementation of interface is</p>
  <pre><code>class MyClassToBeTested implements MyInterface {
     myMethodToBeVerified(String, String) {
      …….
     }
  }
  </code></pre>
  <p>I have another class</p>
  <pre><code>class MyClass {
      MyInterface myObj = new MyClassToBeTested();
      public void abc(){
           myObj.myMethodToBeVerified (new String(“a”), new String(“b”));
      }
  }
  </code></pre>
  <p>I am trying to write JUnit for MyClass. I have done</p>
  <pre><code>class MyClassTest {
      MyClass myClass = new MyClass();
    
      @Mock
      MyInterface myInterface;
  
      testAbc(){
           myClass.abc();
           verify(myInterface).myMethodToBeVerified(new String(“a”), new String(“b”));
      }
  }
  </code></pre>
  <p>But I am getting       <strong>mockito wanted but not invoked, Actually there were zero interactions with this mock</strong> at verify call.</p>
  <p>can anyone suggest some solutions.</p>