@Test
public void defaultRetriesCorrectly() throws Exception {

  assertThat(RetryDeterminer.DEFAULT.shouldRetry(new SocketTimeoutException())).isTrue();
  assertThat(
          RetryDeterminer.SOCKET_ERRORS.shouldRetry(
              new SSLException("test", new SocketException())))
      .isTrue();
  assertThat(RetryDeterminer.SOCKET_ERRORS.shouldRetry(new SSLException("invalid certificate")))
      .isFalse();
  assertThat(RetryDeterminer.DEFAULT.shouldRetry(new IllegalArgumentException())).isFalse();
  assertThat(RetryDeterminer.DEFAULT.shouldRetry(new InterruptedException())).isFalse();
  assertThat(RetryDeterminer.DEFAULT.shouldRetry(makeHttpException(300))).isFalse();
  assertThat(RetryDeterminer.DEFAULT.shouldRetry(makeHttpException(504))).isTrue();
  assertThat(RetryDeterminer.DEFAULT.shouldRetry(makeHttpException(500))).isTrue();
  assertThat(RetryDeterminer.DEFAULT.shouldRetry(makeHttpException(599))).isTrue();
  assertThat(RetryDeterminer.DEFAULT.shouldRetry(makeHttpException(499))).isFalse();
}