|
27 | 27 | import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DbSystemNameIncubatingValues.CASSANDRA; |
28 | 28 |
|
29 | 29 | import com.datastax.oss.driver.api.core.CqlSession; |
| 30 | +import com.datastax.oss.driver.api.core.config.DefaultDriverOption; |
| 31 | +import com.datastax.oss.driver.api.core.config.DriverConfigLoader; |
30 | 32 | import com.google.common.collect.ImmutableMap; |
31 | 33 | import io.opentelemetry.api.trace.SpanKind; |
32 | 34 | import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension; |
33 | 35 | import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerUsingTest; |
34 | 36 | import io.opentelemetry.instrumentation.testing.junit.http.HttpServerInstrumentationExtension; |
| 37 | +import java.time.Duration; |
35 | 38 | import org.apache.camel.CamelContext; |
36 | 39 | import org.apache.camel.ProducerTemplate; |
37 | 40 | import org.junit.jupiter.api.AfterAll; |
@@ -97,10 +100,17 @@ protected void cleanUp() { |
97 | 100 | } |
98 | 101 |
|
99 | 102 | static void cassandraSetup() { |
| 103 | + DriverConfigLoader configLoader = |
| 104 | + DriverConfigLoader.programmaticBuilder() |
| 105 | + .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(0)) |
| 106 | + .withDuration(DefaultDriverOption.CONNECTION_INIT_QUERY_TIMEOUT, Duration.ofSeconds(10)) |
| 107 | + .build(); |
| 108 | + |
100 | 109 | try (CqlSession cqlSession = |
101 | 110 | CqlSession.builder() |
102 | 111 | .addContactPoint(cassandra.getContactPoint()) |
103 | 112 | .withLocalDatacenter(cassandra.getLocalDatacenter()) |
| 113 | + .withConfigLoader(configLoader) |
104 | 114 | .build()) { |
105 | 115 | cqlSession.execute( |
106 | 116 | "CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};"); |
|
0 commit comments