Skip to content

Commit 2d4487a

Browse files
committed
Document @EnableDynamicProperty
Closes gh-56
1 parent 04e88ec commit 2d4487a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ If present, `CommonsExecWebServerFactoryBean` will add the resources `webjars/$b
147147
This is an extension to Spring Boot's existing https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.testcontainers.at-development-time.dynamic-properties[`DynamicPropertyRegistry`].
148148
It allows annotating arbitrary Spring Bean definitions and adding a property that references properties on that Bean.
149149

150+
=== @EnableDynamicProperty
151+
152+
In order to use `@DynamicProperty` annotations, it must be enabled with the `@EnableDynamicProperty` annotation as show below:
153+
154+
[source,java]
155+
----
156+
@Configuration
157+
@EnableDynamicProperty
158+
class MyConfiguration {
159+
// ...
160+
}
161+
----
162+
163+
=== @DynamicProperty Example
150164

151165
For example, the following `@DynamicProperty` definition uses https://docs.spring.io/spring-framework/reference/core/expressions.html[SpEL] with the current Bean as the https://docs.spring.io/spring-framework/reference/core/expressions/evaluation.html[root object] for the value annotation to add a property named `messages.url` to the URL and the arbitrary available port of the `CommonsExecWebServer`:
152166

0 commit comments

Comments
 (0)