Search in sources :

Example 1 with ConfigurableJettyWebServerFactory

use of org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory in project spring-boot by spring-projects.

the class JettyWebServerFactoryCustomizerTests method deduceUseForwardHeaders.

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

Example 2 with ConfigurableJettyWebServerFactory

use of org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory in project spring-boot by spring-projects.

the class JettyWebServerFactoryCustomizerTests method forwardHeadersWhenStrategyIsNativeShouldConfigureValve.

@Test
void forwardHeadersWhenStrategyIsNativeShouldConfigureValve() {
    this.serverProperties.setForwardHeadersStrategy(ServerProperties.ForwardHeadersStrategy.NATIVE);
    ConfigurableJettyWebServerFactory factory = mock(ConfigurableJettyWebServerFactory.class);
    this.customizer.customize(factory);
    then(factory).should().setUseForwardHeaders(true);
}
Also used : ConfigurableJettyWebServerFactory(org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory) Test(org.junit.jupiter.api.Test)

Example 3 with ConfigurableJettyWebServerFactory

use of org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory in project spring-boot by spring-projects.

the class JettyWebServerFactoryCustomizerTests method forwardHeadersWhenStrategyIsNoneShouldNotConfigureValve.

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

Example 4 with ConfigurableJettyWebServerFactory

use of org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory in project spring-boot by spring-projects.

the class JettyWebServerFactoryCustomizerTests method setUseForwardHeaders.

@Test
void setUseForwardHeaders() {
    this.serverProperties.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE);
    ConfigurableJettyWebServerFactory factory = mock(ConfigurableJettyWebServerFactory.class);
    this.customizer.customize(factory);
    then(factory).should().setUseForwardHeaders(true);
}
Also used : ConfigurableJettyWebServerFactory(org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory) Test(org.junit.jupiter.api.Test)

Example 5 with ConfigurableJettyWebServerFactory

use of org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory in project spring-boot by spring-projects.

the class JettyWebServerFactoryCustomizerTests method defaultUseForwardHeaders.

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

Aggregations

Test (org.junit.jupiter.api.Test)5 ConfigurableJettyWebServerFactory (org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory)5