-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed
Labels
type: regressionA regression from a previous releaseA regression from a previous release
Milestone
Description
From @sleepo581 in #38831 (comment)
After migrating to spring-boot v3.2.1 tests with @ImportTestcontainers
are failing because container is not started.
E.g.:
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'spring.datasource.url' to java.lang.String:
Reason: java.lang.IllegalStateException: Mapped port can only be obtained after the container is started`
public interface Containers {
@Container
PostgreSQLContainer<?> postgresContainer = new PostgreSQLContainer<>("postgres:16.1");
@DynamicPropertySource
static void setConnectionProperties(DynamicPropertyRegistry registry) {
registry.add("spring.datasource.url", postgresContainer::getJdbcUrl);
registry.add("spring.datasource.password", postgresContainer::getPassword);
registry.add("spring.datasource.username", postgresContainer::getUsername);
}
}
Metadata
Metadata
Assignees
Labels
type: regressionA regression from a previous releaseA regression from a previous release