title: Partial Mocking As Code Smell?
body: <p>Why is there so much hating going on about 'partial mocking' and the code that requires it?</p>
  
  <p>Here's an (theoretical) example implementation:</p>
  
  <pre><code>public ComplexResult1 operationA(Stimulus a) {
      {
          ...
          result = ...;
      }
      auditTheChange(a);
  }
  public ComplexResult2 operationB(Stimulus b) {
      {
          ...
          result = ...;
      }
      auditTheChange(b);
      return result;
  }
  void auditTheChange(Stimulus stim) {
      // do a bunch of stuff to record the change
      // and interact with another outside service
  }
  </code></pre>
  
  <p>Now, in my understanding this is well refactored code.</p>
  
  <p>If I want to UNIT test operationA and operationB, <em>and</em> ensure that auditing happens in each scenario, <em>but without</em> having to test the specifics of the audit code, I would use partial mocking.</p>
  
  <p>What am I not seeing/understanding that causes so many projects (EasyMock, Mockito, etc.) to recommend refactoring?</p>