File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
spring-boot-project/spring-boot/src/test/java/org/springframework/boot Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -1421,15 +1421,12 @@ void shouldStopKeepAliveThreadIfContextIsClosed() {
14211421 application .setWebApplicationType (WebApplicationType .NONE );
14221422 application .setKeepAlive (true );
14231423 this .context = application .run ();
1424- Set <Thread > threadsBeforeClose = getCurrentThreads ();
1425- assertThat (threadsBeforeClose ).filteredOn ((thread ) -> thread .getName ().equals ("keep-alive" )).isNotEmpty ();
1424+ assertThat (getCurrentThreads ()).filteredOn ((thread ) -> thread .getName ().equals ("keep-alive" )).isNotEmpty ();
14261425 this .context .close ();
1427- Set <Thread > threadsAfterClose = getCurrentThreads ();
14281426 Awaitility .await ()
14291427 .atMost (Duration .ofSeconds (30 ))
1430- .untilAsserted (
1431- () -> assertThat (threadsAfterClose ).filteredOn ((thread ) -> thread .getName ().equals ("keep-alive" ))
1432- .isEmpty ());
1428+ .untilAsserted (() -> assertThat (getCurrentThreads ())
1429+ .filteredOn ((thread ) -> thread .getName ().equals ("keep-alive" )));
14331430 }
14341431
14351432 private <S extends AvailabilityState > ArgumentMatcher <ApplicationEvent > isAvailabilityChangeEventWithState (
You can’t perform that action at this time.
0 commit comments