Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
577c177d
Commit
577c177d
authored
Jan 12, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo in EnvironmentTestUtils
Fixes gh-214
parent
c349cb66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
ConfigFileApplicationListenerTests.java
.../context/listener/ConfigFileApplicationListenerTests.java
+4
-4
FileEncodingApplicationListenerTests.java
...ontext/listener/FileEncodingApplicationListenerTests.java
+2
-2
EnvironmentTestUtils.java
...a/org/springframework/boot/test/EnvironmentTestUtils.java
+2
-2
No files found.
spring-boot/src/test/java/org/springframework/boot/context/listener/ConfigFileApplicationListenerTests.java
View file @
577c177d
...
...
@@ -163,7 +163,7 @@ public class ConfigFileApplicationListenerTests {
@Test
public
void
yamlProfileCanBeChanged
()
throws
Exception
{
EnvironmentTestUtils
.
addEnviroment
(
this
.
environment
,
EnvironmentTestUtils
.
addEnviro
n
ment
(
this
.
environment
,
"spring.profiles.active:prod"
);
this
.
initializer
.
setNames
(
"testsetprofiles"
);
this
.
initializer
.
onApplicationEvent
(
this
.
event
);
...
...
@@ -186,7 +186,7 @@ public class ConfigFileApplicationListenerTests {
@Test
public
void
specificResource
()
throws
Exception
{
String
location
=
"classpath:specificlocation.properties"
;
EnvironmentTestUtils
.
addEnviroment
(
this
.
environment
,
"spring.config.location:"
EnvironmentTestUtils
.
addEnviro
n
ment
(
this
.
environment
,
"spring.config.location:"
+
location
);
this
.
initializer
.
onApplicationEvent
(
this
.
event
);
String
property
=
this
.
environment
.
getProperty
(
"my.property"
);
...
...
@@ -202,7 +202,7 @@ public class ConfigFileApplicationListenerTests {
@Test
public
void
specificResourceAsFile
()
throws
Exception
{
String
location
=
"file:src/test/resources/specificlocation.properties"
;
EnvironmentTestUtils
.
addEnviroment
(
this
.
environment
,
"spring.config.location:"
EnvironmentTestUtils
.
addEnviro
n
ment
(
this
.
environment
,
"spring.config.location:"
+
location
);
this
.
initializer
.
onApplicationEvent
(
this
.
event
);
assertThat
(
this
.
environment
.
getPropertySources
().
contains
(
location
),
is
(
true
));
...
...
@@ -239,7 +239,7 @@ public class ConfigFileApplicationListenerTests {
@Test
public
void
specificResourceDefaultsToFile
()
throws
Exception
{
String
location
=
"src/test/resources/specificlocation.properties"
;
EnvironmentTestUtils
.
addEnviroment
(
this
.
environment
,
"spring.config.location:"
EnvironmentTestUtils
.
addEnviro
n
ment
(
this
.
environment
,
"spring.config.location:"
+
location
);
this
.
initializer
.
onApplicationEvent
(
this
.
event
);
assertThat
(
this
.
environment
.
getPropertySources
().
contains
(
"file:"
+
location
),
...
...
spring-boot/src/test/java/org/springframework/boot/context/listener/FileEncodingApplicationListenerTests.java
View file @
577c177d
...
...
@@ -38,7 +38,7 @@ public class FileEncodingApplicationListenerTests {
@Test
(
expected
=
IllegalStateException
.
class
)
public
void
testIllegalState
()
{
EnvironmentTestUtils
.
addEnviroment
(
this
.
environment
,
EnvironmentTestUtils
.
addEnviro
n
ment
(
this
.
environment
,
"spring.mandatory_file_encoding:FOO"
);
this
.
initializer
.
onApplicationEvent
(
this
.
event
);
}
...
...
@@ -51,7 +51,7 @@ public class FileEncodingApplicationListenerTests {
@Test
public
void
testSunnyDayMandated
()
{
Assume
.
assumeNotNull
(
System
.
getProperty
(
"file.encoding"
));
EnvironmentTestUtils
.
addEnviroment
(
this
.
environment
,
EnvironmentTestUtils
.
addEnviro
n
ment
(
this
.
environment
,
"spring.mandatory_file_encoding:"
+
System
.
getProperty
(
"file.encoding"
));
this
.
initializer
.
onApplicationEvent
(
this
.
event
);
}
...
...
spring-boot/src/test/java/org/springframework/boot/test/EnvironmentTestUtils.java
View file @
577c177d
...
...
@@ -32,10 +32,10 @@ public abstract class EnvironmentTestUtils {
public
static
void
addEnvironment
(
ConfigurableApplicationContext
context
,
String
...
pairs
)
{
addEnviroment
(
context
.
getEnvironment
(),
pairs
);
addEnviro
n
ment
(
context
.
getEnvironment
(),
pairs
);
}
public
static
void
addEnviroment
(
ConfigurableEnvironment
environment
,
String
...
pairs
)
{
public
static
void
addEnviro
n
ment
(
ConfigurableEnvironment
environment
,
String
...
pairs
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
for
(
String
pair
:
pairs
)
{
int
index
=
pair
.
indexOf
(
":"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment