Commit fa02c017 authored by Phillip Webb's avatar Phillip Webb

Polish

parent bff39e95
...@@ -85,14 +85,14 @@ public class EndpointWebMvcChildContextConfiguration { ...@@ -85,14 +85,14 @@ public class EndpointWebMvcChildContextConfiguration {
this.managementServerProperties = BeanFactoryUtils this.managementServerProperties = BeanFactoryUtils
.beanOfTypeIncludingAncestors(this.beanFactory, .beanOfTypeIncludingAncestors(this.beanFactory,
ManagementServerProperties.class); ManagementServerProperties.class);
this.server = BeanFactoryUtils this.server = BeanFactoryUtils.beanOfTypeIncludingAncestors(
.beanOfTypeIncludingAncestors(this.beanFactory, this.beanFactory, ServerProperties.class);
ServerProperties.class);
} }
// Customize as per the parent context first (so e.g. the access logs go to the same place) // Customize as per the parent context first (so e.g. the access logs go to
// the same place)
server.customize(container); server.customize(container);
// Then reset the error pages // Then reset the error pages
container.setErrorPages(Collections.<ErrorPage>emptySet()); container.setErrorPages(Collections.<ErrorPage> emptySet());
// and add the management-specific bits // and add the management-specific bits
container.setPort(this.managementServerProperties.getPort()); container.setPort(this.managementServerProperties.getPort());
container.setAddress(this.managementServerProperties.getAddress()); container.setAddress(this.managementServerProperties.getAddress());
......
...@@ -223,7 +223,8 @@ public class EndpointWebMvcAutoConfigurationTests { ...@@ -223,7 +223,8 @@ public class EndpointWebMvcAutoConfigurationTests {
assertThat(localServerPort, notNullValue()); assertThat(localServerPort, notNullValue());
assertThat(localManagementPort, notNullValue()); assertThat(localManagementPort, notNullValue());
assertThat(localServerPort, not(equalTo(localManagementPort))); assertThat(localServerPort, not(equalTo(localManagementPort)));
assertThat(applicationContext.getBean(ServerPortConfig.class).getCount(), equalTo(2)); assertThat(this.applicationContext.getBean(ServerPortConfig.class).getCount(),
equalTo(2));
this.applicationContext.close(); this.applicationContext.close();
assertAllClosed(); assertAllClosed();
} }
...@@ -305,11 +306,11 @@ public class EndpointWebMvcAutoConfigurationTests { ...@@ -305,11 +306,11 @@ public class EndpointWebMvcAutoConfigurationTests {
@Configuration @Configuration
public static class ServerPortConfig { public static class ServerPortConfig {
private int count = 0; private int count = 0;
public int getCount() { public int getCount() {
return count; return this.count;
} }
@Bean @Bean
...@@ -317,7 +318,7 @@ public class EndpointWebMvcAutoConfigurationTests { ...@@ -317,7 +318,7 @@ public class EndpointWebMvcAutoConfigurationTests {
ServerProperties properties = new ServerProperties() { ServerProperties properties = new ServerProperties() {
@Override @Override
public void customize(ConfigurableEmbeddedServletContainer container) { public void customize(ConfigurableEmbeddedServletContainer container) {
count++; ServerPortConfig.this.count++;
super.customize(container); super.customize(container);
} }
}; };
......
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