Fix typo in EnvironmentTestUtils

Fixes gh-214
pull/234/head
Dave Syer 11 years ago
parent c349cb66ba
commit 577c177d6a

@ -163,7 +163,7 @@ public class ConfigFileApplicationListenerTests {
@Test @Test
public void yamlProfileCanBeChanged() throws Exception { public void yamlProfileCanBeChanged() throws Exception {
EnvironmentTestUtils.addEnviroment(this.environment, EnvironmentTestUtils.addEnvironment(this.environment,
"spring.profiles.active:prod"); "spring.profiles.active:prod");
this.initializer.setNames("testsetprofiles"); this.initializer.setNames("testsetprofiles");
this.initializer.onApplicationEvent(this.event); this.initializer.onApplicationEvent(this.event);
@ -186,7 +186,7 @@ public class ConfigFileApplicationListenerTests {
@Test @Test
public void specificResource() throws Exception { public void specificResource() throws Exception {
String location = "classpath:specificlocation.properties"; String location = "classpath:specificlocation.properties";
EnvironmentTestUtils.addEnviroment(this.environment, "spring.config.location:" EnvironmentTestUtils.addEnvironment(this.environment, "spring.config.location:"
+ location); + location);
this.initializer.onApplicationEvent(this.event); this.initializer.onApplicationEvent(this.event);
String property = this.environment.getProperty("my.property"); String property = this.environment.getProperty("my.property");
@ -202,7 +202,7 @@ public class ConfigFileApplicationListenerTests {
@Test @Test
public void specificResourceAsFile() throws Exception { public void specificResourceAsFile() throws Exception {
String location = "file:src/test/resources/specificlocation.properties"; String location = "file:src/test/resources/specificlocation.properties";
EnvironmentTestUtils.addEnviroment(this.environment, "spring.config.location:" EnvironmentTestUtils.addEnvironment(this.environment, "spring.config.location:"
+ location); + location);
this.initializer.onApplicationEvent(this.event); this.initializer.onApplicationEvent(this.event);
assertThat(this.environment.getPropertySources().contains(location), is(true)); assertThat(this.environment.getPropertySources().contains(location), is(true));
@ -239,7 +239,7 @@ public class ConfigFileApplicationListenerTests {
@Test @Test
public void specificResourceDefaultsToFile() throws Exception { public void specificResourceDefaultsToFile() throws Exception {
String location = "src/test/resources/specificlocation.properties"; String location = "src/test/resources/specificlocation.properties";
EnvironmentTestUtils.addEnviroment(this.environment, "spring.config.location:" EnvironmentTestUtils.addEnvironment(this.environment, "spring.config.location:"
+ location); + location);
this.initializer.onApplicationEvent(this.event); this.initializer.onApplicationEvent(this.event);
assertThat(this.environment.getPropertySources().contains("file:" + location), assertThat(this.environment.getPropertySources().contains("file:" + location),

@ -38,7 +38,7 @@ public class FileEncodingApplicationListenerTests {
@Test(expected = IllegalStateException.class) @Test(expected = IllegalStateException.class)
public void testIllegalState() { public void testIllegalState() {
EnvironmentTestUtils.addEnviroment(this.environment, EnvironmentTestUtils.addEnvironment(this.environment,
"spring.mandatory_file_encoding:FOO"); "spring.mandatory_file_encoding:FOO");
this.initializer.onApplicationEvent(this.event); this.initializer.onApplicationEvent(this.event);
} }
@ -51,7 +51,7 @@ public class FileEncodingApplicationListenerTests {
@Test @Test
public void testSunnyDayMandated() { public void testSunnyDayMandated() {
Assume.assumeNotNull(System.getProperty("file.encoding")); Assume.assumeNotNull(System.getProperty("file.encoding"));
EnvironmentTestUtils.addEnviroment(this.environment, EnvironmentTestUtils.addEnvironment(this.environment,
"spring.mandatory_file_encoding:" + System.getProperty("file.encoding")); "spring.mandatory_file_encoding:" + System.getProperty("file.encoding"));
this.initializer.onApplicationEvent(this.event); this.initializer.onApplicationEvent(this.event);
} }

@ -32,10 +32,10 @@ public abstract class EnvironmentTestUtils {
public static void addEnvironment(ConfigurableApplicationContext context, public static void addEnvironment(ConfigurableApplicationContext context,
String... pairs) { String... pairs) {
addEnviroment(context.getEnvironment(), pairs); addEnvironment(context.getEnvironment(), pairs);
} }
public static void addEnviroment(ConfigurableEnvironment environment, String... pairs) { public static void addEnvironment(ConfigurableEnvironment environment, String... pairs) {
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
for (String pair : pairs) { for (String pair : pairs) {
int index = pair.indexOf(":"); int index = pair.indexOf(":");

Loading…
Cancel
Save