From bacf0878afa144fe271f1f4dcb9e526de1f35d5b Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 15 Nov 2016 10:40:21 -0800 Subject: [PATCH] Polish --- ...rPropertiesAutoConfigurationNoSecurityTests.java | 13 ++++++------- .../web/servlet/MockMvcAutoConfiguration.java | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationNoSecurityTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationNoSecurityTests.java index 2f2aca4486..af7700e92f 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationNoSecurityTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationNoSecurityTests.java @@ -48,17 +48,16 @@ public class ManagementServerPropertiesAutoConfigurationNoSecurityTests { @Test public void securitySettingsIgnoredWithoutSpringSecurity() { - ManagementServerProperties properties = - load("management.security.enabled=false"); + ManagementServerProperties properties = load("management.security.enabled=false"); assertThat(properties.getSecurity().isEnabled()).isFalse(); } public ManagementServerProperties load(String... environment) { - AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); - EnvironmentTestUtils.addEnvironment(ctx, environment); - ctx.register(ManagementServerPropertiesAutoConfiguration.class); - ctx.refresh(); - this.context = ctx; + AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); + EnvironmentTestUtils.addEnvironment(context, environment); + context.register(ManagementServerPropertiesAutoConfiguration.class); + context.refresh(); + this.context = context; return this.context.getBean(ManagementServerProperties.class); } diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcAutoConfiguration.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcAutoConfiguration.java index 401096a8f4..6fbce1b698 100644 --- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcAutoConfiguration.java +++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcAutoConfiguration.java @@ -51,6 +51,7 @@ import org.springframework.web.servlet.DispatcherServlet; public class MockMvcAutoConfiguration { private final WebApplicationContext context; + private final WebMvcProperties webMvcProperties; MockMvcAutoConfiguration(WebApplicationContext context,