Commit 1ae42067 authored by Johnny Lim's avatar Johnny Lim Committed by Stephane Nicoll

Polish

Closes gh-13776
parent 48962718
...@@ -50,7 +50,7 @@ public class NettyWebServerFactoryCustomizerTests { ...@@ -50,7 +50,7 @@ public class NettyWebServerFactoryCustomizerTests {
} }
@Test @Test
public void deduceUseForwardHeadersUndertow() { public void deduceUseForwardHeaders() {
this.environment.setProperty("DYNO", "-"); this.environment.setProperty("DYNO", "-");
NettyReactiveWebServerFactory factory = mock(NettyReactiveWebServerFactory.class); NettyReactiveWebServerFactory factory = mock(NettyReactiveWebServerFactory.class);
this.customizer.customize(factory); this.customizer.customize(factory);
...@@ -58,14 +58,14 @@ public class NettyWebServerFactoryCustomizerTests { ...@@ -58,14 +58,14 @@ public class NettyWebServerFactoryCustomizerTests {
} }
@Test @Test
public void defaultUseForwardHeadersUndertow() { public void defaultUseForwardHeaders() {
NettyReactiveWebServerFactory factory = mock(NettyReactiveWebServerFactory.class); NettyReactiveWebServerFactory factory = mock(NettyReactiveWebServerFactory.class);
this.customizer.customize(factory); this.customizer.customize(factory);
verify(factory).setUseForwardHeaders(false); verify(factory).setUseForwardHeaders(false);
} }
@Test @Test
public void setUseForwardHeadersUndertow() { public void setUseForwardHeaders() {
this.serverProperties.setUseForwardHeaders(true); this.serverProperties.setUseForwardHeaders(true);
NettyReactiveWebServerFactory factory = mock(NettyReactiveWebServerFactory.class); NettyReactiveWebServerFactory factory = mock(NettyReactiveWebServerFactory.class);
this.customizer.customize(factory); this.customizer.customize(factory);
......
...@@ -763,13 +763,13 @@ example: ...@@ -763,13 +763,13 @@ example:
In the preceding example, if the `development` profile is active, the `server.address` In the preceding example, if the `development` profile is active, the `server.address`
property is `127.0.0.1`. Similarly, if the `production` *and* `eu-central` profiles are property is `127.0.0.1`. Similarly, if the `production` *and* `eu-central` profiles are
active, the `server.address` property is `192.168.1.120`. If the `development` and active, the `server.address` property is `192.168.1.120`. If the `development`,
`production` and `eu-central` profiles are *not* enabled, then the value for the property `production` and `eu-central` profiles are *not* enabled, then the value for the property
is `192.168.1.100`. is `192.168.1.100`.
[NOTE] [NOTE]
==== ====
`spring.profiles` can therefore contains a simple profile name (for example `production`) `spring.profiles` can therefore contain a simple profile name (for example `production`)
or a profile expression. A profile expression allows for more complicated profile logic or a profile expression. A profile expression allows for more complicated profile logic
to be expressed, for example `production & (eu-central | eu-west)`. Check the to be expressed, for example `production & (eu-central | eu-west)`. Check the
{spring-reference}core.html#beans-definition-profiles-java[reference guide] for more {spring-reference}core.html#beans-definition-profiles-java[reference guide] for more
...@@ -1821,7 +1821,7 @@ ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:71 - no applicable action f ...@@ -1821,7 +1821,7 @@ ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:71 - no applicable action f
The `<springProfile>` tag lets you optionally include or exclude sections of The `<springProfile>` tag lets you optionally include or exclude sections of
configuration based on the active Spring profiles. Profile sections are supported configuration based on the active Spring profiles. Profile sections are supported
anywhere within the `<configuration>` element. Use the `name` attribute to specify which anywhere within the `<configuration>` element. Use the `name` attribute to specify which
profile accepts the configuration. The `<springProfile> tag can contains a simple profile profile accepts the configuration. The `<springProfile>` tag can contain a simple profile
name (for example `staging`) or a profile expression. A profile expression allows for more name (for example `staging`) or a profile expression. A profile expression allows for more
complicated profile logic to be expressed, for example complicated profile logic to be expressed, for example
`production & (eu-central | eu-west)`. Check the `production & (eu-central | eu-west)`. Check the
......
...@@ -102,6 +102,7 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact ...@@ -102,6 +102,7 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact
/** /**
* Set if x-forward-* headers should be processed. * Set if x-forward-* headers should be processed.
* @param useForwardHeaders if x-forward headers should be used * @param useForwardHeaders if x-forward headers should be used
* @since 2.1.0
*/ */
public void setUseForwardHeaders(boolean useForwardHeaders) { public void setUseForwardHeaders(boolean useForwardHeaders) {
this.useForwardHeaders = useForwardHeaders; this.useForwardHeaders = useForwardHeaders;
......
...@@ -118,7 +118,7 @@ public class SpringBootJoranConfiguratorTests { ...@@ -118,7 +118,7 @@ public class SpringBootJoranConfiguratorTests {
@Test @Test
public void profileExpressionMatchSecond() throws Exception { public void profileExpressionMatchSecond() throws Exception {
this.environment.setActiveProfiles("production"); this.environment.setActiveProfiles("test");
initialize("profile-expression.xml"); initialize("profile-expression.xml");
this.logger.trace("Hello"); this.logger.trace("Hello");
this.out.expect(containsString("Hello")); this.out.expect(containsString("Hello"));
......
...@@ -180,8 +180,7 @@ public class TomcatServletWebServerFactoryTests ...@@ -180,8 +180,7 @@ public class TomcatServletWebServerFactoryTests
TomcatServletWebServerFactory factory = getFactory(); TomcatServletWebServerFactory factory = getFactory();
Connector[] listeners = new Connector[4]; Connector[] listeners = new Connector[4];
for (int i = 0; i < listeners.length; i++) { for (int i = 0; i < listeners.length; i++) {
Connector connector = new Connector(); listeners[i] = new Connector();
listeners[i] = connector;
} }
factory.addAdditionalTomcatConnectors(listeners); factory.addAdditionalTomcatConnectors(listeners);
this.webServer = factory.getWebServer(); this.webServer = factory.getWebServer();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment