Closed
Description
Adam Berlin opened SPR-13748 and commented
The following doesn't work:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(loader = SpringApplicationContextLoader.class)
@ReproduceTest.MyActiveProfile
public class ReproduceTest {
@Autowired
private String value;
@Test
public void itDoesNotPickUpTestPropertiesUsingMetaAnnotation() {
assertEquals("foo", this.value);
}
@ActiveProfiles({"foo"})
public static @interface MyActiveProfile {
}
@Configuration
@Profile("foo")
public static class FooConfig {
@Bean
public String value() {
return "foo";
}
}
}
Affects: 4.1.8
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")
- Favor more locally declared composed annotations over inherited annotations [SPR-11598] #16221 Favor more locally declared composed annotations over inherited annotations