Optimize SpEL and property placeholder support for @Async qualifiers

See gh-27818
Closes gh-28549
This commit is contained in:
hebo
2022-06-01 07:46:09 +08:00
committed by Sam Brannen
parent 64412907f7
commit 2434470457
2 changed files with 18 additions and 4 deletions

View File

@@ -146,6 +146,9 @@ public class EnableAsyncTests {
Future<Thread> workerThread2 = asyncBean.myWork2();
assertThat(workerThread2.get().getName()).startsWith("myExecutor2-");
Future<Thread> workerThread3 = asyncBean.defaultExecutor();
assertThat(workerThread3.get().getName()).startsWith("SimpleAsyncTaskExecutor");
}
finally {
System.clearProperty("myExecutor");
@@ -382,6 +385,11 @@ public class EnableAsyncTests {
public Future<Thread> myWork2() {
return new AsyncResult<>(Thread.currentThread());
}
@Async("${my.app.targetExecutor:}")
public Future<Thread> defaultExecutor() {
return new AsyncResult<>(Thread.currentThread());
}
}