@Test
public void testConstructorWithProvidedReplacement() {
EmbeddedChannel channel = new EmbeddedChannel();
channel.pipeline().addFirst(NettyPipeline.SslHandler, new ChannelHandlerAdapter() {
});
HttpClientOperations ops1 = new HttpClientOperations(channel,
(response, request) -> null, handler);
ops1.followRedirect();
ops1.failOnClientError(false);
ops1.failOnServerError(false);
HttpClientOperations ops2 = new HttpClientOperations(channel, ops1);
assertSame(ops1.channel(), ops2.channel());
assertSame(ops1.started, ops2.started);
assertSame(ops1.redirectedFrom, ops2.redirectedFrom);
assertSame(ops1.isSecure, ops2.isSecure);
assertSame(ops1.nettyRequest, ops2.nettyRequest);
assertSame(ops1.responseState, ops2.responseState);
assertSame(ops1.redirectable, ops2.redirectable);
assertSame(ops1.inboundPrefetch, ops2.inboundPrefetch);
assertSame(ops1.requestHeaders, ops2.requestHeaders);
assertSame(ops1.clientError, ops2.clientError);
assertSame(ops1.serverError, ops2.serverError);
}
HttpClientOperationsTest.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:reactor-netty
作者:
评论列表
文章目录