diff --git a/src/test/kotlin/dev/dnpm/etl/processor/AbstractTestcontainerTest.kt b/src/test/kotlin/dev/dnpm/etl/processor/AbstractTestcontainerTest.kt index 3bd934f..13b57d0 100644 --- a/src/test/kotlin/dev/dnpm/etl/processor/AbstractTestcontainerTest.kt +++ b/src/test/kotlin/dev/dnpm/etl/processor/AbstractTestcontainerTest.kt @@ -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(dockerImageName) { + override fun stop() { + // Keep Testcontainer alive until JVM destroys it + } } \ No newline at end of file