Closed
Description
Alain Sahli opened SPR-13670 and commented
When a test has multiple @ContextConfiguration
annotations defined on a base class and a composed annotation then the one defined on the composed annotation is ignored.
I created a small example that illustrates the issue (see reference URL). In this case the TestAppContext defined on the ComposedAnnotation is ignored and therefore the ComposedAnnotationTest fails because the needed bean does not exist.
If the test class is directly annotated with @ContextConfiguration
instead of using the ComposedAnnotation it works (see WorkingTest).
Affects: 4.1.7
Reference URL: https://gist.github.com/alainsahli/a3d8fd26adc527aa422c
Issue Links:
- Favor more locally declared composed annotations over inherited annotations in the TestContext framework [SPR-12749] #17346 Favor more locally declared composed annotations over inherited annotations in the TestContext framework ("duplicates")
- Ability to use
@ContextConfiguration
directly and as meta-annotation on the same class [SPR-15274] #19839 Ability to use@ContextConfiguration
and a meta@ContextConfiguration
on the same class