Search in sources :

Example 46 with NettyContext

use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.

the class HttpServerTests method doTestSendFileAsync.

private void doTestSendFileAsync(int chunk) throws IOException, URISyntaxException {
    Path largeFile = Paths.get(getClass().getResource("/largeFile.txt").toURI());
    Path tempFile = Files.createTempFile(largeFile.getParent(), "temp", ".txt");
    tempFile.toFile().deleteOnExit();
    byte[] fileBytes = Files.readAllBytes(largeFile);
    for (int i = 0; i < 1000; i++) {
        Files.write(tempFile, fileBytes, StandardOpenOption.APPEND);
    }
    ByteBufAllocator allocator = ByteBufAllocator.DEFAULT;
    AsynchronousFileChannel channel = AsynchronousFileChannel.open(tempFile, StandardOpenOption.READ);
    Flux<ByteBuf> content = Flux.create(fluxSink -> {
        fluxSink.onDispose(() -> {
            try {
                if (channel != null) {
                    channel.close();
                }
            } catch (IOException ignored) {
            }
        });
        ByteBuffer buf = ByteBuffer.allocate(chunk);
        channel.read(buf, 0, buf, new TestCompletionHandler(channel, fluxSink, allocator, chunk));
    });
    NettyContext context = HttpServer.create(opt -> opt.host("localhost")).newHandler((req, resp) -> resp.sendByteArray(req.receive().aggregate().asByteArray())).block();
    byte[] response = HttpClient.create(opt -> opt.connectAddress(() -> context.address())).request(HttpMethod.POST, "/", req -> req.send(content).then()).flatMap(res -> res.receive().aggregate().asByteArray()).block();
    assertThat(response).isEqualTo(Files.readAllBytes(tempFile));
    context.dispose();
}
Also used : Path(java.nio.file.Path) AsynchronousFileChannel(java.nio.channels.AsynchronousFileChannel) HttpResources(reactor.ipc.netty.http.HttpResources) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) StepVerifier(reactor.test.StepVerifier) DefaultFullHttpRequest(io.netty.handler.codec.http.DefaultFullHttpRequest) ByteBufAllocator(io.netty.buffer.ByteBufAllocator) URISyntaxException(java.net.URISyntaxException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TimeoutException(java.util.concurrent.TimeoutException) NettyOutbound(reactor.ipc.netty.NettyOutbound) ByteBuffer(java.nio.ByteBuffer) Unpooled(io.netty.buffer.Unpooled) HttpClientCodec(io.netty.handler.codec.http.HttpClientCodec) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) Future(java.util.concurrent.Future) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Path(java.nio.file.Path) Context(reactor.util.context.Context) StandardOpenOption(java.nio.file.StandardOpenOption) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) FileSystem(java.nio.file.FileSystem) InetSocketAddress(java.net.InetSocketAddress) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) CountDownLatch(java.util.concurrent.CountDownLatch) SSLException(javax.net.ssl.SSLException) LineBasedFrameDecoder(io.netty.handler.codec.LineBasedFrameDecoder) ByteBufFlux(reactor.ipc.netty.ByteBufFlux) HttpVersion(io.netty.handler.codec.http.HttpVersion) FluxSink(reactor.core.publisher.FluxSink) Tuple3(reactor.util.function.Tuple3) Tuple2(reactor.util.function.Tuple2) AsynchronousFileChannel(java.nio.channels.AsynchronousFileChannel) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) StandardCopyOption(java.nio.file.StandardCopyOption) InsecureTrustManagerFactory(io.netty.handler.ssl.util.InsecureTrustManagerFactory) ByteBuf(io.netty.buffer.ByteBuf) Assert(org.testng.Assert) HttpClient(reactor.ipc.netty.http.client.HttpClient) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ExecutorService(java.util.concurrent.ExecutorService) TcpClient(reactor.ipc.netty.tcp.TcpClient) SslContext(io.netty.handler.ssl.SslContext) Files(java.nio.file.Files) SelfSignedCertificate(io.netty.handler.ssl.util.SelfSignedCertificate) FutureMono(reactor.ipc.netty.FutureMono) CompletionHandler(java.nio.channels.CompletionHandler) HttpMethod(io.netty.handler.codec.http.HttpMethod) IOException(java.io.IOException) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) CertificateException(java.security.cert.CertificateException) PoolResources(reactor.ipc.netty.resources.PoolResources) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) DefaultHttpContent(io.netty.handler.codec.http.DefaultHttpContent) AtomicLong(java.util.concurrent.atomic.AtomicLong) Flux(reactor.core.publisher.Flux) Paths(java.nio.file.Paths) NettyContext(reactor.ipc.netty.NettyContext) SslContextBuilder(io.netty.handler.ssl.SslContextBuilder) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) FileSystems(java.nio.file.FileSystems) ByteBufAllocator(io.netty.buffer.ByteBufAllocator) IOException(java.io.IOException) ByteBuf(io.netty.buffer.ByteBuf) ByteBuffer(java.nio.ByteBuffer) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) NettyContext(reactor.ipc.netty.NettyContext)

Example 47 with NettyContext

use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.

the class HttpServerTests method httpPipelining.

@Test
public void httpPipelining() throws Exception {
    AtomicInteger i = new AtomicInteger();
    NettyContext server = HttpServer.create(0).newHandler((req, resp) -> resp.header(HttpHeaderNames.CONTENT_LENGTH, "1").sendString(Mono.just(i.incrementAndGet()).flatMap(d -> Mono.delay(Duration.ofSeconds(4 - d)).map(x -> d + "\n")))).block(Duration.ofSeconds(30));
    DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/plaintext");
    CountDownLatch latch = new CountDownLatch(6);
    NettyContext client = TcpClient.create(server.address().getPort()).newHandler((in, out) -> {
        in.context().addHandlerFirst(new HttpClientCodec());
        in.receiveObject().ofType(DefaultHttpContent.class).as(ByteBufFlux::fromInbound).asString().log().map(Integer::parseInt).subscribe(d -> {
            for (int x = 0; x < d; x++) {
                latch.countDown();
            }
        });
        return out.sendObject(Flux.just(request.retain(), request.retain(), request.retain())).neverComplete();
    }).block(Duration.ofSeconds(30));
    Assert.assertTrue(latch.await(45, TimeUnit.SECONDS));
    server.dispose();
    client.dispose();
}
Also used : HttpResources(reactor.ipc.netty.http.HttpResources) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) StepVerifier(reactor.test.StepVerifier) DefaultFullHttpRequest(io.netty.handler.codec.http.DefaultFullHttpRequest) ByteBufAllocator(io.netty.buffer.ByteBufAllocator) URISyntaxException(java.net.URISyntaxException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TimeoutException(java.util.concurrent.TimeoutException) NettyOutbound(reactor.ipc.netty.NettyOutbound) ByteBuffer(java.nio.ByteBuffer) Unpooled(io.netty.buffer.Unpooled) HttpClientCodec(io.netty.handler.codec.http.HttpClientCodec) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) Future(java.util.concurrent.Future) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Path(java.nio.file.Path) Context(reactor.util.context.Context) StandardOpenOption(java.nio.file.StandardOpenOption) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) FileSystem(java.nio.file.FileSystem) InetSocketAddress(java.net.InetSocketAddress) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) CountDownLatch(java.util.concurrent.CountDownLatch) SSLException(javax.net.ssl.SSLException) LineBasedFrameDecoder(io.netty.handler.codec.LineBasedFrameDecoder) ByteBufFlux(reactor.ipc.netty.ByteBufFlux) HttpVersion(io.netty.handler.codec.http.HttpVersion) FluxSink(reactor.core.publisher.FluxSink) Tuple3(reactor.util.function.Tuple3) Tuple2(reactor.util.function.Tuple2) AsynchronousFileChannel(java.nio.channels.AsynchronousFileChannel) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) StandardCopyOption(java.nio.file.StandardCopyOption) InsecureTrustManagerFactory(io.netty.handler.ssl.util.InsecureTrustManagerFactory) ByteBuf(io.netty.buffer.ByteBuf) Assert(org.testng.Assert) HttpClient(reactor.ipc.netty.http.client.HttpClient) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ExecutorService(java.util.concurrent.ExecutorService) TcpClient(reactor.ipc.netty.tcp.TcpClient) SslContext(io.netty.handler.ssl.SslContext) Files(java.nio.file.Files) SelfSignedCertificate(io.netty.handler.ssl.util.SelfSignedCertificate) FutureMono(reactor.ipc.netty.FutureMono) CompletionHandler(java.nio.channels.CompletionHandler) HttpMethod(io.netty.handler.codec.http.HttpMethod) IOException(java.io.IOException) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) CertificateException(java.security.cert.CertificateException) PoolResources(reactor.ipc.netty.resources.PoolResources) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) DefaultHttpContent(io.netty.handler.codec.http.DefaultHttpContent) AtomicLong(java.util.concurrent.atomic.AtomicLong) Flux(reactor.core.publisher.Flux) Paths(java.nio.file.Paths) NettyContext(reactor.ipc.netty.NettyContext) SslContextBuilder(io.netty.handler.ssl.SslContextBuilder) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) FileSystems(java.nio.file.FileSystems) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) DefaultFullHttpRequest(io.netty.handler.codec.http.DefaultFullHttpRequest) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) CountDownLatch(java.util.concurrent.CountDownLatch) HttpClientCodec(io.netty.handler.codec.http.HttpClientCodec) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) NettyContext(reactor.ipc.netty.NettyContext) Test(org.junit.Test)

Example 48 with NettyContext

use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.

the class HttpServerTests method testConnectionCloseOnServerError.

@Test
public void testConnectionCloseOnServerError() throws Exception {
    Flux<String> content = Flux.range(1, 3).doOnNext(i -> {
        if (i == 3) {
            throw new RuntimeException("test");
        }
    }).map(i -> "foo " + i);
    NettyContext server = HttpServer.create(0).newHandler((req, res) -> res.sendString(content)).block(Duration.ofSeconds(30));
    HttpClientResponse r = HttpClient.create(ops -> ops.port(server.address().getPort())).get("/").block(Duration.ofSeconds(30));
    ByteBufFlux response = r.receive();
    StepVerifier.create(response).expectNextCount(2).expectError(IOException.class).verify(Duration.ofSeconds(30));
    FutureMono.from(r.context().channel().closeFuture()).block(Duration.ofSeconds(30));
    r.dispose();
    server.dispose();
}
Also used : HttpResources(reactor.ipc.netty.http.HttpResources) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) StepVerifier(reactor.test.StepVerifier) DefaultFullHttpRequest(io.netty.handler.codec.http.DefaultFullHttpRequest) ByteBufAllocator(io.netty.buffer.ByteBufAllocator) URISyntaxException(java.net.URISyntaxException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TimeoutException(java.util.concurrent.TimeoutException) NettyOutbound(reactor.ipc.netty.NettyOutbound) ByteBuffer(java.nio.ByteBuffer) Unpooled(io.netty.buffer.Unpooled) HttpClientCodec(io.netty.handler.codec.http.HttpClientCodec) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) Future(java.util.concurrent.Future) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Path(java.nio.file.Path) Context(reactor.util.context.Context) StandardOpenOption(java.nio.file.StandardOpenOption) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) FileSystem(java.nio.file.FileSystem) InetSocketAddress(java.net.InetSocketAddress) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) CountDownLatch(java.util.concurrent.CountDownLatch) SSLException(javax.net.ssl.SSLException) LineBasedFrameDecoder(io.netty.handler.codec.LineBasedFrameDecoder) ByteBufFlux(reactor.ipc.netty.ByteBufFlux) HttpVersion(io.netty.handler.codec.http.HttpVersion) FluxSink(reactor.core.publisher.FluxSink) Tuple3(reactor.util.function.Tuple3) Tuple2(reactor.util.function.Tuple2) AsynchronousFileChannel(java.nio.channels.AsynchronousFileChannel) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) StandardCopyOption(java.nio.file.StandardCopyOption) InsecureTrustManagerFactory(io.netty.handler.ssl.util.InsecureTrustManagerFactory) ByteBuf(io.netty.buffer.ByteBuf) Assert(org.testng.Assert) HttpClient(reactor.ipc.netty.http.client.HttpClient) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ExecutorService(java.util.concurrent.ExecutorService) TcpClient(reactor.ipc.netty.tcp.TcpClient) SslContext(io.netty.handler.ssl.SslContext) Files(java.nio.file.Files) SelfSignedCertificate(io.netty.handler.ssl.util.SelfSignedCertificate) FutureMono(reactor.ipc.netty.FutureMono) CompletionHandler(java.nio.channels.CompletionHandler) HttpMethod(io.netty.handler.codec.http.HttpMethod) IOException(java.io.IOException) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) CertificateException(java.security.cert.CertificateException) PoolResources(reactor.ipc.netty.resources.PoolResources) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) DefaultHttpContent(io.netty.handler.codec.http.DefaultHttpContent) AtomicLong(java.util.concurrent.atomic.AtomicLong) Flux(reactor.core.publisher.Flux) Paths(java.nio.file.Paths) NettyContext(reactor.ipc.netty.NettyContext) SslContextBuilder(io.netty.handler.ssl.SslContextBuilder) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) FileSystems(java.nio.file.FileSystems) ByteBufFlux(reactor.ipc.netty.ByteBufFlux) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) IOException(java.io.IOException) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) NettyContext(reactor.ipc.netty.NettyContext) Test(org.junit.Test)

Example 49 with NettyContext

use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.

the class HttpServerTests method contextShouldBeTransferredFromDownStreamToUpsream.

@Test
public void contextShouldBeTransferredFromDownStreamToUpsream() {
    AtomicReference<Context> context = new AtomicReference<>();
    NettyContext server = HttpServer.create(0).newHandler((req, res) -> res.status(200).send()).block(Duration.ofSeconds(300));
    HttpClient client = HttpClient.create(ops -> ops.connectAddress(() -> server.address()).poolResources(PoolResources.fixed("test", 1)));
    try {
        Mono<String> content = client.post("/", req -> req.failOnClientError(false).sendString(Mono.just("bodysample").subscriberContext(c -> {
            context.set(c);
            return c;
        }))).flatMap(res -> res.receive().aggregate().asString()).subscriberContext(c -> c.put("Hello", "World"));
        StepVerifier.create(content).expectComplete().verify(Duration.ofSeconds(300));
        assertThat(context.get().get("Hello").equals("World")).isTrue();
    } finally {
        server.dispose();
    }
}
Also used : BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) Context(reactor.util.context.Context) SslContext(io.netty.handler.ssl.SslContext) NettyContext(reactor.ipc.netty.NettyContext) HttpResources(reactor.ipc.netty.http.HttpResources) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) StepVerifier(reactor.test.StepVerifier) DefaultFullHttpRequest(io.netty.handler.codec.http.DefaultFullHttpRequest) ByteBufAllocator(io.netty.buffer.ByteBufAllocator) URISyntaxException(java.net.URISyntaxException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TimeoutException(java.util.concurrent.TimeoutException) NettyOutbound(reactor.ipc.netty.NettyOutbound) ByteBuffer(java.nio.ByteBuffer) Unpooled(io.netty.buffer.Unpooled) HttpClientCodec(io.netty.handler.codec.http.HttpClientCodec) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) Future(java.util.concurrent.Future) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Path(java.nio.file.Path) Context(reactor.util.context.Context) StandardOpenOption(java.nio.file.StandardOpenOption) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) FileSystem(java.nio.file.FileSystem) InetSocketAddress(java.net.InetSocketAddress) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) CountDownLatch(java.util.concurrent.CountDownLatch) SSLException(javax.net.ssl.SSLException) LineBasedFrameDecoder(io.netty.handler.codec.LineBasedFrameDecoder) ByteBufFlux(reactor.ipc.netty.ByteBufFlux) HttpVersion(io.netty.handler.codec.http.HttpVersion) FluxSink(reactor.core.publisher.FluxSink) Tuple3(reactor.util.function.Tuple3) Tuple2(reactor.util.function.Tuple2) AsynchronousFileChannel(java.nio.channels.AsynchronousFileChannel) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) StandardCopyOption(java.nio.file.StandardCopyOption) InsecureTrustManagerFactory(io.netty.handler.ssl.util.InsecureTrustManagerFactory) ByteBuf(io.netty.buffer.ByteBuf) Assert(org.testng.Assert) HttpClient(reactor.ipc.netty.http.client.HttpClient) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ExecutorService(java.util.concurrent.ExecutorService) TcpClient(reactor.ipc.netty.tcp.TcpClient) SslContext(io.netty.handler.ssl.SslContext) Files(java.nio.file.Files) SelfSignedCertificate(io.netty.handler.ssl.util.SelfSignedCertificate) FutureMono(reactor.ipc.netty.FutureMono) CompletionHandler(java.nio.channels.CompletionHandler) HttpMethod(io.netty.handler.codec.http.HttpMethod) IOException(java.io.IOException) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) CertificateException(java.security.cert.CertificateException) PoolResources(reactor.ipc.netty.resources.PoolResources) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) DefaultHttpContent(io.netty.handler.codec.http.DefaultHttpContent) AtomicLong(java.util.concurrent.atomic.AtomicLong) Flux(reactor.core.publisher.Flux) Paths(java.nio.file.Paths) NettyContext(reactor.ipc.netty.NettyContext) SslContextBuilder(io.netty.handler.ssl.SslContextBuilder) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) FileSystems(java.nio.file.FileSystems) HttpClient(reactor.ipc.netty.http.client.HttpClient) AtomicReference(java.util.concurrent.atomic.AtomicReference) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) NettyContext(reactor.ipc.netty.NettyContext) Test(org.junit.Test)

Example 50 with NettyContext

use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.

the class NettyOptionsTest method afterChannelInitAfterChannelGroup.

@Test
public void afterChannelInitAfterChannelGroup() {
    // this test only differs from afterChannelInitThenChannelGroup in the order of the options
    ChannelGroup group = new DefaultChannelGroup(null);
    List<Channel> initializedChannels = new ArrayList<>();
    NettyContext nettyContext = HttpServer.create(opt -> opt.channelGroup(group).afterChannelInit(initializedChannels::add)).start((req, resp) -> resp.sendNotFound()).getContext();
    HttpClientResponse resp = HttpClient.create(opt -> opt.connectAddress(() -> nettyContext.address())).get("/", req -> req.failOnClientError(false).send()).block();
    assertThat((Iterable<Channel>) group).hasSize(1).hasSameElementsAs(initializedChannels).doesNotContain(nettyContext.channel());
    resp.dispose();
    nettyContext.dispose();
}
Also used : DefaultChannelGroup(io.netty.channel.group.DefaultChannelGroup) ChannelGroup(io.netty.channel.group.ChannelGroup) DefaultChannelGroup(io.netty.channel.group.DefaultChannelGroup) ChannelInboundHandlerAdapter(io.netty.channel.ChannelInboundHandlerAdapter) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) ArrayList(java.util.ArrayList) Channel(io.netty.channel.Channel) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) List(java.util.List) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) NettyContext(reactor.ipc.netty.NettyContext) HttpClient(reactor.ipc.netty.http.client.HttpClient) HttpServer(reactor.ipc.netty.http.server.HttpServer) Channel(io.netty.channel.Channel) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) ArrayList(java.util.ArrayList) ChannelGroup(io.netty.channel.group.ChannelGroup) DefaultChannelGroup(io.netty.channel.group.DefaultChannelGroup) NettyContext(reactor.ipc.netty.NettyContext) Test(org.junit.Test)

Aggregations

NettyContext (reactor.ipc.netty.NettyContext)92 Test (org.junit.Test)87 Mono (reactor.core.publisher.Mono)86 Duration (java.time.Duration)83 Flux (reactor.core.publisher.Flux)78 InetSocketAddress (java.net.InetSocketAddress)65 HttpServer (reactor.ipc.netty.http.server.HttpServer)63 HttpClient (reactor.ipc.netty.http.client.HttpClient)61 CountDownLatch (java.util.concurrent.CountDownLatch)60 StepVerifier (reactor.test.StepVerifier)60 AtomicReference (java.util.concurrent.atomic.AtomicReference)56 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)53 Unpooled (io.netty.buffer.Unpooled)50 TimeUnit (java.util.concurrent.TimeUnit)44 StandardCharsets (java.nio.charset.StandardCharsets)43 Ignore (org.junit.Ignore)43 SslContext (io.netty.handler.ssl.SslContext)42 SslContextBuilder (io.netty.handler.ssl.SslContextBuilder)42 InsecureTrustManagerFactory (io.netty.handler.ssl.util.InsecureTrustManagerFactory)42 SelfSignedCertificate (io.netty.handler.ssl.util.SelfSignedCertificate)42