1
0
mirror of https://github.com/pcvolkmer/etl-processor.git synced 2025-04-19 17:26:51 +00:00

Keep database testcontainer alive until all tests are done

This commit is contained in:
Paul-Christian Volkmer 2023-08-08 14:58:10 +02:00
parent bcc23f6b14
commit 4051b5094c

View File

@ -28,7 +28,7 @@ abstract class AbstractTestcontainerTest {
companion object {
@Container
val dbContainer = PostgreSQLContainer("postgres:10-alpine")
val dbContainer = CustomPostgreSQLContainer("postgres:10-alpine")
.withDatabaseName("test")
.withUsername("test")
.withPassword("test") ?: throw RuntimeException("Failed to create testcontainer!")
@ -42,4 +42,10 @@ abstract class AbstractTestcontainerTest {
}
}
}
class CustomPostgreSQLContainer(dockerImageName: String) : PostgreSQLContainer<CustomPostgreSQLContainer>(dockerImageName) {
override fun stop() {
// Keep Testcontainer alive until JVM destroys it
}
}