Skip to content

Commit dc40365

Browse files
committed
up
1 parent 7e24306 commit dc40365

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/JmxConnectionTest.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,24 @@
1515
import org.junit.jupiter.api.AfterAll;
1616
import org.junit.jupiter.api.BeforeAll;
1717
import org.junit.jupiter.api.Test;
18-
import org.junit.jupiter.api.condition.EnabledIf;
1918
import org.junit.jupiter.api.io.TempDir;
2019
import org.junit.jupiter.params.ParameterizedTest;
2120
import org.junit.jupiter.params.provider.EnumSource;
2221
import org.slf4j.Logger;
2322
import org.slf4j.LoggerFactory;
24-
import org.testcontainers.DockerClientFactory;
2523
import org.testcontainers.containers.GenericContainer;
2624
import org.testcontainers.containers.Network;
2725
import org.testcontainers.containers.output.Slf4jLogConsumer;
26+
import org.testcontainers.junit.jupiter.Testcontainers;
2827

2928
/**
3029
* Tests all supported ways to connect to remote JMX interface. This indirectly tests
3130
* JmxConnectionBuilder and relies on containers to minimize the JMX/RMI network complications which
3231
* are not NAT-friendly.
3332
*/
34-
@EnabledIf("isDockerAvailable")
33+
@Testcontainers(disabledWithoutDocker = true)
3534
class JmxConnectionTest {
3635

37-
static boolean isDockerAvailable() {
38-
try {
39-
DockerClientFactory.instance().client();
40-
return true;
41-
} catch (Throwable e) {
42-
return false;
43-
}
44-
}
45-
4636
// OTLP endpoint is not used in test mode, but still has to be provided
4737
private static final String DUMMY_OTLP_ENDPOINT = "http://dummy-otlp-endpoint:8080/";
4838
private static final String SCRAPER_BASE_IMAGE = "openjdk:8u342-jre-slim";

0 commit comments

Comments
 (0)