Search in sources :

Example 6 with ConfigurableReactiveWebServerFactory

use of org.springframework.boot.web.reactive.server.ConfigurableReactiveWebServerFactory in project spring-boot by spring-projects.

the class ReactiveWebServerFactoryCustomizerTests method whenShutdownPropertyIsSetThenShutdownIsCustomized.

@Test
void whenShutdownPropertyIsSetThenShutdownIsCustomized() {
    this.properties.setShutdown(Shutdown.GRACEFUL);
    ConfigurableReactiveWebServerFactory factory = mock(ConfigurableReactiveWebServerFactory.class);
    this.customizer.customize(factory);
    ArgumentCaptor<Shutdown> shutdownCaptor = ArgumentCaptor.forClass(Shutdown.class);
    then(factory).should().setShutdown(shutdownCaptor.capture());
    assertThat(shutdownCaptor.getValue()).isEqualTo(Shutdown.GRACEFUL);
}
Also used : ConfigurableReactiveWebServerFactory(org.springframework.boot.web.reactive.server.ConfigurableReactiveWebServerFactory) Shutdown(org.springframework.boot.web.server.Shutdown) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigurableReactiveWebServerFactory (org.springframework.boot.web.reactive.server.ConfigurableReactiveWebServerFactory)6 Test (org.junit.jupiter.api.Test)4 InetAddress (java.net.InetAddress)2 Test (org.junit.Test)2 Shutdown (org.springframework.boot.web.server.Shutdown)1 Ssl (org.springframework.boot.web.server.Ssl)1