@Test public void wontCallOnCompleteTwice() { InOrder inOrder = Mockito.inOrder(emitter); underTest.onCompleted(); inOrder.verify(emitter).onComplete(); underTest.onCompleted(); inOrder.verify(emitter, never()).onComplete(); }
@Override public final Void onCompleted() { if (delegateTerminated.getAndSet(true)) { return null; } final T result; try { result = delegate().onCompleted(); } catch (final Throwable t) { emitOnError(t); return null; } if (!emitter.isDisposed()) { if (result == null) { emitter.onComplete(); } else { emitter.onSuccess(result); } } return null; }
AbstractMaybeAsyncHandlerBridge implements AsyncHandler<Void> { @Override public final Void onCompleted() { if (delegateTerminated.getAndSet(true)) { return null; } final T result; try { result = delegate().onCompleted(); } catch (final Throwable t) { emitOnError(t); return null; } if (!emitter.isDisposed()) { if (result == null) { emitter.onComplete(); } else { emitter.onSuccess(result); } } return null; } }
AbstractMaybeAsyncHandlerBridge implements AsyncHandler<Void> { @Override public final Void onCompleted() { if (delegateTerminated.getAndSet(true)) { return null; } final T result; try { result = delegate().onCompleted(); } catch (final Throwable t) { emitOnError(t); return null; } if (!emitter.isDisposed()) { if (result == null) { emitter.onComplete(); } else { emitter.onSuccess(result); } } return null; } protected  AbstractMaybeAsyncHandlerBridge(MaybeEmitter<T> emitter); }
AbstractMaybeAsyncHandlerBridge implements AsyncHandler<Void> { @Override public final Void onCompleted() { if (delegateTerminated.getAndSet(true)) { return null; } final T result; try { result = delegate().onCompleted(); } catch (final Throwable t) { emitOnError(t); return null; } if (!emitter.isDisposed()) { if (result == null) { emitter.onComplete(); } else { emitter.onSuccess(result); } } return null; } protected  AbstractMaybeAsyncHandlerBridge(MaybeEmitter<T> emitter); @Override final State onBodyPartReceived(HttpResponseBodyPart content); @Override final State onStatusReceived(HttpResponseStatus status); @Override final State onHeadersReceived(HttpHeaders headers); @Override State onTrailingHeadersReceived(HttpHeaders headers); @Override final Void onCompleted(); @Override final void onThrowable(Throwable t); @Override void onHostnameResolutionAttempt(String name); @Override void onHostnameResolutionSuccess(String name, List<InetSocketAddress> addresses); @Override void onHostnameResolutionFailure(String name, Throwable cause); @Override void onTcpConnectAttempt(InetSocketAddress remoteAddress); @Override void onTcpConnectSuccess(InetSocketAddress remoteAddress, Channel connection); @Override void onTcpConnectFailure(InetSocketAddress remoteAddress, Throwable cause); @Override void onTlsHandshakeAttempt(); @Override void onTlsHandshakeSuccess(SSLSession sslSession); @Override void onTlsHandshakeFailure(Throwable cause); @Override void onConnectionPoolAttempt(); @Override void onConnectionPooled(Channel connection); @Override void onConnectionOffer(Channel connection); @Override void onRequestSend(NettyRequest request); @Override void onRetry(); }
AbstractMaybeAsyncHandlerBridge implements AsyncHandler<Void> { @Override public final Void onCompleted() { if (delegateTerminated.getAndSet(true)) { return null; } final T result; try { result = delegate().onCompleted(); } catch (final Throwable t) { emitOnError(t); return null; } if (!emitter.isDisposed()) { if (result == null) { emitter.onComplete(); } else { emitter.onSuccess(result); } } return null; } protected  AbstractMaybeAsyncHandlerBridge(MaybeEmitter<T> emitter); @Override final State onBodyPartReceived(HttpResponseBodyPart content); @Override final State onStatusReceived(HttpResponseStatus status); @Override final State onHeadersReceived(HttpHeaders headers); @Override State onTrailingHeadersReceived(HttpHeaders headers); @Override final Void onCompleted(); @Override final void onThrowable(Throwable t); @Override void onHostnameResolutionAttempt(String name); @Override void onHostnameResolutionSuccess(String name, List<InetSocketAddress> addresses); @Override void onHostnameResolutionFailure(String name, Throwable cause); @Override void onTcpConnectAttempt(InetSocketAddress remoteAddress); @Override void onTcpConnectSuccess(InetSocketAddress remoteAddress, Channel connection); @Override void onTcpConnectFailure(InetSocketAddress remoteAddress, Throwable cause); @Override void onTlsHandshakeAttempt(); @Override void onTlsHandshakeSuccess(SSLSession sslSession); @Override void onTlsHandshakeFailure(Throwable cause); @Override void onConnectionPoolAttempt(); @Override void onConnectionPooled(Channel connection); @Override void onConnectionOffer(Channel connection); @Override void onRequestSend(NettyRequest request); @Override void onRetry();  }