HTTPClientImpl implements HTTPClient { long slowOperationThresholdInNanos(HTTPRequest request) { if (request.slowOperationThreshold != null) return request.slowOperationThreshold.toNanos(); return slowOperationThresholdInNanos; } HTTPClientImpl(OkHttpClient client, String userAgent, Duration slowOperationThreshold); @Override HTTPResponse execute(HTTPRequest request);  }
@Test void slowOperationThresholdInNanos() { var request = new HTTPRequest(HTTPMethod.POST, "http: assertThat(httpClient.slowOperationThresholdInNanos(request)).isEqualTo(Duration.ofSeconds(10).toNanos()); request.slowOperationThreshold = Duration.ofSeconds(1); assertThat(httpClient.slowOperationThresholdInNanos(request)).isEqualTo(Duration.ofSeconds(1).toNanos()); }