|
16 | 16 | package com.google.cloud.bigquery.storage.v1; |
17 | 17 |
|
18 | 18 | import static org.junit.jupiter.api.Assertions.assertEquals; |
| 19 | +import static org.junit.jupiter.api.Assertions.assertInstanceOf; |
19 | 20 | import static org.junit.jupiter.api.Assertions.assertThrows; |
20 | 21 | import static org.junit.jupiter.api.Assertions.assertTrue; |
21 | 22 |
|
22 | 23 | import com.google.api.gax.core.NoCredentialsProvider; |
23 | 24 | import com.google.api.gax.grpc.GaxGrpcProperties; |
24 | 25 | import com.google.api.gax.grpc.GrpcStatusCode; |
| 26 | +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; |
25 | 27 | import com.google.api.gax.grpc.testing.LocalChannelProvider; |
26 | 28 | import com.google.api.gax.grpc.testing.MockGrpcService; |
27 | 29 | import com.google.api.gax.grpc.testing.MockServiceHelper; |
|
33 | 35 | import com.google.api.gax.rpc.ResourceExhaustedException; |
34 | 36 | import com.google.api.gax.rpc.ServerStreamingCallable; |
35 | 37 | import com.google.api.gax.rpc.StatusCode; |
| 38 | +import com.google.api.gax.rpc.TransportChannelProvider; |
36 | 39 | import com.google.protobuf.AbstractMessage; |
37 | 40 | import com.google.protobuf.Duration; |
38 | 41 | import com.google.protobuf.Parser; |
@@ -139,6 +142,20 @@ void createReadSessionTest() { |
139 | 142 | GaxGrpcProperties.getDefaultApiClientHeaderPattern())); |
140 | 143 | } |
141 | 144 |
|
| 145 | + @Test |
| 146 | + void readSettingsGrpcChannelDefault() throws IOException { |
| 147 | + BigQueryReadSettings bigQueryReadSettings = BigQueryReadSettings.newBuilder().build(); |
| 148 | + TransportChannelProvider transportChannelProvider = |
| 149 | + bigQueryReadSettings.getTransportChannelProvider(); |
| 150 | + assertInstanceOf(InstantiatingGrpcChannelProvider.class, transportChannelProvider); |
| 151 | + InstantiatingGrpcChannelProvider grpcChannelProvider = |
| 152 | + (InstantiatingGrpcChannelProvider) transportChannelProvider; |
| 153 | + assertEquals(java.time.Duration.ofMinutes(1), grpcChannelProvider.getKeepAliveTimeDuration()); |
| 154 | + assertEquals( |
| 155 | + java.time.Duration.ofMinutes(1), grpcChannelProvider.getKeepAliveTimeoutDuration()); |
| 156 | + assertTrue(grpcChannelProvider.getKeepAliveWithoutCalls()); |
| 157 | + } |
| 158 | + |
142 | 159 | @Test |
143 | 160 | @SuppressWarnings("all") |
144 | 161 | void createReadSessionExceptionTest() throws Exception { |
|
0 commit comments