use of io.grpc.cronet.CronetChannelBuilder.CronetTransportFactory in project grpc-java by grpc.
the class CronetChannelBuilderTest method alwaysUsePut_defaultsToFalse.
@Test
public void alwaysUsePut_defaultsToFalse() throws Exception {
CronetChannelBuilder builder = CronetChannelBuilder.forAddress("address", 1234, mockEngine);
CronetTransportFactory transportFactory = (CronetTransportFactory) builder.buildTransportFactory();
CronetClientTransport transport = (CronetClientTransport) transportFactory.newClientTransport(new InetSocketAddress("localhost", 443), new ClientTransportOptions(), channelLogger);
CronetClientStream stream = transport.newStream(method, new Metadata(), CallOptions.DEFAULT, tracers);
assertFalse(stream.idempotent);
}
use of io.grpc.cronet.CronetChannelBuilder.CronetTransportFactory in project grpc-java by grpc.
the class CronetChannelBuilderTest method alwaysUsePutTrue_cronetStreamIsIdempotent.
@Test
public void alwaysUsePutTrue_cronetStreamIsIdempotent() throws Exception {
CronetChannelBuilder builder = CronetChannelBuilder.forAddress("address", 1234, mockEngine).alwaysUsePut(true);
CronetTransportFactory transportFactory = (CronetTransportFactory) builder.buildTransportFactory();
CronetClientTransport transport = (CronetClientTransport) transportFactory.newClientTransport(new InetSocketAddress("localhost", 443), new ClientTransportOptions(), channelLogger);
CronetClientStream stream = transport.newStream(method, new Metadata(), CallOptions.DEFAULT, tracers);
assertTrue(stream.idempotent);
}
Aggregations