NameResolverProvider { public Duration queryTimeout() { return queryTimeout; } NameResolverProvider(Build build); static NameResolverSpec builder(); Duration cacheMaxTimeToLive(); Duration cacheMinTimeToLive(); Duration cacheNegativeTimeToLive(); boolean isDisableOptionalRecord(); boolean isDisableRecursionDesired(); boolean isPreferNative(); boolean isRoundRobinSelection(); @Nullable LoopResources loopResources(); int maxPayloadSize(); int maxQueriesPerResolve(); int ndots(); Duration queryTimeout(); @Nullable ResolvedAddressTypes resolvedAddressTypes(); @Nullable Iterable<String> searchDomains(); @Override boolean equals(Object o); @Override int hashCode(); DnsAddressResolverGroup newNameResolverGroup(LoopResources defaultLoopResources, boolean defaultPreferNative);  }
@Test public void queryTimeout() { assertThat(builder.build().queryTimeout()).isEqualTo(DEFAULT_QUERY_TIMEOUT); Duration queryTimeout = Duration.ofSeconds(5); builder.queryTimeout(queryTimeout); assertThat(builder.build().queryTimeout()).isEqualTo(queryTimeout); }
@Test public void queryTimeoutBadValues() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> builder.queryTimeout(null)); }