spring-boot/spring-boot-project
Andy Wilkinson 468e246dbb Make sure container's started before connection details use it
Prior to this commit, a Testcontainer that was managed as a bean
would not have been started in time if it was accessed before
the bean factory's configuration had been frozen. A common way
for this to occur is when using JPA. The entity manager factory
bean is LoadTimeWeaverAware which causes it to be created before
configuration is frozen. Creating this bean requires the DataSource
which in turn requires the JdbcConnectionDetails and its JDBC URL.
Getting the JDBC URL From the connection details requires the
container hosting the SQL database to have been started.

This commit updates ContainerConnectionDetails, the super-class for
all Testcontainer-based ConnectionDetails implementations, to publish
an event when the Container is retrieved from the details. When this
event is published, TestcontainersLifecycleBeanPostProcessor
initializes all containers that are defined as beans.

Closes gh-40585
2024-05-22 09:15:21 +01:00
..
spring-boot Merge branch '3.1.x' into 3.2.x 2024-05-20 21:06:59 -07:00
spring-boot-actuator Merge branch '3.1.x' into 3.2.x 2024-04-18 12:52:54 -07:00
spring-boot-actuator-autoconfigure Merge branch '3.1.x' into 3.2.x 2024-05-13 11:30:42 +02:00
spring-boot-autoconfigure Use DefaultDbRefResolver whenever MongoDatabaseFactory is available 2024-05-21 10:29:39 +01:00
spring-boot-dependencies Upgrade to Spring Kafka 3.1.5 2024-05-20 20:33:14 +01:00
spring-boot-devtools Merge branch '3.1.x' into 3.2.x 2024-04-19 10:57:47 +01:00
spring-boot-docker-compose Merge branch '3.1.x' into 3.2.x 2024-03-27 09:35:44 +01:00
spring-boot-docs Merge branch '3.1.x' into 3.2.x 2024-05-20 21:06:59 -07:00
spring-boot-parent Minimize scope of version management for commons-compress 2024-02-06 15:08:15 +00:00
spring-boot-starters Upgrade to Tomcat 10.1.24 2024-05-16 15:05:48 +01:00
spring-boot-test Use the bean factory to get the type produced by a factory bean 2024-05-21 15:27:59 +01:00
spring-boot-test-autoconfigure Merge branch '3.1.x' into 3.2.x 2024-04-25 11:07:25 +02:00
spring-boot-testcontainers Make sure container's started before connection details use it 2024-05-22 09:15:21 +01:00
spring-boot-tools Merge branch '3.1.x' into 3.2.x 2024-05-17 11:41:23 -05:00