Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 16933f0

Browse filesBrowse files
committed
add tests for ServerStreamingCallSettings
1 parent 21c03bd commit 16933f0
Copy full SHA for 16933f0

File tree

Expand file treeCollapse file tree

2 files changed

+23
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+23
-1
lines changed

‎gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java

Copy file name to clipboardExpand all lines: gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030
package com.google.api.gax.rpc;
3131

32-
3332
import com.google.api.core.ApiClock;
3433
import com.google.api.core.InternalApi;
3534
import com.google.common.base.Preconditions;

‎gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingCallSettingsTest.java

Copy file name to clipboardExpand all lines: gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingCallSettingsTest.java
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030
package com.google.api.gax.rpc;
3131

32+
import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod;
3233
import static com.google.common.truth.Truth.assertThat;
3334

3435
import com.google.api.gax.retrying.RetrySettings;
@@ -151,4 +152,26 @@ public void testToString() {
151152
assertThat(serverCallSettings.toString()).contains("retryableCodes=" + retryableCodes);
152153
assertThat(serverCallSettings.toString()).contains("retrySettings=" + retrySettings);
153154
}
155+
156+
@Test
157+
public void testIdleTimeout_backportMethodsBehaveCorrectly() {
158+
final ServerStreamingCallSettings.Builder builder = ServerStreamingCallSettings.newBuilder();
159+
testDurationMethod(
160+
123l,
161+
jt -> builder.setIdleTimeout(jt).build(),
162+
tt -> builder.setIdleTimeout(tt).build(),
163+
cs -> cs.getIdleTimeoutDuration(),
164+
cs -> cs.getIdleTimeout());
165+
}
166+
167+
@Test
168+
public void testWaitTimeout_backportMethodsBehaveCorrectly() {
169+
final ServerStreamingCallSettings.Builder builder = ServerStreamingCallSettings.newBuilder();
170+
testDurationMethod(
171+
123l,
172+
jt -> builder.setWaitTimeout(jt).build(),
173+
tt -> builder.setWaitTimeout(tt).build(),
174+
cs -> cs.getWaitTimeoutDuration(),
175+
cs -> cs.getWaitTimeout());
176+
}
154177
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.