Polish
This commit is contained in:
parent
4407194c00
commit
2c71cb8efd
|
@ -19,10 +19,8 @@ package org.springframework.boot.actuate.autoconfigure;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
||||||
import org.springframework.boot.test.util.EnvironmentTestUtils;
|
import org.springframework.boot.test.util.EnvironmentTestUtils;
|
||||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
@ -96,16 +94,10 @@ public class ManagementServerPropertiesAutoConfigurationTests {
|
||||||
public ManagementServerProperties load(String... environment) {
|
public ManagementServerProperties load(String... environment) {
|
||||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||||
EnvironmentTestUtils.addEnvironment(ctx, environment);
|
EnvironmentTestUtils.addEnvironment(ctx, environment);
|
||||||
ctx.register(TestConfiguration.class);
|
ctx.register(ManagementServerPropertiesAutoConfiguration.class);
|
||||||
ctx.refresh();
|
ctx.refresh();
|
||||||
this.context = ctx;
|
this.context = ctx;
|
||||||
return this.context.getBean(ManagementServerProperties.class);
|
return this.context.getBean(ManagementServerProperties.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@EnableConfigurationProperties(ManagementServerProperties.class)
|
|
||||||
static class TestConfiguration {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue