Search in sources :

Example 6 with ConfigurableUndertowWebServerFactory

use of org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory in project spring-boot by spring-projects.

the class UndertowWebServerFactoryCustomizerTests method deduceUseForwardHeaders.

@Test
void deduceUseForwardHeaders() {
    this.environment.setProperty("DYNO", "-");
    ConfigurableUndertowWebServerFactory factory = mock(ConfigurableUndertowWebServerFactory.class);
    this.customizer.customize(factory);
    then(factory).should().setUseForwardHeaders(true);
}
Also used : ConfigurableUndertowWebServerFactory(org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory) Test(org.junit.jupiter.api.Test)

Example 7 with ConfigurableUndertowWebServerFactory

use of org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory in project spring-boot by spring-projects.

the class UndertowWebServerFactoryCustomizerTests method defaultUseForwardHeaders.

@Test
void defaultUseForwardHeaders() {
    ConfigurableUndertowWebServerFactory factory = mock(ConfigurableUndertowWebServerFactory.class);
    this.customizer.customize(factory);
    then(factory).should().setUseForwardHeaders(false);
}
Also used : ConfigurableUndertowWebServerFactory(org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory) Test(org.junit.jupiter.api.Test)

Example 8 with ConfigurableUndertowWebServerFactory

use of org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory in project spring-boot by spring-projects.

the class UndertowWebServerFactoryCustomizerTests method customizeWorkerThreads.

@Test
void customizeWorkerThreads() {
    bind("server.undertow.threads.worker=10");
    ConfigurableUndertowWebServerFactory factory = mock(ConfigurableUndertowWebServerFactory.class);
    this.customizer.customize(factory);
    then(factory).should().setWorkerThreads(10);
}
Also used : ConfigurableUndertowWebServerFactory(org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory) Test(org.junit.jupiter.api.Test)

Example 9 with ConfigurableUndertowWebServerFactory

use of org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory in project spring-boot by spring-projects.

the class UndertowWebServerFactoryCustomizerTests method forwardHeadersWhenStrategyIsNoneShouldNotConfigureValve.

@Test
void forwardHeadersWhenStrategyIsNoneShouldNotConfigureValve() {
    this.environment.setProperty("DYNO", "-");
    this.serverProperties.setForwardHeadersStrategy(ServerProperties.ForwardHeadersStrategy.NONE);
    ConfigurableUndertowWebServerFactory factory = mock(ConfigurableUndertowWebServerFactory.class);
    this.customizer.customize(factory);
    then(factory).should().setUseForwardHeaders(false);
}
Also used : ConfigurableUndertowWebServerFactory(org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory) Test(org.junit.jupiter.api.Test)

Example 10 with ConfigurableUndertowWebServerFactory

use of org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory in project spring-boot by spring-projects.

the class UndertowWebServerFactoryCustomizerTests method customizeIoThreads.

@Test
void customizeIoThreads() {
    bind("server.undertow.threads.io=4");
    ConfigurableUndertowWebServerFactory factory = mock(ConfigurableUndertowWebServerFactory.class);
    this.customizer.customize(factory);
    then(factory).should().setIoThreads(4);
}
Also used : ConfigurableUndertowWebServerFactory(org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigurableUndertowWebServerFactory (org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebServerFactory)10 Test (org.junit.jupiter.api.Test)7 Builder (io.undertow.Undertow.Builder)2 OptionMap (org.xnio.OptionMap)2 File (java.io.File)1 UndertowBuilderCustomizer (org.springframework.boot.web.embedded.undertow.UndertowBuilderCustomizer)1