Skip to content

Postgres Testcontainer not working with Spring Boot 4 #48234

@adityamparikh

Description

@adityamparikh

Was looking to upgrade a spring-boot 3.5.x project to spring boot 4 using https://docs.arconia.io/arconia-cli/latest/update/spring-boot/ and saw

Caused by: org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactoryNotFoundException: No ConnectionDetailsFactory found for source '@ServiceConnection source for Bean 'postgresContainer' ... You may need to add a 'name' to your @ServiceConnection annotation.

So I tried bootstrapping a new project from Spring Initializr:

https://start.spring.io/#!type=gradle-project-kotlin&language=java&platformVersion=4.0.0&packaging=jar&configurationFileFormat=properties&jvmVersion=25&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=web,spring-restclient,postgresql,testcontainers
and observe the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: team-attentionAn issue we'd like other members of the team to review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions