@Test(expected=IllegalStateException.class)
public void withExplicitSchedulerAmbiguity_andSchedulingEnabled() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(AmbiguousExplicitSchedulerConfig.class);
try {
ctx.refresh();
} catch (IllegalStateException ex) {
assertThat(ex.getMessage(), startsWith("More than one TaskScheduler"));
throw ex;
}
}