File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
src/test/kotlin/tanvd/aorm/utils Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ dependencies {
2626 testImplementation(" org.junit.jupiter" , " junit-jupiter-api" , " 5.6.2" )
2727 testImplementation(" org.junit.jupiter" , " junit-jupiter-engine" , " 5.6.2" )
2828
29- testImplementation(" org.testcontainers" , " testcontainers" , " 1.15.2" )
30- testImplementation(" org.testcontainers" , " junit-jupiter" , " 1.15.2" )
29+ testImplementation(" org.testcontainers" , " testcontainers" , " 1.16.0" )
30+ testImplementation(" org.testcontainers" , " clickhouse" , " 1.16.0" )
31+ testImplementation(" org.testcontainers" , " junit-jupiter" , " 1.16.0" )
3132}
3233
3334tasks.withType<KotlinJvmCompile > {
Original file line number Diff line number Diff line change 11package tanvd.aorm.utils
22
33import org.junit.jupiter.api.BeforeEach
4+ import org.testcontainers.containers.ClickHouseContainer
45import org.testcontainers.junit.jupiter.Container
56import org.testcontainers.junit.jupiter.Testcontainers
67import ru.yandex.clickhouse.ClickHouseDataSource
@@ -14,17 +15,15 @@ import tanvd.aorm.insert.DefaultInsertWorker
1415abstract class AormTestBase {
1516 companion object {
1617 const val testInsertWorkerDelayMs = 2000L
17- private const val containerPort = 8123
1818
1919 @Container
20- val serverContainer: KGenericContainer = KGenericContainer (" yandex/clickhouse-server:21.1" )
21- .withExposedPorts(containerPort)
22- .apply { start() }
20+ val serverContainer = ClickHouseContainer (" yandex/clickhouse-server:21.1" ).apply { start() }
2321 }
2422
2523 val database by lazy {
26- Database (" default" , ClickHouseDataSource (" jdbc:clickhouse://localhost:${serverContainer.getMappedPort(containerPort)} " ,
27- ClickHouseProperties ().withCredentials(" default" , " " )))
24+ Database (" default" , ClickHouseDataSource (serverContainer.jdbcUrl,
25+ ClickHouseProperties ().withCredentials(serverContainer.username, serverContainer.password)
26+ ))
2827 }
2928
3029 val insertWorker by lazy {
You can’t perform that action at this time.
0 commit comments