|
33 | 33 | import static com.google.common.truth.Truth.assertThat; |
34 | 34 | import static org.junit.Assert.assertThrows; |
35 | 35 |
|
| 36 | +import com.google.api.client.http.javanet.NetHttpTransport; |
36 | 37 | import com.google.api.gax.core.NoCredentialsProvider; |
37 | 38 | import com.google.api.gax.retrying.RetrySettings; |
38 | 39 | import com.google.api.gax.rpc.StatusCode; |
@@ -355,71 +356,7 @@ void testTracing_retry_httpjson() throws Exception { |
355 | 356 | .setTransportChannelProvider( |
356 | 357 | EchoSettings.defaultHttpJsonTransportProviderBuilder() |
357 | 358 | .setHttpTransport( |
358 | | - new com.google.api.client.http.HttpTransport() { |
359 | | - @Override |
360 | | - protected com.google.api.client.http.LowLevelHttpRequest buildRequest( |
361 | | - String method, String url) { |
362 | | - return new com.google.api.client.http.LowLevelHttpRequest() { |
363 | | - @Override |
364 | | - public void addHeader(String name, String value) {} |
365 | | - |
366 | | - @Override |
367 | | - public com.google.api.client.http.LowLevelHttpResponse execute() { |
368 | | - return new com.google.api.client.http.LowLevelHttpResponse() { |
369 | | - @Override |
370 | | - public java.io.InputStream getContent() { |
371 | | - return new java.io.ByteArrayInputStream("{}".getBytes()); |
372 | | - } |
373 | | - |
374 | | - @Override |
375 | | - public String getContentEncoding() { |
376 | | - return null; |
377 | | - } |
378 | | - |
379 | | - @Override |
380 | | - public long getContentLength() { |
381 | | - return 2; |
382 | | - } |
383 | | - |
384 | | - @Override |
385 | | - public String getContentType() { |
386 | | - return "application/json"; |
387 | | - } |
388 | | - |
389 | | - @Override |
390 | | - public String getStatusLine() { |
391 | | - return "HTTP/1.1 503 Service Unavailable"; |
392 | | - } |
393 | | - |
394 | | - @Override |
395 | | - public int getStatusCode() { |
396 | | - return 503; |
397 | | - } |
398 | | - |
399 | | - @Override |
400 | | - public String getReasonPhrase() { |
401 | | - return "Service Unavailable"; |
402 | | - } |
403 | | - |
404 | | - @Override |
405 | | - public int getHeaderCount() { |
406 | | - return 0; |
407 | | - } |
408 | | - |
409 | | - @Override |
410 | | - public String getHeaderName(int index) { |
411 | | - return null; |
412 | | - } |
413 | | - |
414 | | - @Override |
415 | | - public String getHeaderValue(int index) { |
416 | | - return null; |
417 | | - } |
418 | | - }; |
419 | | - } |
420 | | - }; |
421 | | - } |
422 | | - }) |
| 359 | + new NetHttpTransport.Builder().doNotValidateCertificate().build()) |
423 | 360 | .setEndpoint("http://localhost:7469") |
424 | 361 | .build()) |
425 | 362 | .build(); |
|
0 commit comments