Skip to content

Commit

Permalink
Merge #2892 into 1.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Sep 2, 2023
2 parents 073e3b5 + d9b397c commit 202d3ec
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.publisher.SignalType;
import reactor.core.publisher.Sinks;
import reactor.netty.BaseHttpTest;
import reactor.netty.ByteBufFlux;
import reactor.netty.ChannelBindException;
Expand Down Expand Up @@ -2223,7 +2224,7 @@ void testSniSupportHandshakeTimeout() {
Http11SslContextSpec.forClient()
.configure(builder -> builder.trustManager(InsecureTrustManagerFactory.INSTANCE));

AtomicReference<Throwable> error = new AtomicReference<>();
Sinks.One<Throwable> error = Sinks.one();
disposableServer =
createServer()
.childOption(ChannelOption.RCVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(64))
Expand All @@ -2237,7 +2238,7 @@ void testSniSupportHandshakeTimeout() {
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
if (evt instanceof SniCompletionEvent) {
error.set(((SniCompletionEvent) evt).cause());
error.tryEmitValue(((SniCompletionEvent) evt).cause());
}
ctx.fireUserEventTriggered(evt);
}
Expand All @@ -2256,7 +2257,10 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
.expectError()
.verify(Duration.ofSeconds(5));

assertThat(error.get()).isNotNull().isInstanceOf(SslHandshakeTimeoutException.class);
StepVerifier.create(error.asMono())
.expectNextMatches(t -> t instanceof SslHandshakeTimeoutException)
.expectComplete()
.verify(Duration.ofSeconds(10));
}

@Test
Expand Down

0 comments on commit 202d3ec

Please sign in to comment.