@Test
public void rethrowWebApplicationExceptionThatThrownByInvocatedMethod() throws Exception {

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