Skip to content

Latest commit

 

History

History
51 lines (41 loc) · 1.76 KB

File metadata and controls

51 lines (41 loc) · 1.76 KB

embedded-clickhouse

Maven dependency

pom.xml
<dependency>
    <groupId>com.playtika.testcontainers</groupId>
    <artifactId>embedded-clickhouse</artifactId>
    <scope>test</scope>
</dependency>

Consumes (via bootstrap.properties)

  • embedded.clickhouse.enabled (true|false, default is true)

  • embedded.clickhouse.reuseContainer (true|false, default is false)

  • embedded.clickhouse.dockerImage (default is 'clickhouse/clickhouse-server:24.12.1')

  • embedded.clickhouse.user (default is 'default')

  • embedded.clickhouse.password (default is '')

  • embedded.clickhouse.initScriptPath (default is null)

  • embedded.toxiproxy.proxies.clickhouse.enabled Enables both creation of the container with ToxiProxy TCP proxy and a proxy to the embedded-clickhouse container.

Produces

  • embedded.clickhouse.schema

  • embedded.clickhouse.host

  • embedded.clickhouse.port

  • embedded.clickhouse.user

  • embedded.clickhouse.password

  • embedded.clickhouse.toxiproxy.host

  • embedded.clickhouse.toxiproxy.port

  • embedded.clickhouse.networkAlias

  • embedded.clickhouse.internalPort

  • Bean ToxiproxyContainer.ContainerProxy clickhouseContainerProxy

Example

To auto-configure spring-jdbc use these properties in your test application.properties:

/src/test/resources/application.properties
spring.datasource.driver-class-name=ru.yandex.clickhouse.ClickHouseDriver
spring.datasource.url=jdbc:clickhouse://${embedded.clickhouse.host}:${embedded.clickhouse.port}/${embedded.clickhouse.schema}
spring.datasource.username=${embedded.clickhouse.user}
spring.datasource.password=${embedded.clickhouse.password}