Unit test with Mockito for long and convoluted methods
<p>Using Mockito for testing, I can easily unit tests this method:</p>

<pre><code>public void doTheDog() {

    // Some code

    extObj.executeDog();
}
</code></pre>

<p>I will simply verify that executeDog() has been called:</p>

<pre><code>verify(extObj).executeDog();
</code></pre>

<p>However when I have a very long and convoluted method, this is not always as easy.</p>

<pre><code>public void doTheDog() {

    // Very long code

    extObj.bark();

    // Very long code

    extObj.walk();
}
</code></pre>

<p>The above method will still behave as a dog, even if I remove bark(). So it doesn't make much sense to test for it:</p>

<pre><code>verify(extObj).bark();
</code></pre>

<p>After mocking, there isn't something that really tells me if the code works fine!!!</p>

<p>End of the story. Now I have to write unit tests for code that is for the most like the long-and-convoluted code above. What can I do to write good unit tests anyway with mocking? </p>