title: Mockito unfinished stubbing exception detected ONLY in Intellij Debugger
body: <p>The problem only occurs when I am trying to debug a test via the IntelliJ debugger. It does not happen when I just simply run the test.</p>
  <p>CustomerChoiceRepository is a normal Spring Boot JPA repository which here is being mocked with <code>@Mock</code>.</p>
  <p><a href="https://i.stack.imgur.com/dXK8U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dXK8U.png" alt="enter image description here" /></a></p>
  <p>When this line executes in the debugger I get the following error in the watch section of the variables:</p>
  <p><a href="https://i.stack.imgur.com/7App3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7App3.png" alt="enter image description here" /></a></p>
  <p>The entire error message is:</p>
  <pre><code>Method threw 'org.mockito.exceptions.misusing.UnfinishedStubbingException' exception. Cannot evaluate com.item.repository.jpa.CustomerChoiceRepository$MockitoMock$1318657964.toString()
  </code></pre>
  <p>Again this is only is detected in the IntelliJ debugger, as a result the test fails <em>only</em> when I am debugging it.</p>
  <p>So my question is: what is happening here?</p>
  <p>Is this a bug ? Is this something that I fail to understand because I do not know the internals of Mockito particularly well ?</p>