|
|
|
@ -202,6 +202,23 @@ class UndertowWebServerFactoryCustomizerTests {
|
|
|
|
|
verify(factory).setUseForwardHeaders(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void forwardHeadersWhenStrategyIsNativeShouldConfigureValve() {
|
|
|
|
|
this.serverProperties.setForwardHeadersStrategy(ServerProperties.ForwardHeadersStrategy.NATIVE);
|
|
|
|
|
ConfigurableUndertowWebServerFactory factory = mock(ConfigurableUndertowWebServerFactory.class);
|
|
|
|
|
this.customizer.customize(factory);
|
|
|
|
|
verify(factory).setUseForwardHeaders(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void forwardHeadersWhenStrategyIsNoneShouldNotConfigureValve() {
|
|
|
|
|
this.environment.setProperty("DYNO", "-");
|
|
|
|
|
this.serverProperties.setForwardHeadersStrategy(ServerProperties.ForwardHeadersStrategy.NONE);
|
|
|
|
|
ConfigurableUndertowWebServerFactory factory = mock(ConfigurableUndertowWebServerFactory.class);
|
|
|
|
|
this.customizer.customize(factory);
|
|
|
|
|
verify(factory).setUseForwardHeaders(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private <T> T boundServerOption(Option<T> option) {
|
|
|
|
|
Builder builder = Undertow.builder();
|
|
|
|
|
ConfigurableUndertowWebServerFactory factory = mockFactory(builder);
|
|
|
|
|