Skip to content

Commit 0b2eca6

Browse files
refactor: check proxy
1 parent 89604b5 commit 0b2eca6

File tree

1 file changed

+5
-2
lines changed
  • src/test/java/com/influxdb/v3/client/integration

1 file changed

+5
-2
lines changed

src/test/java/com/influxdb/v3/client/integration/E2ETest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
package com.influxdb.v3.client.integration;
2323

2424
import java.math.BigInteger;
25+
import java.net.ConnectException;
2526
import java.net.URL;
2627
import java.net.URLConnection;
2728
import java.time.Instant;
@@ -59,8 +60,10 @@ void testQueryWithProxy() {
5960
URLConnection hpCon = new URL(url).openConnection();
6061
hpCon.connect();
6162
} catch (Exception e) {
62-
LOG.warning("Tests with proxy have been skipped because no proxy is running on " + proxyUrl);
63-
return;
63+
if (e instanceof ConnectException && e.getMessage().contains("Connection refused")) {
64+
LOG.warning("Tests with proxy have been skipped because no proxy is running on " + proxyUrl);
65+
return;
66+
}
6467
}
6568

6669
ClientConfig clientConfig = new ClientConfig.Builder()

0 commit comments

Comments
 (0)