Polish
This commit is contained in:
parent
afba8fed79
commit
f0d94a46fd
|
@ -16,13 +16,8 @@
|
|||
|
||||
package org.springframework.boot.actuate.autoconfigure.web.server;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.test.util.TestPropertyValues;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
|
@ -33,15 +28,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
*/
|
||||
public class ManagementServerPropertiesTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context;
|
||||
|
||||
@After
|
||||
public void close() {
|
||||
if (this.context != null) {
|
||||
this.context.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void defaultManagementServerProperties() {
|
||||
ManagementServerProperties properties = new ManagementServerProperties();
|
||||
|
@ -73,18 +59,4 @@ public class ManagementServerPropertiesTests {
|
|||
assertThat(properties.getServlet().getContextPath()).isEqualTo("");
|
||||
}
|
||||
|
||||
public ManagementServerProperties load(String... environment) {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
TestPropertyValues.of(environment).applyTo(ctx);
|
||||
ctx.register(Config.class);
|
||||
ctx.refresh();
|
||||
this.context = ctx;
|
||||
return this.context.getBean(ManagementServerProperties.class);
|
||||
}
|
||||
|
||||
@EnableConfigurationProperties(ManagementServerProperties.class)
|
||||
protected static class Config {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue