title: Mock that a method call was attempted during unit test, but do not actually call it
body: <p>I'm writing a JUnit test and also using Mockito, and I want to call a method, which in turn calls a second method a number of times. I do not want that second method to ever be called during my unit test, but I want to know what it's arguments would have been. My code to be tested looks something like this:</p>
  
  <pre><code>public class MyClass {
      public void myMethod() {
          int a = [do some logic]
          int b = [do some logic];
          doSomething(a, b);
  
          a = [do some logic];
          b = [do some logic];
          doSomething(a, b);
      }
  
      public void doSomething(int a, int b) {
          // code that I do not want to be executed during a unit test
      }
  }
  </code></pre>
  
  <p>And now a unit test:</p>
  
  <pre><code>@Test
  public void test() {
      MyClass myClass = new MyClass();
      myClass.myMethod();
      verify(myClass).doSomething(17, 33);
      verify(myClass).doSomething(9, 18);
  }
  </code></pre>
  
  <p>I am new to Mockito and I don't know if it's possible to either A) prevent doSomething() from being executed and B) verify the values of the a &amp; b arguments. I'm willing to accept answers like "Mockito cannot help you here" or "this is not something that is technically possible." If there's no way to mock this sort of thing, I may consider refactoring those [do some logic] blocks into methods that I can test directly but my code is more complex than this simple example, and I am not allowed to post the code online.</p>