Phil Webb opened SPR-13973 and commented
Given the following annotations:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface MockBeans {
MockBean[] value();
}
@Target({ ElementType.TYPE, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(MockBeans.class)
public @interface MockBean {
@AliasFor("classToMock")
Class<?> value() default Void.class;
@AliasFor("value")
Class<?> classToMock() default Void.class;
}
@Target({ ElementType.TYPE, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@MockBean
public @interface MyMockBean {
@AliasFor(annotation = MockBean.class)
Class<?> value();
}
And the following class:
@MyMockBean(ExampleService.class)
static class MetaMockBean {
}
Calling AnnotationUtils.getRepeatableAnnotations(MetaMockBean.class,MockBean.class, MockBeans.class) will return a synthesized annotation. However, calling value() on the result returns Void.class rather than the expected ExampleService.class.
Is this expected behavior?
Affects: 4.2.4
Issue Links:
Referenced from: commits 4836d06, 46e0484, 2ed3382, b0c6357, c6f6e19, 3597879, d572b02, 2535469, 4fa11e3, c6b1f38, 4742aa0, b6d9fd3
Phil Webb opened SPR-13973 and commented
Given the following annotations:
And the following class:
Calling
AnnotationUtils.getRepeatableAnnotations(MetaMockBean.class,MockBean.class, MockBeans.class)will return a synthesized annotation. However, callingvalue()on the result returnsVoid.classrather than the expectedExampleService.class.Is this expected behavior?
Affects: 4.2.4
Issue Links:
@AliasForfor@JmsListenerattributes ("is depended on by")@Cache* as merged composed annotations@AliasForfor@JmsListenerattributes ("supersedes")Referenced from: commits 4836d06, 46e0484, 2ed3382, b0c6357, c6f6e19, 3597879, d572b02, 2535469, 4fa11e3, c6b1f38, 4742aa0, b6d9fd3