CircuitBreakerDelegate implements CircuitBreaker<ET> { @Override public CircuitBreakerDelegate<ET, Del_ET> onOpen(Runnable listener) { delegate.onOpen(listener); return this; } CircuitBreakerDelegate(CircuitBreaker<Del_ET> delegate, Function<ET, Del_ET> eventConverter); @Override ManualModeTask<ET> newManualModeTask(); @Override CompletableFuture<ET> executeAsyncCall(Supplier<CompletableFuture<ET>> eventFutureSupplier); @Override ET executeBlockingCall(Callable<ET> eventSupplier); @Override CircuitBreakerDelegate<ET, Del_ET> onClose(Runnable listener); @Override CircuitBreakerDelegate<ET, Del_ET> onHalfOpen(Runnable listener); @Override CircuitBreakerDelegate<ET, Del_ET> onOpen(Runnable listener); @Override String getId();  }
@Test public void onOpen_calls_delegate_and_returns_self() { Runnable listener = mock(Runnable.class); CircuitBreaker<Integer> result = wrapper.onOpen(listener); verify(delegateMock).onOpen(listener); assertThat(result).isSameAs(wrapper); }