mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '1.4.x' into 1.5.x
This commit is contained in:
commit
764f13453a
@ -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);
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,7 @@ import org.springframework.web.servlet.DispatcherServlet;
|
||||
public class MockMvcAutoConfiguration {
|
||||
|
||||
private final WebApplicationContext context;
|
||||
|
||||
private final WebMvcProperties webMvcProperties;
|
||||
|
||||
MockMvcAutoConfiguration(WebApplicationContext context,
|
||||
|
Loading…
Reference in New Issue
Block a user