-
Notifications
You must be signed in to change notification settings - Fork 40.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DynamicPropertyRegistry in @Bean-method fails with spring-boot-testcontainers dependency in classpath (3.4.0-M1) #41839
Comments
Thanks for the report.
Yes, that's the underlying cause of the regression. Hopefully we can adapt to it in Boot, but we may need a Framework change. |
FYI, @sbrannen. It's not immediately clear to me how to address this one as there's no easy way to compose |
Remove the Spring Framework registered `DynamicPropertyRegistry` when using Testcontainers. See gh-41839
I've put a work-around in for M2, but I think we might need a better long-term solution. In hindsight, we should probably not have used |
I've opened #41996 to follow up on a better long-term solution so that we can close this one and have it appear in the changelog. |
@wilkinsona @philwebb thanks a lot for the fix! Will try the workaround when M2 is available. 😊 |
In Spring Boot until 3.3.x I was able to inject an instance of
DynamicPropertyRegistry
into a@Bean
configuration in my Test classes like this:In Spring Boot 3.4.0-M1 this also does work, but only as long as I do not have
spring-boot-testcontainers
in classpath/pom.xml. With Testcontainers in classpath, Spring Boots complains that two instances of DynamicPropertyRegistry are found:In 3.3.x it works with and without
spring-boot-testcontainers
in pom.xml.I created an example project that shows the behaviour with Spring Boot 3.3.2 and 3.4.0-M1 here: https://github.com/nilshartmann/spring-boot-3-4-dynamic_properties. See
README.md
there how to run the test in 3.3.2 and the failing one in 3.4.0 using Maven.In Spring 6.2.0-M1 I saw this addition recently spring-projects/spring-framework#32271, maybe that is related?
The text was updated successfully, but these errors were encountered: