title: mockito : how to unmock a method?
body: <p>I have a <strong>JUnit</strong> class with different methods to perform different tests.</p>
  
  <p>I use <strong>Mockito</strong> to create a spy on real instance, and then override some method which is not relevant to the actual test I perform.</p>
  
  <p>Is there a way, just for the sake of cleaning up after me in case some other tests that run after my tests also use the same instances and might execute a mocked method they didn't ask to mock, to un-mock a method?</p>
  
  <p>say I have a spy object called <em>'wareHouseSpy'</em></p>
  
  <p>say I overriden the method <em>isSomethingMissing</em> :</p>
  
  <pre><code>doReturn(false).when(wareHouseSpy).isSomethingMissing()
  </code></pre>
  
  <p>What will be the right way to un-override, and bring things back to normal on the spy i.e make the next invokation of <em>isSomethingMissing</em> to run the real method?</p>
  
  <p>something like</p>
  
  <pre><code>doReturn(Mockito.RETURN_REAL_METHOD).when(wareHouseSpy).isSomethingSpy()
  </code></pre>
  
  <p>or maybe</p>
  
  <pre><code>Mockito.unmock(wareHouseSpy)
  </code></pre>
  
  <p>Who knows? I couldn't find nothing in that area</p>
  
  <p>Thanks!</p>
  
  <p>Assaf</p>