Fix broken test in EnableSchedulingTests
Commit 65d163e changed the textual message of an exception thrown by
ScheduledAnnotationBeanPostProcessor.afterSingletonsInstantiated(), and
this in turn caused the withAmbiguousTaskSchedulers_andSingleTask()
method in EnableSchedulingTests to start failing (albeit only during
'Performance' builds).
This commit updates the assertion to match the current implementation of
ScheduledAnnotationBeanPostProcessor.
This commit is contained in:
parent
d5fb829ade
commit
08f3a79821
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -41,6 +41,7 @@ import static org.junit.Assert.*;
|
||||||
* Tests use of @EnableScheduling on @Configuration classes.
|
* Tests use of @EnableScheduling on @Configuration classes.
|
||||||
*
|
*
|
||||||
* @author Chris Beams
|
* @author Chris Beams
|
||||||
|
* @author Sam Brannen
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
*/
|
*/
|
||||||
public class EnableSchedulingTests {
|
public class EnableSchedulingTests {
|
||||||
|
|
@ -142,6 +143,9 @@ public class EnableSchedulingTests {
|
||||||
assertThat(ex.getMessage(), startsWith("More than one TaskScheduler"));
|
assertThat(ex.getMessage(), startsWith("More than one TaskScheduler"));
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
finally {
|
||||||
|
ctx.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EnableScheduling @Configuration
|
@EnableScheduling @Configuration
|
||||||
|
|
@ -236,6 +240,7 @@ public class EnableSchedulingTests {
|
||||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||||
ctx.register(SchedulingEnabled_withAmbiguousTaskSchedulers_butNoActualTasks.class);
|
ctx.register(SchedulingEnabled_withAmbiguousTaskSchedulers_butNoActualTasks.class);
|
||||||
ctx.refresh();
|
ctx.refresh();
|
||||||
|
ctx.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -266,9 +271,12 @@ public class EnableSchedulingTests {
|
||||||
try {
|
try {
|
||||||
ctx.refresh();
|
ctx.refresh();
|
||||||
} catch (IllegalStateException ex) {
|
} catch (IllegalStateException ex) {
|
||||||
assertThat(ex.getMessage(), startsWith("More than one TaskScheduler and/or"));
|
assertThat(ex.getMessage(), startsWith("More than one TaskScheduler exists within the context"));
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
finally {
|
||||||
|
ctx.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue