@Test
void shouldRetryWithConnectionException() {

    assertThat(interceptor.shouldRetry(1, "GET", new HttpTimeoutException("read timeout"))).isTrue();
    assertThat(interceptor.shouldRetry(2, "GET", new ConnectException("connection failed"))).isTrue();
    assertThat(interceptor.shouldRetry(3, "GET", new ConnectException("connection failed"))).isFalse();
    assertThat(interceptor.shouldRetry(1, "GET", new SSLException("Connection reset"))).isTrue();
    assertThat(interceptor.shouldRetry(1, "POST", new HttpConnectTimeoutException("connection timeout"))).isTrue();
    assertThat(interceptor.shouldRetry(1, "POST", new ConnectException("connection refused"))).isTrue();
    /* connect timeout stack trace
    Caused by: java.net.SocketTimeoutException: connect timed out
        at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
        at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
        at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
        at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
        at java.base/java.net.Socket.connect(Unknown Source)
        at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:127)
        at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:268)
        at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:176)
        at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:236)
        at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:109)
    */
    assertThat(interceptor.shouldRetry(1, "POST", new SocketTimeoutException("connect timed out"))).isTrue();
}