title: Mockito thenThrow throws mockito exception
body: <p>I'm tring to mock restOperation to throw exception but i get MockitoException instead of taking proper exception. It's weird for me because when i trying to test happy path almost the same mock invoke works fine. What is wrong with that:</p>
  
  <p>Working mock:</p>
  
  <pre><code>Mockito.when(restOperations.exchange(
              Mockito.anyString(), Mockito.&lt;HttpMethod&gt;any(), Mockito.&lt;HttpEntity&lt;?&gt;&gt;any(),
              Mockito.&lt;Class&lt;UserByRoleHolder&gt;&gt;any())).thenReturn(new ResponseEntity&lt;&gt;(userByRoleHolder, HttpStatus.OK));
  </code></pre>
  
  <p>Mock throwing  MockitoException:</p>
  
  <pre><code>Mockito.when(restOperations.exchange(
              Mockito.anyString(), Mockito.&lt;HttpMethod&gt;any(), Mockito.&lt;HttpEntity&lt;?&gt;&gt;any(),
              Mockito.&lt;Class&lt;UserByRoleHolder&gt;&gt;any())).thenThrow(new ConnectException("Test exception"));
  </code></pre>
  
  <p>Here is my method implementation:</p>
  
  <pre><code>ResponseEntity&lt;UserByRoleHolder&gt; entity = null;
  try {
      entity = restOperations.exchange(userProfileUrl, HttpMethod.GET,
                  authorizedHttpEntityFactory.getAuthorizedHttpEntity(null), UserByRoleHolder.class);
      } catch (RestClientException e) {
          throw new ConnectException(e.getMessage());
      }
      return entity.getBody();
  </code></pre>
  
  <p>Stack trace:</p>
  
  <pre><code>Unexpected exception, expected&lt;java.net.ConnectException&gt; but was&lt;org.mockito.exceptions.base.MockitoException&gt;
  java.lang.Exception: Unexpected exception, expected&lt;java.net.ConnectException&gt; but was&lt;org.mockito.exceptions.base.MockitoException&gt;
  at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:28)
  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  at org.mockito.internal.runners.JUnit45AndHigherRunnerImpl.run(JUnit45AndHigherRunnerImpl.java:37)
  at org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:62)
  at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86)
  at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49)
  at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69)
  at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:48)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
  at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
  at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
  at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
  at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
  at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:105)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
  at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
  at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
  at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  Caused by: org.mockito.exceptions.base.MockitoException: 
  Checked exception is invalid for this method!
  Invalid: java.net.ConnectException: Test exception
  at com.stanleyblackanddecker.toolboxcore.gateway.AuthGatewayTest.testGetAllUsersNoAuthPresent(AuthGatewayTest.java:215)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
  at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:19)
  ... 37 more
  </code></pre>