use of com.palantir.nexus.db.pool.config.ConnectionConfig in project atlasdb by palantir.
the class PostgresConfigLoadingTest method testPasswordIsMasked.
@Test
public void testPasswordIsMasked() throws IOException {
ConnectionConfig connectionConfig = getConnectionConfig();
assertThat(connectionConfig.getDbPassword().unmasked(), equalTo("testpassword"));
assertThat(connectionConfig.getHikariProperties().getProperty("password"), equalTo("testpassword"));
assertThat(connectionConfig.toString(), not(containsString("testpassword")));
assertThat(connectionConfig.toString(), containsString("REDACTED"));
}
use of com.palantir.nexus.db.pool.config.ConnectionConfig in project atlasdb by palantir.
the class PostgresConfigLoadingTest method testHikariLoginTimeout.
@Test
public void testHikariLoginTimeout() throws IOException {
ConnectionConfig connectionConfig = getConnectionConfig();
verifyHikariProperty(connectionConfig, "loginTimeout", connectionConfig.getConnectionTimeoutSeconds());
}
use of com.palantir.nexus.db.pool.config.ConnectionConfig in project atlasdb by palantir.
the class PostgresConfigLoadingTest method testAdditionalConnectionParameters.
@Test
public void testAdditionalConnectionParameters() throws IOException {
ConnectionConfig connectionConfig = getConnectionConfig();
Properties props = connectionConfig.getHikariProperties();
assertThat(props.getProperty("foo"), equalTo("100"));
assertThat(props.getProperty("bar"), equalTo("baz"));
}
use of com.palantir.nexus.db.pool.config.ConnectionConfig in project atlasdb by palantir.
the class PostgresConfigLoadingTest method testHikariConnectionTimeout.
@Test
public void testHikariConnectionTimeout() throws IOException {
// Hikari uses "connectionTimeout" for how long the client will wait for a connection from the pool.
// In our parlance, this is checkoutTimeout
// Our connectionTimeout is instead translated to "connectTimeout", which is how long a connection
// can be open for.
ConnectionConfig connectionConfig = getConnectionConfig();
assertThat(connectionConfig.getHikariConfig().getConnectionTimeout(), is((long) connectionConfig.getCheckoutTimeout()));
}
use of com.palantir.nexus.db.pool.config.ConnectionConfig in project atlasdb by palantir.
the class PostgresConfigLoadingTest method testHikariSocketTimeout.
@Test
public void testHikariSocketTimeout() throws IOException {
ConnectionConfig connectionConfig = getConnectionConfig();
verifyHikariProperty(connectionConfig, "socketTimeout", connectionConfig.getSocketTimeoutSeconds());
}
Aggregations