HttpClientOperations extends HttpOperations<NettyInbound, NettyOutbound> implements HttpClientResponse, HttpClientRequest { void followRedirectPredicate(BiPredicate<HttpClientRequest, HttpClientResponse> predicate) { this.followRedirectPredicate = predicate; } HttpClientOperations(HttpClientOperations replaced);   HttpClientOperations(Connection c, ConnectionObserver listener, ClientCookieEncoder encoder, ClientCookieDecoder decoder); @Override HttpClientRequest addCookie(Cookie cookie); @Override HttpClientOperations addHandlerLast(ChannelHandler handler); @Override HttpClientOperations addHandlerLast(String name, ChannelHandler handler); @Override HttpClientOperations addHandlerFirst(ChannelHandler handler); @Override HttpClientOperations addHandlerFirst(String name, ChannelHandler handler); @Override HttpClientOperations addHandler(ChannelHandler handler); @Override @SuppressWarnings("FutureReturnValueIgnored") HttpClientOperations addHandler(String name, ChannelHandler handler); @Override HttpClientOperations replaceHandler(String name, ChannelHandler handler); @Override HttpClientOperations removeHandler(String name); @Override HttpClientRequest addHeader(CharSequence name, CharSequence value); @Override InetSocketAddress address(); void chunkedTransfer(boolean chunked); @Override HttpClientOperations withConnection(Consumer<? super Connection> withConnection); @Override Map<CharSequence, Set<Cookie>> cookies(); @Override HttpClientRequest header(CharSequence name, CharSequence value); @Override HttpClientRequest headers(HttpHeaders headers); @Override boolean isFollowRedirect(); @Override HttpClientRequest responseTimeout(Duration timeout); @Override boolean isKeepAlive(); @Override boolean isWebsocket(); @Override HttpMethod method(); @Override final HttpClientOperations onDispose(Disposable onDispose); @Override ContextView currentContextView(); @Override String[] redirectedFrom(); @Override HttpHeaders requestHeaders(); @Override HttpHeaders responseHeaders(); @Override NettyOutbound send(Publisher<? extends ByteBuf> source); @Override HttpResponseStatus status(); @Override final String uri(); @Override final String fullPath(); @Override String resourceUrl(); @Override final HttpVersion version();  }
@Test public void testConstructorWithProvidedReplacement() { EmbeddedChannel channel = new EmbeddedChannel(); channel.pipeline().addFirst(NettyPipeline.SslHandler, new ChannelHandlerAdapter() { }); HttpClientOperations ops1 = new HttpClientOperations(() -> channel, ConnectionObserver.emptyListener(), ClientCookieEncoder.STRICT, ClientCookieDecoder.STRICT); ops1.followRedirectPredicate((req, res) -> true); ops1.started = true; ops1.retrying = true; ops1.redirecting = new RedirectClientException(new DefaultHttpHeaders().add(HttpHeaderNames.LOCATION, "/")); HttpClientOperations ops2 = new HttpClientOperations(ops1); assertSame(ops1.channel(), ops2.channel()); assertSame(ops1.started, ops2.started); assertSame(ops1.retrying, ops2.retrying); assertSame(ops1.redirecting, ops2.redirecting); assertSame(ops1.redirectedFrom, ops2.redirectedFrom); assertSame(ops1.isSecure, ops2.isSecure); assertSame(ops1.nettyRequest, ops2.nettyRequest); assertSame(ops1.responseState, ops2.responseState); assertSame(ops1.followRedirectPredicate, ops2.followRedirectPredicate); assertSame(ops1.requestHeaders, ops2.requestHeaders); }