Some testing improvements for Cassandra

* Remove the `cassandra.yaml` from test resources since it does not
have any effect on the clients.
Use `datastax-java-driver.basic.request.timeout` system property instead
with `10 seconds` value to allow Cassandra client to wait for query results
a little more than 2 seconds
* Expose just an IP address for contact endpoint avoiding overhead
with attempts to connect to all addresses returned by `localhost` resolution
* Bring back `log4j-slf4j-impl` dependency since it is required for other libs
This commit is contained in:
Artem Bilan
2022-10-19 17:30:15 -04:00
parent e2d8eeb04d
commit 1c4a474f53
4 changed files with 4 additions and 1887 deletions

View File

@@ -284,6 +284,7 @@ configure(javaProjects) { subproject ->
testRuntimeOnly 'org.apache.logging.log4j:log4j-core'
testRuntimeOnly 'org.apache.logging.log4j:log4j-jcl'
testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j2-impl'
}

View File

@@ -34,12 +34,11 @@ import org.testcontainers.junit.jupiter.Testcontainers;
@Testcontainers(disabledWithoutDocker = true)
public interface CassandraContainerTest {
CassandraContainer<?> CASSANDRA_CONTAINER =
new CassandraContainer<>("cassandra:4.1")
.withConfigurationOverride("cassandra");
CassandraContainer<?> CASSANDRA_CONTAINER = new CassandraContainer<>("cassandra:4.1");
@BeforeAll
static void startContainer() {
System.setProperty("datastax-java-driver.basic.request.timeout", "10 seconds");
CASSANDRA_CONTAINER.start();
}

View File

@@ -48,7 +48,7 @@ public class IntegrationTestConfig extends AbstractReactiveCassandraConfiguratio
@Override
protected String getContactPoints() {
return CassandraContainerTest.CASSANDRA_CONTAINER.getContactPoint().getHostName();
return CassandraContainerTest.CASSANDRA_CONTAINER.getContactPoint().getAddress().getHostAddress();
}
@Override