Search in sources :

Example 1 with NettyReactiveWebServerFactory

use of org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory in project spring-boot by spring-projects.

the class NettyWebServerFactoryCustomizerTests method deduceUseForwardHeaders.

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

Example 2 with NettyReactiveWebServerFactory

use of org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory in project spring-boot by spring-projects.

the class NettyWebServerFactoryCustomizerTests method forwardHeadersWhenStrategyIsNativeShouldConfigureValve.

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

Example 3 with NettyReactiveWebServerFactory

use of org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory in project spring-boot by spring-projects.

the class NettyWebServerFactoryCustomizerTests method setMaxKeepAliveRequests.

@Test
void setMaxKeepAliveRequests() {
    this.serverProperties.getNetty().setMaxKeepAliveRequests(100);
    NettyReactiveWebServerFactory factory = mock(NettyReactiveWebServerFactory.class);
    this.customizer.customize(factory);
    verifyMaxKeepAliveRequests(factory, 100);
}
Also used : NettyReactiveWebServerFactory(org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory) Test(org.junit.jupiter.api.Test)

Example 4 with NettyReactiveWebServerFactory

use of org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory in project spring-boot by spring-projects.

the class NettyWebServerFactoryCustomizerTests method defaultUseForwardHeaders.

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

Example 5 with NettyReactiveWebServerFactory

use of org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory in project spring-boot by spring-projects.

the class NettyWebServerFactoryCustomizerTests method forwardHeadersWhenStrategyIsNoneShouldNotConfigureValve.

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

Aggregations

Test (org.junit.jupiter.api.Test)10 NettyReactiveWebServerFactory (org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory)10 HttpServer (reactor.netty.http.server.HttpServer)3 FilteredClassLoader (org.springframework.boot.test.context.FilteredClassLoader)2 ReactiveWebApplicationContextRunner (org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner)2 NettyServerCustomizer (org.springframework.boot.web.embedded.netty.NettyServerCustomizer)2 Undertow (io.undertow.Undertow)1 Tomcat (org.apache.catalina.startup.Tomcat)1 Server (org.eclipse.jetty.server.Server)1 ServerProperties (org.springframework.boot.autoconfigure.web.ServerProperties)1 AnnotationConfigReactiveWebApplicationContext (org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebApplicationContext)1 HttpRequestDecoderSpec (reactor.netty.http.server.HttpRequestDecoderSpec)1