public void setWriteTimeout(int writeTimeout) {
    this.writeTimeout = writeTimeout;
  }
@Test
  public void testRetryableError() throws IOException {
    MockLowLevelHttpResponse[] mockResponses =
        createMockResponseWithStatusCode(
            503, // Retryable
            429, // We also retry on 429 Too Many Requests.
            200);
    when(mockLowLevelRequest.execute())
        .thenReturn(mockResponses[0], mockResponses[1], mockResponses[2]);

    Storage.Buckets.Get result = storage.buckets().get("test");
    HttpResponse response = result.executeUnparsed();
    assertNotNull(response);

    verify(mockHttpResponseInterceptor).interceptResponse(any(HttpResponse.class));
    verify(mockLowLevelRequest, atLeastOnce()).addHeader(anyString(), anyString());
    verify(mockLowLevelRequest, times(3)).setTimeout(anyInt(), anyInt());
    verify(mockLowLevelRequest, times(3)).setWriteTimeout(anyInt());
    verify(mockLowLevelRequest, times(3)).execute();

    // It reads the status code of all responses
    for (MockLowLevelHttpResponse mockResponse : mockResponses) {
      verify(mockResponse, atLeastOnce()).getStatusCode();
    }
    expectedLogs.verifyDebug("Request failed with code 503");
  }