Annotation Type PropertyMapping

  • @Retention(value=RUNTIME)
    public @interface PropertyMapping
    Indicates that attributes from a test annotation should be mapped into a PropertySource. Can be used at the type level, or on individual attributes. For example, the following annotation declaration:
     public @interface Example {
       String name();
    When used on a test class as follows:
     public class MyTest {
    will result in a property being added with the value "Spring".

    Phillip Webb
    See Also:
    AnnotationsPropertySource, TestPropertySource
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element and Description
      SkipPropertyMapping skip
      Determines if mapping should be skipped.
      String value
      Defines the property mapping.
    • Element Detail

      • value

        public abstract String value
        Defines the property mapping. When used at the type-level, this value will be used as a prefix for all mapped attributes. When used on an attribute, the value overrides the generated (kebab case) name.
        the property mapping
      • skip

        public abstract 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.
        if mapping should be skipped