Search in sources :

Example 21 with ServerProperties

use of org.springframework.boot.autoconfigure.web.ServerProperties in project spring-cloud-sleuth by spring-cloud.

the class DefaultEndpointLocatorConfigurationTest method negativePortFromServerProperties.

@Test
public void negativePortFromServerProperties() throws UnknownHostException {
    ServerProperties properties = new ServerProperties();
    properties.setPort(-1);
    DefaultEndpointLocator locator = new DefaultEndpointLocator(null, properties, environment, new ZipkinProperties(), localAddress(ADDRESS1234));
    assertThat(locator.local().port()).isEqualTo(8080);
}
Also used : ServerProperties(org.springframework.boot.autoconfigure.web.ServerProperties) Test(org.junit.Test)

Example 22 with ServerProperties

use of org.springframework.boot.autoconfigure.web.ServerProperties in project spring-boot by spring-projects.

the class JettyWebServerFactoryCustomizerTests method setup.

@BeforeEach
void setup() {
    this.environment = new MockEnvironment();
    this.serverProperties = new ServerProperties();
    ConfigurationPropertySources.attach(this.environment);
    this.customizer = new JettyWebServerFactoryCustomizer(this.environment, this.serverProperties);
}
Also used : MockEnvironment(org.springframework.mock.env.MockEnvironment) ServerProperties(org.springframework.boot.autoconfigure.web.ServerProperties) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 23 with ServerProperties

use of org.springframework.boot.autoconfigure.web.ServerProperties in project spring-boot by spring-projects.

the class TomcatWebServerFactoryCustomizerTests method setup.

@BeforeEach
void setup() {
    this.environment = new MockEnvironment();
    this.serverProperties = new ServerProperties();
    ConfigurationPropertySources.attach(this.environment);
    this.customizer = new TomcatWebServerFactoryCustomizer(this.environment, this.serverProperties);
}
Also used : MockEnvironment(org.springframework.mock.env.MockEnvironment) ServerProperties(org.springframework.boot.autoconfigure.web.ServerProperties) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 24 with ServerProperties

use of org.springframework.boot.autoconfigure.web.ServerProperties in project spring-boot by spring-projects.

the class UndertowServletWebServerFactoryCustomizerTests method eagerFilterInitCanBeDisabled.

@Test
void eagerFilterInitCanBeDisabled() {
    UndertowServletWebServerFactory factory = new UndertowServletWebServerFactory(0);
    assertThat(factory.isEagerFilterInit()).isTrue();
    ServerProperties serverProperties = new ServerProperties();
    serverProperties.getUndertow().setEagerFilterInit(false);
    new UndertowServletWebServerFactoryCustomizer(serverProperties).customize(factory);
    assertThat(factory.isEagerFilterInit()).isFalse();
}
Also used : UndertowServletWebServerFactory(org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory) ServerProperties(org.springframework.boot.autoconfigure.web.ServerProperties) Test(org.junit.jupiter.api.Test)

Example 25 with ServerProperties

use of org.springframework.boot.autoconfigure.web.ServerProperties in project spring-boot by spring-projects.

the class UndertowWebServerFactoryCustomizerTests method setup.

@BeforeEach
void setup() {
    this.environment = new MockEnvironment();
    this.serverProperties = new ServerProperties();
    ConfigurationPropertySources.attach(this.environment);
    this.customizer = new UndertowWebServerFactoryCustomizer(this.environment, this.serverProperties);
}
Also used : MockEnvironment(org.springframework.mock.env.MockEnvironment) ServerProperties(org.springframework.boot.autoconfigure.web.ServerProperties) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ServerProperties (org.springframework.boot.autoconfigure.web.ServerProperties)27 Test (org.junit.Test)13 MockEnvironment (org.springframework.mock.env.MockEnvironment)9 CoffeeNetConfigurationProperties (coffee.synyx.autoconfigure.CoffeeNetConfigurationProperties)6 InetUtils (org.springframework.cloud.commons.util.InetUtils)6 InetUtilsProperties (org.springframework.cloud.commons.util.InetUtilsProperties)6 BeforeEach (org.junit.jupiter.api.BeforeEach)5 PropertyMapper (org.springframework.boot.context.properties.PropertyMapper)3 DataSize (org.springframework.util.unit.DataSize)3 Test (org.junit.jupiter.api.Test)2 UndertowServletWebServerFactory (org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory)2 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 Duration (java.time.Duration)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Lifecycle (org.apache.catalina.Lifecycle)1 AccessLogValve (org.apache.catalina.valves.AccessLogValve)1 ErrorReportValve (org.apache.catalina.valves.ErrorReportValve)1 RemoteIpValve (org.apache.catalina.valves.RemoteIpValve)1 AbstractProtocol (org.apache.coyote.AbstractProtocol)1