@Test
public void shouldThrowExceptionOnError() {

  final Exception expected = new UnsupportedOperationException();
  try {
    final TimeoutStrategy strategy = new TimeoutStrategy(Time.of(100L, TimeUnit.MILLISECONDS));
    final RequestMethod<Integer> method = new RequestMethod<Integer>() {
      @Override
      public String getName() {
        return null;
      }
      @Override
      protected Integer runInternal(List<Object> parameters) throws Exception {
        throw expected;
      }
    };
    final Invocation<Integer> invocation = strategy.apply(method.toInvocation());
    invocation.invoke();
    fail();
  } catch (Exception actual) {
    assertEquals(expected, actual);
  }
}