title: mockito unit testing Wanted but not invoked:
body: <p>I have seen there are similar question already exist in SO , I tried all the solution , but couldn't fix my problem , as I am new to <code>tdd</code> </p>
  
  <p>I have a class like this </p>
  
  <pre><code>public class AppUpdatesPresenter  {
  
      public void stopService() {
          ServiceManager.on().stopService();
      }
  }
  </code></pre>
  
  <p>I have the test class like this</p>
  
  <pre><code>@RunWith(MockitoJUnitRunner.class)
  public class AppUpdatesPresenterTest {
         @Mock
         AppUpdatesPresenter appUpdatesPresenter;
  
         @Mock
         ServiceManager serviceManager;
  
         @Mock
         Context context;
  
         @Test
         public void test_Stop_Service() throws Exception {
              appUpdatesPresenter.stopService();
              verify(serviceManager,times(1)).stopService();
         }
  
  }
  </code></pre>
  
  <p>When I tried to test that , if I call <code>stopService()</code> method , then <code>ServiceManager.on().stopService();</code> called at least once . </p>
  
  <p>But I am getting the following error</p>
  
  <pre><code>Wanted but not invoked:
  serviceManager.stopService();
  -&gt; at io.example.myapp.ui.app_updates.AppUpdatesPresenterTest.test_Stop_Service(AppUpdatesPresenterTest.java:103)
  Actually, there were zero interactions with this mock.
  </code></pre>
  
  <p>Not sure whats gone wrong . </p>