diff --git a/httpclient-okhttp/src/test/java/io/fabric8/kubernetes/client/okhttp/OkHttpPostTest.java b/httpclient-okhttp/src/test/java/io/fabric8/kubernetes/client/okhttp/OkHttpPostTest.java index 90753a04a2c..f3f33d07dbc 100644 --- a/httpclient-okhttp/src/test/java/io/fabric8/kubernetes/client/okhttp/OkHttpPostTest.java +++ b/httpclient-okhttp/src/test/java/io/fabric8/kubernetes/client/okhttp/OkHttpPostTest.java @@ -17,7 +17,9 @@ import io.fabric8.kubernetes.client.http.AbstractHttpPostTest; import io.fabric8.kubernetes.client.http.HttpClient; +import org.junit.jupiter.api.condition.OS; +import java.io.InterruptedIOException; import java.net.ConnectException; @SuppressWarnings("java:S2187") @@ -29,6 +31,10 @@ protected HttpClient.Factory getHttpClientFactory() { @Override protected Class getConnectionFailedExceptionType() { - return ConnectException.class; + if (OS.WINDOWS.equals(OS.current())) { + return InterruptedIOException.class; + } else { + return ConnectException.class; + } } } diff --git a/httpclient-okhttp/src/test/java/io/fabric8/kubernetes/client/okhttp/OkHttpPutTest.java b/httpclient-okhttp/src/test/java/io/fabric8/kubernetes/client/okhttp/OkHttpPutTest.java index 34d5ff00356..71bbab0c5b3 100644 --- a/httpclient-okhttp/src/test/java/io/fabric8/kubernetes/client/okhttp/OkHttpPutTest.java +++ b/httpclient-okhttp/src/test/java/io/fabric8/kubernetes/client/okhttp/OkHttpPutTest.java @@ -17,7 +17,9 @@ import io.fabric8.kubernetes.client.http.AbstractHttpPutTest; import io.fabric8.kubernetes.client.http.HttpClient; +import org.junit.jupiter.api.condition.OS; +import java.io.InterruptedIOException; import java.net.ConnectException; @SuppressWarnings("java:S2187") @@ -29,6 +31,10 @@ protected HttpClient.Factory getHttpClientFactory() { @Override protected Class getConnectionFailedExceptionType() { - return ConnectException.class; + if (OS.WINDOWS.equals(OS.current())) { + return InterruptedIOException.class; + } else { + return ConnectException.class; + } } } diff --git a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpPostTest.java b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpPostTest.java index d10a72f69da..47a406f0314 100644 --- a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpPostTest.java +++ b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpPostTest.java @@ -21,8 +21,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -160,7 +158,6 @@ public void expectContinue() throws Exception { } @Test - @DisabledOnOs(OS.WINDOWS) public void expectFailure() throws IOException, URISyntaxException { try (final ServerSocket serverSocket = new ServerSocket(0)) { diff --git a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpPutTest.java b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpPutTest.java index 83326ff05d1..e24dc11a4ca 100644 --- a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpPutTest.java +++ b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpPutTest.java @@ -21,8 +21,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -96,7 +94,6 @@ public void putInputStreamBody() throws Exception { } @Test - @DisabledOnOs(OS.WINDOWS) public void expectFailure() throws IOException, URISyntaxException { try (final ServerSocket serverSocket = new ServerSocket(0)) {