File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 1515import org .junit .jupiter .api .AfterAll ;
1616import org .junit .jupiter .api .BeforeAll ;
1717import org .junit .jupiter .api .Test ;
18- import org .junit .jupiter .api .condition .EnabledIf ;
1918import org .junit .jupiter .api .io .TempDir ;
2019import org .junit .jupiter .params .ParameterizedTest ;
2120import org .junit .jupiter .params .provider .EnumSource ;
2221import org .slf4j .Logger ;
2322import org .slf4j .LoggerFactory ;
24- import org .testcontainers .DockerClientFactory ;
2523import org .testcontainers .containers .GenericContainer ;
2624import org .testcontainers .containers .Network ;
2725import 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 )
3534class 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" ;
You can’t perform that action at this time.
0 commit comments