mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
468e246dbb
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 |
||
---|---|---|
.. | ||
checkstyle | ||
nohttp |