TestUtils -> SpringBootTestUtils

This commit is contained in:
Dave Syer
2014-01-08 10:46:42 +00:00
parent 147968cf83
commit 321ce3aad2
27 changed files with 110 additions and 110 deletions

View File

@@ -21,7 +21,7 @@ import java.util.Map;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.TestUtils;
import org.springframework.boot.SpringBootTestUtils;
import org.springframework.boot.actuate.endpoint.AutoConfigurationReportEndpoint;
import org.springframework.boot.actuate.endpoint.BeansEndpoint;
import org.springframework.boot.actuate.endpoint.DumpEndpoint;
@@ -104,7 +104,7 @@ public class EndpointAutoConfigurationTests {
@Test
public void testInfoEndpointConfiguration() throws Exception {
this.context = new AnnotationConfigApplicationContext();
TestUtils.addEnviroment(this.context, "info.foo:bar");
SpringBootTestUtils.addEnviroment(this.context, "info.foo:bar");
this.context.register(EndpointAutoConfiguration.class);
this.context.refresh();
InfoEndpoint endpoint = this.context.getBean(InfoEndpoint.class);
@@ -116,7 +116,7 @@ public class EndpointAutoConfigurationTests {
@Test
public void testNoGitProperties() throws Exception {
this.context = new AnnotationConfigApplicationContext();
TestUtils.addEnviroment(this.context,
SpringBootTestUtils.addEnviroment(this.context,
"spring.git.properties:classpath:nonexistent");
this.context.register(EndpointAutoConfiguration.class);
this.context.refresh();

View File

@@ -23,7 +23,7 @@ import java.nio.charset.Charset;
import org.junit.After;
import org.junit.Test;
import org.springframework.boot.TestUtils;
import org.springframework.boot.SpringBootTestUtils;
import org.springframework.boot.actuate.endpoint.Endpoint;
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint;
import org.springframework.boot.actuate.properties.ManagementServerProperties;
@@ -121,7 +121,7 @@ public class EndpointWebMvcAutoConfigurationTests {
@Test
public void specificPortsViaProperties() throws Exception {
TestUtils.addEnviroment(this.applicationContext, "server.port:7070",
SpringBootTestUtils.addEnviroment(this.applicationContext, "server.port:7070",
"management.port:7071");
this.applicationContext.register(RootConfig.class,
PropertyPlaceholderAutoConfiguration.class,
@@ -142,7 +142,7 @@ public class EndpointWebMvcAutoConfigurationTests {
@Test
public void contextPath() throws Exception {
TestUtils.addEnviroment(this.applicationContext, "management.contextPath:/test");
SpringBootTestUtils.addEnviroment(this.applicationContext, "management.contextPath:/test");
this.applicationContext.register(RootConfig.class,
PropertyPlaceholderAutoConfiguration.class,
ManagementServerPropertiesAutoConfiguration.class,

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure;
import org.junit.After;
import org.junit.Test;
import org.springframework.boot.TestUtils;
import org.springframework.boot.SpringBootTestUtils;
import org.springframework.boot.actuate.endpoint.mvc.JolokiaMvcEndpoint;
import org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
@@ -65,7 +65,7 @@ public class JolokiaAutoConfigurationTests {
@Test
public void agentDisabled() throws Exception {
this.context = new AnnotationConfigEmbeddedWebApplicationContext();
TestUtils.addEnviroment(this.context, "endpoints.jolokia.enabled:false");
SpringBootTestUtils.addEnviroment(this.context, "endpoints.jolokia.enabled:false");
this.context.register(Config.class, WebMvcAutoConfiguration.class,
ManagementServerPropertiesAutoConfiguration.class,
HttpMessageConvertersAutoConfiguration.class,

View File

@@ -20,7 +20,7 @@ import org.junit.After;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringApplicationBeforeRefreshEvent;
import org.springframework.boot.TestUtils;
import org.springframework.boot.SpringBootTestUtils;
import org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
@@ -117,7 +117,7 @@ public class ManagementSecurityAutoConfigurationTests {
EndpointAutoConfiguration.class,
ManagementServerPropertiesAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
TestUtils.addEnviroment(this.context, "security.ignored:none");
SpringBootTestUtils.addEnviroment(this.context, "security.ignored:none");
this.context.refresh();
// Just the application and management endpoints now
assertEquals(2, this.context.getBean(FilterChainProxy.class).getFilterChains()
@@ -134,7 +134,7 @@ public class ManagementSecurityAutoConfigurationTests {
EndpointAutoConfiguration.class, EndpointWebMvcAutoConfiguration.class,
ManagementServerPropertiesAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
TestUtils.addEnviroment(this.context, "security.basic.enabled:false");
SpringBootTestUtils.addEnviroment(this.context, "security.basic.enabled:false");
this.context.refresh();
// Just the management endpoints (one filter) and ignores now
assertEquals(7, this.context.getBean(FilterChainProxy.class).getFilterChains()
@@ -171,7 +171,7 @@ public class ManagementSecurityAutoConfigurationTests {
private static AnnotationConfigWebApplicationContext debugRefresh(
AnnotationConfigWebApplicationContext context) {
TestUtils.addEnviroment(context, "debug:true");
SpringBootTestUtils.addEnviroment(context, "debug:true");
LoggingApplicationListener logging = new LoggingApplicationListener();
logging.onApplicationEvent(new SpringApplicationBeforeRefreshEvent(
new SpringApplication(), context, new String[0]));

View File

@@ -21,7 +21,7 @@ import java.util.Collections;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.TestUtils;
import org.springframework.boot.SpringBootTestUtils;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;
@@ -84,7 +84,7 @@ public abstract class AbstractEndpointTests<T extends Endpoint<?>> {
@Test
public void idOverride() throws Exception {
this.context = new AnnotationConfigApplicationContext();
TestUtils.addEnviroment(this.context, this.property + ".id:myid");
SpringBootTestUtils.addEnviroment(this.context, this.property + ".id:myid");
this.context.register(this.configClass);
this.context.refresh();
assertThat(getEndpointBean().getId(), equalTo("myid"));

View File

@@ -20,7 +20,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.TestUtils;
import org.springframework.boot.SpringBootTestUtils;
import org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.ManagementServerPropertiesAutoConfiguration;
import org.springframework.boot.actuate.endpoint.EnvironmentEndpoint;
@@ -59,7 +59,7 @@ public class EnvironmentMvcEndpointTests {
@Before
public void setUp() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
TestUtils.addEnviroment((ConfigurableApplicationContext) this.context, "foo:bar");
SpringBootTestUtils.addEnviroment((ConfigurableApplicationContext) this.context, "foo:bar");
}
@Test

View File

@@ -22,7 +22,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.TestUtils;
import org.springframework.boot.SpringBootTestUtils;
import org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.JolokiaAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.ManagementServerPropertiesAutoConfiguration;
@@ -66,7 +66,7 @@ public class JolokiaEndpointTests {
@Before
public void setUp() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
TestUtils.addEnviroment((ConfigurableApplicationContext) this.context, "foo:bar");
SpringBootTestUtils.addEnviroment((ConfigurableApplicationContext) this.context, "foo:bar");
}
@Test