Polish
This commit is contained in:
parent
948b5760a7
commit
bacf0878af
|
@ -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;
|
||||||
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,
|
||||||
|
|
Loading…
Reference in New Issue