Commit bacf0878 authored by Phillip Webb's avatar Phillip Webb

Polish

parent 948b5760
...@@ -48,17 +48,16 @@ public class ManagementServerPropertiesAutoConfigurationNoSecurityTests { ...@@ -48,17 +48,16 @@ public class ManagementServerPropertiesAutoConfigurationNoSecurityTests {
@Test @Test
public void securitySettingsIgnoredWithoutSpringSecurity() { public void securitySettingsIgnoredWithoutSpringSecurity() {
ManagementServerProperties properties = ManagementServerProperties properties = load("management.security.enabled=false");
load("management.security.enabled=false");
assertThat(properties.getSecurity().isEnabled()).isFalse(); assertThat(properties.getSecurity().isEnabled()).isFalse();
} }
public ManagementServerProperties load(String... environment) { public ManagementServerProperties load(String... environment) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(ctx, environment); EnvironmentTestUtils.addEnvironment(context, environment);
ctx.register(ManagementServerPropertiesAutoConfiguration.class); context.register(ManagementServerPropertiesAutoConfiguration.class);
ctx.refresh(); context.refresh();
this.context = ctx; this.context = context;
return this.context.getBean(ManagementServerProperties.class); return this.context.getBean(ManagementServerProperties.class);
} }
......
...@@ -51,6 +51,7 @@ import org.springframework.web.servlet.DispatcherServlet; ...@@ -51,6 +51,7 @@ import org.springframework.web.servlet.DispatcherServlet;
public class MockMvcAutoConfiguration { public class MockMvcAutoConfiguration {
private final WebApplicationContext context; private final WebApplicationContext context;
private final WebMvcProperties webMvcProperties; private final WebMvcProperties webMvcProperties;
MockMvcAutoConfiguration(WebApplicationContext context, MockMvcAutoConfiguration(WebApplicationContext context,
......
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