Skip to content

Commit d46b2d5

Browse files
feat: run test if Envoy is running
1 parent 5c38daa commit d46b2d5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/test/java/com/influxdb/v3/client/InfluxDBClientTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
*/
2222
package com.influxdb.v3.client;
2323

24+
import java.io.IOException;
2425
import java.math.BigInteger;
26+
import java.net.URL;
27+
import java.net.URLConnection;
2528
import java.time.Instant;
2629
import java.util.Map;
2730
import java.util.Properties;
@@ -43,8 +46,14 @@ public class InfluxDBClientTest {
4346
@EnabledIfEnvironmentVariable(named = "TESTING_INFLUXDB_DATABASE", matches = ".*")
4447
@Test
4548
void testQueryProxyAndSslCertificate() {
46-
// This test need Envoy proxy to run at this address
4749
String proxyUrl = "http://127.0.0.1:10000";
50+
try {
51+
// Continue to run this test only if Envoy proxy is running in this address http://127.0.0.1:10000
52+
URLConnection hpCon = new URL(proxyUrl).openConnection();
53+
hpCon.connect();
54+
} catch (IOException e) {
55+
return;
56+
}
4857

4958
// This is real certificate downloaded from https://cloud2.influxdata.com
5059
String certificateFilePath = "src/test/java/com/influxdb/v3/client/testdata/valid-certificates.pem";

0 commit comments

Comments
 (0)