Search in sources :

Example 6 with ConnectionConfig

use of com.palantir.nexus.db.pool.config.ConnectionConfig in project atlasdb by palantir.

the class DbkvsPostgresTestSuite method getKvsConfig.

public static DbKeyValueServiceConfig getKvsConfig() {
    DockerPort port = docker.containers().container("postgres").port(POSTGRES_PORT_NUMBER);
    InetSocketAddress postgresAddress = new InetSocketAddress(port.getIp(), port.getExternalPort());
    ConnectionConfig connectionConfig = ImmutablePostgresConnectionConfig.builder().dbName("atlas").dbLogin("palantir").dbPassword(ImmutableMaskedValue.of("palantir")).host(postgresAddress.getHostName()).port(postgresAddress.getPort()).build();
    return ImmutableDbKeyValueServiceConfig.builder().connection(connectionConfig).ddl(ImmutablePostgresDdlConfig.builder().compactInterval(HumanReadableDuration.days(2)).build()).build();
}
Also used : DockerPort(com.palantir.docker.compose.connection.DockerPort) InetSocketAddress(java.net.InetSocketAddress) ImmutablePostgresConnectionConfig(com.palantir.nexus.db.pool.config.ImmutablePostgresConnectionConfig) ConnectionConfig(com.palantir.nexus.db.pool.config.ConnectionConfig)

Example 7 with ConnectionConfig

use of com.palantir.nexus.db.pool.config.ConnectionConfig in project atlasdb by palantir.

the class PostgresConfigLoadingTest method testHikariConnectTimeout.

@Test
public void testHikariConnectTimeout() throws IOException {
    ConnectionConfig connectionConfig = getConnectionConfig();
    verifyHikariProperty(connectionConfig, "connectTimeout", connectionConfig.getConnectionTimeoutSeconds());
}
Also used : ConnectionConfig(com.palantir.nexus.db.pool.config.ConnectionConfig) Test(org.junit.Test)

Aggregations

ConnectionConfig (com.palantir.nexus.db.pool.config.ConnectionConfig)7 Test (org.junit.Test)6 DockerPort (com.palantir.docker.compose.connection.DockerPort)1 ImmutablePostgresConnectionConfig (com.palantir.nexus.db.pool.config.ImmutablePostgresConnectionConfig)1 InetSocketAddress (java.net.InetSocketAddress)1 Properties (java.util.Properties)1