Fix handling of annotations on super classes in AnnotationsPropertySource
Closes gh-6006
This commit is contained in:
@@ -169,6 +169,22 @@ public class AnnotationsPropertySourceTests {
|
||||
new AnnotationsPropertySource(PropertyMappedWithSelfAnnotatingAnnotation.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void typeLevelAnnotationOnSuperClass() {
|
||||
AnnotationsPropertySource source = new AnnotationsPropertySource(
|
||||
PropertyMappedAnnotationOnSuperClass.class);
|
||||
assertThat(source.getPropertyNames()).containsExactly("value");
|
||||
assertThat(source.getProperty("value")).isEqualTo("abc");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aliasedPropertyMappedAttributeOnSuperClass() {
|
||||
AnnotationsPropertySource source = new AnnotationsPropertySource(
|
||||
AliasedPropertyMappedAnnotationOnSuperClass.class);
|
||||
assertThat(source.getPropertyNames()).containsExactly("aliasing.value");
|
||||
assertThat(source.getProperty("aliasing.value")).isEqualTo("baz");
|
||||
}
|
||||
|
||||
static class NoAnnotation {
|
||||
|
||||
}
|
||||
@@ -359,4 +375,13 @@ public class AnnotationsPropertySourceTests {
|
||||
|
||||
}
|
||||
|
||||
static class PropertyMappedAnnotationOnSuperClass extends TypeLevel {
|
||||
|
||||
}
|
||||
|
||||
static class AliasedPropertyMappedAnnotationOnSuperClass
|
||||
extends PropertyMappedAttributeWithAnAlias {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user