spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.4k stars 40.74k forks source link

DynamicPropertyRegistry in testcontainers still working in 3.4 version #43268

Closed francisco-bru closed 6 days ago

francisco-bru commented 6 days ago

In this point of 3.4 Release notes mention that:

Support for defining dynamic properties by injecting a DynamicPropertyRegistry has been deprecated and attempting to do so will now fail by default.

But it still seems to work and the release documentation still mentions DynamicPropertyRegistry as a mechanism for dynamic properties with test containers.

wilkinsona commented 6 days ago

It's support for injection into a @Bean method that has been deprecated. In other words, instead of the approach described in https://docs.spring.io/spring-boot/3.3/reference/features/dev-services.html#features.dev-services.testcontainers.at-development-time.dynamic-properties, you should now use the approach described in https://docs.spring.io/spring-boot/reference/features/dev-services.html#features.dev-services.testcontainers.at-development-time.dynamic-properties.

@DynamicPropertySource methods, a Spring Framework feature, are unaffected. I've updated the release notes to hopefully make it clear that it's injection into @Bean methods that's affected by the deprecation.