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() {
1421
1421
application .setWebApplicationType (WebApplicationType .NONE );
1422
1422
application .setKeepAlive (true );
1423
1423
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 ();
1426
1425
this .context .close ();
1427
- Set <Thread > threadsAfterClose = getCurrentThreads ();
1428
1426
Awaitility .await ()
1429
1427
.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" )));
1433
1430
}
1434
1431
1435
1432
private <S extends AvailabilityState > ArgumentMatcher <ApplicationEvent > isAvailabilityChangeEventWithState (
You can’t perform that action at this time.
0 commit comments