Here is part of my test:
@MicronautTest(startApplication = false)
@Testcontainers(disabledWithoutDocker = true)
class AggMapperIT : TestPropertyProvider {
@Inject
lateinit var aggMapper: AggMapper
companion object {
@Container
@JvmStatic
val postgres: PostgreSQLContainer<*> = PostgreSQLContainer(
DockerImageName.parse("timescale/timescaledb:latest-pg14")
.asCompatibleSubstituteFor("postgres")
)
.withDatabaseName("test")
.withUsername("test")
.withPassword("test")
}
override fun getProperties() = mutableMapOf(
"datasources.default.url" to postgres.jdbcUrl,
"datasources.default.username" to postgres.username,
"datasources.default.password" to postgres.password,
)
By some unknown reason I am getting connection refused as Failed to initialize pool: Connection to localhost:5432 refused.. I completely do not understand why no properties are overriden and container is ignored...
I have tried to fix using gemini,chat gpt,claude, called my friends, hamster and president of the US. Do not suggest tc based jdbc url as I need timescale db.