@Test
public void wrapsExceptionThatThrownByInvocatedMethodWithInternalException() throws Exception {

    when(resourceMethod.getMethodParameters()).thenReturn(newArrayList(entityParameter));
    Exception thrownByMethod = new Exception();
    thrown.expect(InternalException.class);
    thrown.expectCause(exceptionSameInstanceMatcher(thrownByMethod));
    methodInvoker.invokeMethod(new EchoResource(thrownByMethod), resourceMethod, applicationContext);
}