CloseableChannel implements Closeable { @Override public void dispose() { channel.dispose(); } CloseableChannel(DisposableChannel channel); InetSocketAddress address(); @Override void dispose(); @Override boolean isDisposed(); @Override Mono<Void> onClose();  }
@Disabled( "NettyContext isDisposed() is not accurate\n" + "https: @DisplayName("disposes context") @Test void dispose() { channel .map(CloseableChannel::new) .delayUntil( closeable -> { closeable.dispose(); return closeable.onClose().log(); }) .as(StepVerifier::create) .assertNext(closeable -> assertThat(closeable.isDisposed()).isTrue()) .verifyComplete(); }