-
Notifications
You must be signed in to change notification settings - Fork 65
Description
Expected Behavior
I expected that @Value("${propertyName}") will evaluate to the property's value, similar to places where e.g. configuration property is injected into production class' field or consructor parameter.
@Value should behave the same way for test method parameters, regular bean constructor/executable method parameters and bean fields.
Actual Behaviour
For test method parameter, @Value("propertyname") works, however @Value("${propertyName"}) first interpolates the property then attempts to find a property matching the interpolated result - which fails.
Similar for @Value("#{expression"}) that evaluates the xpression first, then attempts to locate property whose name matches the expression's result.
Steps To Reproduce
- Clone https://github.com/sdedic/micronaut-dbbugs2/tree/value_annotation_inconsistent,
value_annotation_inconsistentbranch - Run PropertyExampleTest
Environment Information
- Ubuntu Linux 22.04
- JDK 21
Example Application
https://github.com/sdedic/micronaut-dbbugs2/tree/value_annotation_inconsistent
Version
4.7.6