@Test public void testUnwrapsInvocationTargetExceptions() { Callable throwingCallable = () -> { throw new IllegalStateException("Whoops"); }; Refreshable<Callable> refreshable = Refreshable.of(throwingCallable); RefreshableProxyInvocationHandler<Callable, Callable> handler = RefreshableProxyInvocationHandler.create(refreshable, _tec -> throwingCallable); Callable proxy = Reflection.newProxy(Callable.class, handler); assertThatThrownBy(proxy::call) .isInstanceOf(IllegalStateException.class) .hasMessage("Whoops"); }
public static <R, T> RefreshableProxyInvocationHandler<R, T> create( Refreshable<R> refreshable, Function<R, T> delegateSupplier) { return new RefreshableProxyInvocationHandler<>(refreshable, delegateSupplier); }
RefreshableProxyInvocationHandler extends AbstractInvocationHandler { public static <R, T> RefreshableProxyInvocationHandler<R, T> create( Refreshable<R> refreshable, Function<R, T> delegateSupplier) { return new RefreshableProxyInvocationHandler<>(refreshable, delegateSupplier); } }
RefreshableProxyInvocationHandler extends AbstractInvocationHandler { public static <R, T> RefreshableProxyInvocationHandler<R, T> create( Refreshable<R> refreshable, Function<R, T> delegateSupplier) { return new RefreshableProxyInvocationHandler<>(refreshable, delegateSupplier); } private  RefreshableProxyInvocationHandler(Refreshable<R> refreshable, Function<R, T> delegateSupplier); }
RefreshableProxyInvocationHandler extends AbstractInvocationHandler { public static <R, T> RefreshableProxyInvocationHandler<R, T> create( Refreshable<R> refreshable, Function<R, T> delegateSupplier) { return new RefreshableProxyInvocationHandler<>(refreshable, delegateSupplier); } private  RefreshableProxyInvocationHandler(Refreshable<R> refreshable, Function<R, T> delegateSupplier); static RefreshableProxyInvocationHandler<R, T> create(
            Refreshable<R> refreshable, Function<R, T> delegateSupplier); }
RefreshableProxyInvocationHandler extends AbstractInvocationHandler { public static <R, T> RefreshableProxyInvocationHandler<R, T> create( Refreshable<R> refreshable, Function<R, T> delegateSupplier) { return new RefreshableProxyInvocationHandler<>(refreshable, delegateSupplier); } private  RefreshableProxyInvocationHandler(Refreshable<R> refreshable, Function<R, T> delegateSupplier); static RefreshableProxyInvocationHandler<R, T> create(
            Refreshable<R> refreshable, Function<R, T> delegateSupplier);  }