Skip to content

Commit c8152bf

Browse files
author
Dave Syer
committed
SpringBootTestUtils->EnvironmentTestUtils
1 parent 478e655 commit c8152bf

28 files changed

+124
-119
lines changed

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointAutoConfigurationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.springframework.boot.actuate.endpoint.TraceEndpoint;
3333
import org.springframework.boot.autoconfigure.AutoConfigurationReport;
3434
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
35-
import org.springframework.boot.test.SpringBootTestUtils;
35+
import org.springframework.boot.test.EnvironmentTestUtils;
3636
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
3737

3838
import static org.junit.Assert.assertEquals;
@@ -104,7 +104,7 @@ public void autoconfigurationAuditEndpoints() {
104104
@Test
105105
public void testInfoEndpointConfiguration() throws Exception {
106106
this.context = new AnnotationConfigApplicationContext();
107-
SpringBootTestUtils.addEnvironment(this.context, "info.foo:bar");
107+
EnvironmentTestUtils.addEnvironment(this.context, "info.foo:bar");
108108
this.context.register(EndpointAutoConfiguration.class);
109109
this.context.refresh();
110110
InfoEndpoint endpoint = this.context.getBean(InfoEndpoint.class);
@@ -116,7 +116,7 @@ public void testInfoEndpointConfiguration() throws Exception {
116116
@Test
117117
public void testNoGitProperties() throws Exception {
118118
this.context = new AnnotationConfigApplicationContext();
119-
SpringBootTestUtils.addEnvironment(this.context,
119+
EnvironmentTestUtils.addEnvironment(this.context,
120120
"spring.git.properties:classpath:nonexistent");
121121
this.context.register(EndpointAutoConfiguration.class);
122122
this.context.refresh();

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration;
3434
import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
3535
import org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext;
36-
import org.springframework.boot.test.SpringBootTestUtils;
36+
import org.springframework.boot.test.EnvironmentTestUtils;
3737
import org.springframework.context.annotation.Bean;
3838
import org.springframework.context.annotation.Configuration;
3939
import org.springframework.http.HttpMethod;
@@ -121,7 +121,7 @@ public void disabled() throws Exception {
121121

122122
@Test
123123
public void specificPortsViaProperties() throws Exception {
124-
SpringBootTestUtils.addEnvironment(this.applicationContext, "server.port:7070",
124+
EnvironmentTestUtils.addEnvironment(this.applicationContext, "server.port:7070",
125125
"management.port:7071");
126126
this.applicationContext.register(RootConfig.class,
127127
PropertyPlaceholderAutoConfiguration.class,
@@ -142,7 +142,7 @@ public void specificPortsViaProperties() throws Exception {
142142

143143
@Test
144144
public void contextPath() throws Exception {
145-
SpringBootTestUtils.addEnvironment(this.applicationContext, "management.contextPath:/test");
145+
EnvironmentTestUtils.addEnvironment(this.applicationContext, "management.contextPath:/test");
146146
this.applicationContext.register(RootConfig.class,
147147
PropertyPlaceholderAutoConfiguration.class,
148148
ManagementServerPropertiesAutoConfiguration.class,

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
2727
import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory;
2828
import org.springframework.boot.context.properties.EnableConfigurationProperties;
29-
import org.springframework.boot.test.SpringBootTestUtils;
29+
import org.springframework.boot.test.EnvironmentTestUtils;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.context.annotation.Configuration;
3232

@@ -65,7 +65,7 @@ public void agentServletRegisteredWithAppContext() throws Exception {
6565
@Test
6666
public void agentDisabled() throws Exception {
6767
this.context = new AnnotationConfigEmbeddedWebApplicationContext();
68-
SpringBootTestUtils.addEnvironment(this.context, "endpoints.jolokia.enabled:false");
68+
EnvironmentTestUtils.addEnvironment(this.context, "endpoints.jolokia.enabled:false");
6969
this.context.register(Config.class, WebMvcAutoConfiguration.class,
7070
ManagementServerPropertiesAutoConfiguration.class,
7171
HttpMessageConvertersAutoConfiguration.class,

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementSecurityAutoConfigurationTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
2626
import org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration;
2727
import org.springframework.boot.context.listener.LoggingApplicationListener;
28-
import org.springframework.boot.test.SpringBootTestUtils;
28+
import org.springframework.boot.test.EnvironmentTestUtils;
2929
import org.springframework.context.annotation.Bean;
3030
import org.springframework.context.annotation.Configuration;
3131
import org.springframework.context.event.ContextRefreshedEvent;
@@ -117,7 +117,7 @@ public void testDisableIgnoredStaticApplicationPaths() throws Exception {
117117
EndpointAutoConfiguration.class,
118118
ManagementServerPropertiesAutoConfiguration.class,
119119
PropertyPlaceholderAutoConfiguration.class);
120-
SpringBootTestUtils.addEnvironment(this.context, "security.ignored:none");
120+
EnvironmentTestUtils.addEnvironment(this.context, "security.ignored:none");
121121
this.context.refresh();
122122
// Just the application and management endpoints now
123123
assertEquals(2, this.context.getBean(FilterChainProxy.class).getFilterChains()
@@ -134,7 +134,7 @@ public void testDisableBasicAuthOnApplicationPaths() throws Exception {
134134
EndpointAutoConfiguration.class, EndpointWebMvcAutoConfiguration.class,
135135
ManagementServerPropertiesAutoConfiguration.class,
136136
PropertyPlaceholderAutoConfiguration.class);
137-
SpringBootTestUtils.addEnvironment(this.context, "security.basic.enabled:false");
137+
EnvironmentTestUtils.addEnvironment(this.context, "security.basic.enabled:false");
138138
this.context.refresh();
139139
// Just the management endpoints (one filter) and ignores now
140140
assertEquals(7, this.context.getBean(FilterChainProxy.class).getFilterChains()
@@ -171,7 +171,7 @@ public void testSecurityPropertiesNotAvailable() throws Exception {
171171

172172
private static AnnotationConfigWebApplicationContext debugRefresh(
173173
AnnotationConfigWebApplicationContext context) {
174-
SpringBootTestUtils.addEnvironment(context, "debug:true");
174+
EnvironmentTestUtils.addEnvironment(context, "debug:true");
175175
LoggingApplicationListener logging = new LoggingApplicationListener();
176176
logging.onApplicationEvent(new SpringApplicationBeforeRefreshEvent(
177177
new SpringApplication(), context, new String[0]));

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/AbstractEndpointTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.junit.After;
2222
import org.junit.Before;
2323
import org.junit.Test;
24-
import org.springframework.boot.test.SpringBootTestUtils;
24+
import org.springframework.boot.test.EnvironmentTestUtils;
2525
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
2626
import org.springframework.core.env.MapPropertySource;
2727
import org.springframework.core.env.PropertySource;
@@ -84,7 +84,7 @@ public void isSensitive() throws Exception {
8484
@Test
8585
public void idOverride() throws Exception {
8686
this.context = new AnnotationConfigApplicationContext();
87-
SpringBootTestUtils.addEnvironment(this.context, this.property + ".id:myid");
87+
EnvironmentTestUtils.addEnvironment(this.context, this.property + ".id:myid");
8888
this.context.register(this.configClass);
8989
this.context.refresh();
9090
assertThat(getEndpointBean().getId(), equalTo("myid"));

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.springframework.boot.actuate.endpoint.EnvironmentEndpoint;
2626
import org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpointTests.TestConfiguration;
2727
import org.springframework.boot.test.SpringApplicationConfiguration;
28-
import org.springframework.boot.test.SpringBootTestUtils;
28+
import org.springframework.boot.test.EnvironmentTestUtils;
2929
import org.springframework.context.ConfigurableApplicationContext;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.context.annotation.Configuration;
@@ -59,7 +59,7 @@ public class EnvironmentMvcEndpointTests {
5959
@Before
6060
public void setUp() {
6161
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
62-
SpringBootTestUtils.addEnvironment((ConfigurableApplicationContext) this.context, "foo:bar");
62+
EnvironmentTestUtils.addEnvironment((ConfigurableApplicationContext) this.context, "foo:bar");
6363
}
6464

6565
@Test

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaEndpointTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.springframework.boot.actuate.endpoint.mvc.JolokiaEndpointTests.Config;
2929
import org.springframework.boot.context.properties.EnableConfigurationProperties;
3030
import org.springframework.boot.test.SpringApplicationConfiguration;
31-
import org.springframework.boot.test.SpringBootTestUtils;
31+
import org.springframework.boot.test.EnvironmentTestUtils;
3232
import org.springframework.context.ConfigurableApplicationContext;
3333
import org.springframework.context.annotation.Configuration;
3434
import org.springframework.context.annotation.Import;
@@ -66,7 +66,7 @@ public class JolokiaEndpointTests {
6666
@Before
6767
public void setUp() {
6868
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
69-
SpringBootTestUtils.addEnvironment((ConfigurableApplicationContext) this.context, "foo:bar");
69+
EnvironmentTestUtils.addEnvironment((ConfigurableApplicationContext) this.context, "foo:bar");
7070
}
7171

7272
@Test

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfigurationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.junit.After;
2020
import org.junit.Test;
2121
import org.springframework.beans.factory.annotation.Value;
22-
import org.springframework.boot.test.SpringBootTestUtils;
22+
import org.springframework.boot.test.EnvironmentTestUtils;
2323
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
2424
import org.springframework.context.annotation.Bean;
2525
import org.springframework.context.annotation.Configuration;
@@ -48,7 +48,7 @@ public void close() {
4848
public void propertyPlaceholderse() throws Exception {
4949
this.context.register(PropertyPlaceholderAutoConfiguration.class,
5050
PlaceholderConfig.class);
51-
SpringBootTestUtils.addEnvironment(this.context, "foo:two");
51+
EnvironmentTestUtils.addEnvironment(this.context, "foo:two");
5252
this.context.refresh();
5353
assertEquals("two", this.context.getBean(PlaceholderConfig.class).getFoo());
5454
}
@@ -57,7 +57,7 @@ public void propertyPlaceholderse() throws Exception {
5757
public void propertyPlaceholdersOverride() throws Exception {
5858
this.context.register(PropertyPlaceholderAutoConfiguration.class,
5959
PlaceholderConfig.class, PlaceholdersOverride.class);
60-
SpringBootTestUtils.addEnvironment(this.context, "foo:two");
60+
EnvironmentTestUtils.addEnvironment(this.context, "foo:two");
6161
this.context.refresh();
6262
assertEquals("spam", this.context.getBean(PlaceholderConfig.class).getFoo());
6363
}

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoconfigurationTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.springframework.amqp.rabbit.core.RabbitAdmin;
2626
import org.springframework.amqp.rabbit.core.RabbitTemplate;
2727
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
28-
import org.springframework.boot.test.SpringBootTestUtils;
28+
import org.springframework.boot.test.EnvironmentTestUtils;
2929
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.context.annotation.Configuration;
@@ -65,7 +65,7 @@ public void testDefaultRabbitTemplate() {
6565
public void testRabbitTemplateWithOverrides() {
6666
this.context = new AnnotationConfigApplicationContext();
6767
this.context.register(TestConfiguration.class, RabbitAutoConfiguration.class);
68-
SpringBootTestUtils.addEnvironment(this.context, "spring.rabbitmq.host:remote-server",
68+
EnvironmentTestUtils.addEnvironment(this.context, "spring.rabbitmq.host:remote-server",
6969
"spring.rabbitmq.port:9000", "spring.rabbitmq.username:alice",
7070
"spring.rabbitmq.password:secret", "spring.rabbitmq.virtual_host:/vhost");
7171
this.context.refresh();
@@ -80,7 +80,7 @@ public void testRabbitTemplateWithOverrides() {
8080
public void testRabbitTemplateEmptyVirtualHost() {
8181
this.context = new AnnotationConfigApplicationContext();
8282
this.context.register(TestConfiguration.class, RabbitAutoConfiguration.class);
83-
SpringBootTestUtils.addEnvironment(this.context, "spring.rabbitmq.virtual_host:");
83+
EnvironmentTestUtils.addEnvironment(this.context, "spring.rabbitmq.virtual_host:");
8484
this.context.refresh();
8585
CachingConnectionFactory connectionFactory = this.context
8686
.getBean(CachingConnectionFactory.class);
@@ -91,7 +91,7 @@ public void testRabbitTemplateEmptyVirtualHost() {
9191
public void testRabbitTemplateVirtualHostMissingSlash() {
9292
this.context = new AnnotationConfigApplicationContext();
9393
this.context.register(TestConfiguration.class, RabbitAutoConfiguration.class);
94-
SpringBootTestUtils.addEnvironment(this.context, "spring.rabbitmq.virtual_host:foo");
94+
EnvironmentTestUtils.addEnvironment(this.context, "spring.rabbitmq.virtual_host:foo");
9595
this.context.refresh();
9696
CachingConnectionFactory connectionFactory = this.context
9797
.getBean(CachingConnectionFactory.class);
@@ -102,7 +102,7 @@ public void testRabbitTemplateVirtualHostMissingSlash() {
102102
public void testRabbitTemplateDefaultVirtualHost() {
103103
this.context = new AnnotationConfigApplicationContext();
104104
this.context.register(TestConfiguration.class, RabbitAutoConfiguration.class);
105-
SpringBootTestUtils.addEnvironment(this.context, "spring.rabbitmq.virtual_host:/");
105+
EnvironmentTestUtils.addEnvironment(this.context, "spring.rabbitmq.virtual_host:/");
106106
this.context.refresh();
107107
CachingConnectionFactory connectionFactory = this.context
108108
.getBean(CachingConnectionFactory.class);
@@ -126,7 +126,7 @@ public void testConnectionFactoryBackoff() {
126126
public void testStaticQueues() {
127127
this.context = new AnnotationConfigApplicationContext();
128128
this.context.register(TestConfiguration.class, RabbitAutoConfiguration.class);
129-
SpringBootTestUtils.addEnvironment(this.context, "spring.rabbitmq.dynamic:false");
129+
EnvironmentTestUtils.addEnvironment(this.context, "spring.rabbitmq.dynamic:false");
130130
this.context.refresh();
131131
// There should NOT be an AmqpAdmin bean when dynamic is switch to false
132132
this.thrown.expect(NoSuchBeanDefinitionException.class);

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/aop/AopAutoConfigurationTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.aspectj.lang.annotation.Before;
2121
import org.junit.Test;
2222
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
23-
import org.springframework.boot.test.SpringBootTestUtils;
23+
import org.springframework.boot.test.EnvironmentTestUtils;
2424
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
2525
import org.springframework.context.annotation.Bean;
2626
import org.springframework.context.annotation.Configuration;
@@ -42,7 +42,7 @@ public void testNoAopAutoConfiguration() {
4242
this.context = new AnnotationConfigApplicationContext();
4343
this.context.register(TestConfiguration.class, AopAutoConfiguration.class,
4444
PropertyPlaceholderAutoConfiguration.class);
45-
SpringBootTestUtils.addEnvironment(this.context, "spring.aop.auto:false");
45+
EnvironmentTestUtils.addEnvironment(this.context, "spring.aop.auto:false");
4646
this.context.refresh();
4747
TestAspect aspect = this.context.getBean(TestAspect.class);
4848
assertFalse(aspect.isCalled());
@@ -56,7 +56,7 @@ public void testAopAutoConfigurationProxyTargetClass() {
5656
this.context = new AnnotationConfigApplicationContext();
5757
this.context.register(TestConfiguration.class, AopAutoConfiguration.class,
5858
PropertyPlaceholderAutoConfiguration.class);
59-
SpringBootTestUtils.addEnvironment(this.context, "spring.aop.proxyTargetClass:true");
59+
EnvironmentTestUtils.addEnvironment(this.context, "spring.aop.proxyTargetClass:true");
6060
this.context.refresh();
6161
TestAspect aspect = this.context.getBean(TestAspect.class);
6262
assertFalse(aspect.isCalled());
@@ -70,7 +70,7 @@ public void testAopAutoConfigurationNoProxyTargetClass() {
7070
this.context = new AnnotationConfigApplicationContext();
7171
this.context.register(TestConfiguration.class, AopAutoConfiguration.class,
7272
PropertyPlaceholderAutoConfiguration.class);
73-
SpringBootTestUtils.addEnvironment(this.context, "spring.aop.proxyTargetClass:false");
73+
EnvironmentTestUtils.addEnvironment(this.context, "spring.aop.proxyTargetClass:false");
7474
this.context.refresh();
7575
TestAspect aspect = this.context.getBean(TestAspect.class);
7676
assertFalse(aspect.isCalled());

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
4545
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
4646
import org.springframework.boot.autoconfigure.orm.jpa.test.City;
47-
import org.springframework.boot.test.SpringBootTestUtils;
47+
import org.springframework.boot.test.EnvironmentTestUtils;
4848
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
4949
import org.springframework.context.annotation.Bean;
5050
import org.springframework.context.annotation.ComponentScan;
@@ -105,7 +105,7 @@ public void testDefinesAndLaunchesJob() throws Exception {
105105
@Test
106106
public void testDisableLaunchesJob() throws Exception {
107107
this.context = new AnnotationConfigApplicationContext();
108-
SpringBootTestUtils.addEnvironment(this.context, "spring.batch.job.enabled:false");
108+
EnvironmentTestUtils.addEnvironment(this.context, "spring.batch.job.enabled:false");
109109
this.context.register(JobConfiguration.class, BatchAutoConfiguration.class,
110110
EmbeddedDataSourceConfiguration.class,
111111
PropertyPlaceholderAutoConfiguration.class);
@@ -117,7 +117,7 @@ public void testDisableLaunchesJob() throws Exception {
117117
@Test
118118
public void testDisableSchemaLoader() throws Exception {
119119
this.context = new AnnotationConfigApplicationContext();
120-
SpringBootTestUtils.addEnvironment(this.context, "spring.datasource.name:batchtest",
120+
EnvironmentTestUtils.addEnvironment(this.context, "spring.datasource.name:batchtest",
121121
"spring.batch.initializer.enabled:false");
122122
this.context.register(TestConfiguration.class, BatchAutoConfiguration.class,
123123
EmbeddedDataSourceConfiguration.class,

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.junit.Test;
3333
import org.mockito.Mockito;
3434
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
35-
import org.springframework.boot.test.SpringBootTestUtils;
35+
import org.springframework.boot.test.EnvironmentTestUtils;
3636
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
3737
import org.springframework.context.annotation.Bean;
3838
import org.springframework.context.annotation.Configuration;
@@ -66,7 +66,7 @@ public void testDefaultDataSourceExists() throws Exception {
6666

6767
@Test
6868
public void testEmbeddedTypeDefaultsUsername() throws Exception {
69-
SpringBootTestUtils.addEnvironment(this.context,
69+
EnvironmentTestUtils.addEnvironment(this.context,
7070
"spring.datasource.driverClassName:org.hsqldb.jdbcDriver",
7171
"spring.datasource.url:jdbc:hsqldb:mem:testdb");
7272
this.context.register(DataSourceAutoConfiguration.class,
@@ -81,7 +81,7 @@ public void testEmbeddedTypeDefaultsUsername() throws Exception {
8181

8282
@Test
8383
public void testExplicitDriverClassClearsUserName() throws Exception {
84-
SpringBootTestUtils
84+
EnvironmentTestUtils
8585
.addEnvironment(
8686
this.context,
8787
"spring.datasource.driverClassName:org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfigurationTests$DatabaseDriver",

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.junit.Test;
2525
import org.springframework.beans.factory.BeanCreationException;
2626
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
27-
import org.springframework.boot.test.SpringBootTestUtils;
27+
import org.springframework.boot.test.EnvironmentTestUtils;
2828
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
2929
import org.springframework.util.ReflectionUtils;
3030

@@ -56,7 +56,7 @@ public void testDataSourceExists() throws Exception {
5656
@Test
5757
public void testDataSourcePropertiesOverridden() throws Exception {
5858
this.context.register(TomcatDataSourceConfiguration.class);
59-
SpringBootTestUtils.addEnvironment(this.context, "spring.datasource.url:jdbc:foo//bar/spam");
59+
EnvironmentTestUtils.addEnvironment(this.context, "spring.datasource.url:jdbc:foo//bar/spam");
6060
this.context.refresh();
6161
assertEquals("jdbc:foo//bar/spam",
6262
this.context.getBean(org.apache.tomcat.jdbc.pool.DataSource.class)

0 commit comments

Comments
 (0)