use of io.grpc.netty.ProtocolNegotiators.PlaintextProtocolNegotiatorClientFactory in project grpc-java by grpc.
the class NettyChannelBuilderTest method transportFactorySupportsNettyChannelCreds.
@Test
public void transportFactorySupportsNettyChannelCreds() {
NettyChannelBuilder builder = NettyChannelBuilder.forTarget("foo");
ClientTransportFactory transportFactory = builder.buildTransportFactory();
SwapChannelCredentialsResult result = transportFactory.swapChannelCredentials(mock(ChannelCredentials.class));
assertThat(result).isNull();
result = transportFactory.swapChannelCredentials(NettyChannelCredentials.create(new PlaintextProtocolNegotiatorClientFactory()));
assertThat(result).isNotNull();
}
Aggregations