From fa02c017277d867f8feb4d555619bdc20650f4ad Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 25 Sep 2014 20:15:49 -0700 Subject: [PATCH] Polish --- .../EndpointWebMvcChildContextConfiguration.java | 10 +++++----- .../EndpointWebMvcAutoConfigurationTests.java | 11 ++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java index 35db5b3863..ce432bcb2c 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java @@ -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.emptySet()); + container.setErrorPages(Collections. emptySet()); // and add the management-specific bits container.setPort(this.managementServerProperties.getPort()); container.setAddress(this.managementServerProperties.getAddress()); diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java index 5c1b4e13a4..eb0c7c3a93 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java @@ -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(); } @@ -305,11 +306,11 @@ public class EndpointWebMvcAutoConfigurationTests { @Configuration public static class ServerPortConfig { - + 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); } };