pull/2035/head
Phillip Webb 10 years ago
parent bff39e954e
commit fa02c01727

@ -85,14 +85,14 @@ public class EndpointWebMvcChildContextConfiguration {
this.managementServerProperties = BeanFactoryUtils
.beanOfTypeIncludingAncestors(this.beanFactory,
ManagementServerProperties.class);
this.server = BeanFactoryUtils
.beanOfTypeIncludingAncestors(this.beanFactory,
ServerProperties.class);
this.server = BeanFactoryUtils.beanOfTypeIncludingAncestors(
this.beanFactory, 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);
// Then reset the error pages
container.setErrorPages(Collections.<ErrorPage>emptySet());
container.setErrorPages(Collections.<ErrorPage> emptySet());
// and add the management-specific bits
container.setPort(this.managementServerProperties.getPort());
container.setAddress(this.managementServerProperties.getAddress());

@ -223,7 +223,8 @@ public class EndpointWebMvcAutoConfigurationTests {
assertThat(localServerPort, notNullValue());
assertThat(localManagementPort, notNullValue());
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();
assertAllClosed();
}
@ -309,7 +310,7 @@ public class EndpointWebMvcAutoConfigurationTests {
private int count = 0;
public int getCount() {
return count;
return this.count;
}
@Bean
@ -317,7 +318,7 @@ public class EndpointWebMvcAutoConfigurationTests {
ServerProperties properties = new ServerProperties() {
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
count++;
ServerPortConfig.this.count++;
super.customize(container);
}
};

Loading…
Cancel
Save