Fix shouldStopKeepAliveThreadIfContextIsClosed()

See gh-38103
This commit is contained in:
Johnny Lim 2023-10-29 19:34:39 +09:00 committed by Moritz Halbritter
parent 4ac654717a
commit 1b6431c219
1 changed files with 3 additions and 2 deletions

View File

@ -1425,8 +1425,9 @@ class SpringApplicationTests {
this.context.close();
Awaitility.await()
.atMost(Duration.ofSeconds(30))
.untilAsserted(() -> assertThat(getCurrentThreads())
.filteredOn((thread) -> thread.getName().equals("keep-alive")));
.untilAsserted(
() -> assertThat(getCurrentThreads()).filteredOn((thread) -> thread.getName().equals("keep-alive"))
.isEmpty());
}
private <S extends AvailabilityState> ArgumentMatcher<ApplicationEvent> isAvailabilityChangeEventWithState(