Annotation Type PropertyMapping
@Retention(RUNTIME) @Target({TYPE,METHOD}) @Documented public @interface PropertyMapping
Indicates that attributes from a test annotation should be mapped into aPropertySource
. Can be used at the type level, or on individual attributes. For example, the following annotation declaration:@Retention(RUNTIME) @PropertyMapping("my.example") public @interface Example { String name(); }
When used on a test class as follows:@Example(name="Spring") public class MyTest { }
will result in a my.example.name property being added with the value "Spring".- Since:
- 1.4.0
- See Also:
AnnotationsPropertySource
,TestPropertySource
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description SkipPropertyMapping
skip
Determines if mapping should be skipped.String
value
Defines the property mapping.
skip
SkipPropertyMapping skip
Determines if mapping should be skipped. When specified at the type-level indicates if skipping should occur by default or not. When used at the attribute-level, overrides the type-level default.- Returns:
- if mapping should be skipped
- Default:
- org.springframework.boot.test.autoconfigure.properties.SkipPropertyMapping.NO