Add support for GET requests for /actuator/startup
See gh-24717
This commit is contained in:
@@ -30,6 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Tests for {@link StartupEndpoint}.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @author Chris Bono
|
||||
*/
|
||||
class StartupEndpointTests {
|
||||
|
||||
@@ -60,6 +61,19 @@ class StartupEndpointTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void bufferIsNotDrained() {
|
||||
BufferingApplicationStartup applicationStartup = new BufferingApplicationStartup(256);
|
||||
ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withInitializer((context) -> context.setApplicationStartup(applicationStartup))
|
||||
.withUserConfiguration(EndpointConfiguration.class);
|
||||
contextRunner.run((context) -> {
|
||||
StartupEndpoint.StartupResponse startup = context.getBean(StartupEndpoint.class).startupSnapshot();
|
||||
assertThat(startup.getTimeline().getEvents()).isNotEmpty();
|
||||
assertThat(applicationStartup.getBufferedTimeline().getEvents()).isNotEmpty();
|
||||
});
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class EndpointConfiguration {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user