Search in sources :

Example 1 with BufferingApplicationStartup

use of org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup in project spring-boot by spring-projects.

the class StartupEndpointTests method bufferWithPostIsDrained.

@Test
void bufferWithPostIsDrained() {
    BufferingApplicationStartup applicationStartup = new BufferingApplicationStartup(256);
    testStartupEndpoint(applicationStartup, (startupEndpoint) -> {
        StartupResponse startup = startupEndpoint.startup();
        assertThat(startup.getTimeline().getEvents()).isNotEmpty();
        assertThat(applicationStartup.getBufferedTimeline().getEvents()).isEmpty();
    });
}
Also used : BufferingApplicationStartup(org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup) StartupResponse(org.springframework.boot.actuate.startup.StartupEndpoint.StartupResponse) Test(org.junit.jupiter.api.Test)

Example 2 with BufferingApplicationStartup

use of org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup in project spring-boot by spring-projects.

the class MyApplication method main.

public static void main(String[] args) {
    SpringApplication application = new SpringApplication(MyApplication.class);
    application.setApplicationStartup(new BufferingApplicationStartup(2048));
    application.run(args);
}
Also used : BufferingApplicationStartup(org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup) SpringApplication(org.springframework.boot.SpringApplication)

Example 3 with BufferingApplicationStartup

use of org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup in project spring-boot by spring-projects.

the class StartupEndpointTests method startupEventsAreFound.

@Test
void startupEventsAreFound() {
    BufferingApplicationStartup applicationStartup = new BufferingApplicationStartup(256);
    testStartupEndpoint(applicationStartup, (startupEndpoint) -> {
        StartupResponse startup = startupEndpoint.startup();
        assertThat(startup.getSpringBootVersion()).isEqualTo(SpringBootVersion.getVersion());
        assertThat(startup.getTimeline().getStartTime()).isEqualTo(applicationStartup.getBufferedTimeline().getStartTime());
    });
}
Also used : BufferingApplicationStartup(org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup) StartupResponse(org.springframework.boot.actuate.startup.StartupEndpoint.StartupResponse) Test(org.junit.jupiter.api.Test)

Example 4 with BufferingApplicationStartup

use of org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup in project spring-boot by spring-projects.

the class StartupEndpointTests method bufferWithGetIsNotDrained.

@Test
void bufferWithGetIsNotDrained() {
    BufferingApplicationStartup applicationStartup = new BufferingApplicationStartup(256);
    testStartupEndpoint(applicationStartup, (startupEndpoint) -> {
        StartupResponse startup = startupEndpoint.startupSnapshot();
        assertThat(startup.getTimeline().getEvents()).isNotEmpty();
        assertThat(applicationStartup.getBufferedTimeline().getEvents()).isNotEmpty();
    });
}
Also used : BufferingApplicationStartup(org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup) StartupResponse(org.springframework.boot.actuate.startup.StartupEndpoint.StartupResponse) Test(org.junit.jupiter.api.Test)

Example 5 with BufferingApplicationStartup

use of org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup in project spring-boot-admin by codecentric.

the class SpringBootAdminServletApplication method main.

public static void main(String[] args) {
    SpringApplication app = new SpringApplication(SpringBootAdminServletApplication.class);
    app.setApplicationStartup(new BufferingApplicationStartup(1500));
    app.run(args);
}
Also used : BufferingApplicationStartup(org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup) SpringApplication(org.springframework.boot.SpringApplication)

Aggregations

BufferingApplicationStartup (org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup)5 Test (org.junit.jupiter.api.Test)3 StartupResponse (org.springframework.boot.actuate.startup.StartupEndpoint.StartupResponse)3 SpringApplication (org.springframework.boot.SpringApplication)2