Closed
Description
Magnus Heino opened SPR-7937 and commented
Maybe it's available already? I don't see anything about it though. This seems to work for me...
public class AnnotationConfigApplicationContextLoader implements ContextLoader {
@Override
public String[] processLocations(final Class<?> clazz, final String... locations) {
return locations;
}
@Override
public ApplicationContext loadContext(final String... locations) throws Exception {
return new AnnotationConfigApplicationContext(locations);
}
}
and then...
@ContextConfiguration(locations="se.lantmateriet.dominium", loader=AnnotationConfigApplicationContextLoader.class)
public class MyTests { ... }
Issue Links:
- Provide TestContext support for @Configuration classes [SPR-6184] #10852 Provide TestContext support for
@Configuration
classes