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
a77fee9f
Commit
a77fee9f
authored
Apr 21, 2014
by
Hugo Flambo
Committed by
Dave Syer
Apr 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo and use *PropertySource* instead *ProperySource*
Fixes gh-705
parent
f7c16764
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+2
-2
ConfigFileApplicationListener.java
...rk/boot/context/config/ConfigFileApplicationListener.java
+1
-1
spring.factories
spring-boot/src/main/resources/META-INF/spring.factories
+1
-1
ConfigFileApplicationListenerTests.java
...ot/context/config/ConfigFileApplicationListenerTests.java
+13
-13
No files found.
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
a77fee9f
...
...
@@ -199,7 +199,7 @@ sensible overriding of values, properties are considered in the the following or
. Command line arguments.
. Java System properties (`System.getProperties()`).
. OS environment variables.
. A `RandomValueProperySource` that only has properties in `random.*`.
. A `RandomValueProper
t
ySource` that only has properties in `random.*`.
. `@PropertySource` annotations on your `@Configuration` classes.
. Application properties outside of your packaged jar (`application.properties`
including YAML and profile variants).
...
...
@@ -231,7 +231,7 @@ default `name`. When running in production, an `application.properties` can be p
outside of your jar that overrides `name`; and for one-off testing, you can launch with
a specific command line switch (e.g. `java -jar app.jar --name="Spring"`).
The `RandomValueProperySource` is useful for injecting random values
The `RandomValueProper
t
ySource` is useful for injecting random values
(e.g. into secrets or test cases). It can produce integers, longs or
strings, e.g.
...
...
spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java
View file @
a77fee9f
...
...
@@ -218,7 +218,7 @@ public class ConfigFileApplicationListener implements
/**
* {@link BeanFactoryPostProcessor} to re-order our property sources below any
* {@code @ProperySource} items added by the {@link ConfigurationClassPostProcessor}.
* {@code @Proper
t
ySource} items added by the {@link ConfigurationClassPostProcessor}.
*/
private
class
PropertySourceOrderingPostProcessor
implements
BeanFactoryPostProcessor
,
Ordered
{
...
...
spring-boot/src/main/resources/META-INF/spring.factories
View file @
a77fee9f
# ProperySource Loaders
# Proper
t
ySource Loaders
org.springframework.boot.env.PropertySourceLoader=\
org.springframework.boot.env.PropertiesPropertySourceLoader,\
org.springframework.boot.env.YamlPropertySourceLoader
...
...
spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java
View file @
a77fee9f
...
...
@@ -388,10 +388,10 @@ public class ConfigFileApplicationListenerTests {
this
.
initializer
.
onApplicationEvent
(
this
.
event
);
String
property
=
this
.
environment
.
getProperty
(
"my.property"
);
assertThat
(
property
,
equalTo
(
"fromspecificlocation"
));
assertThat
(
this
.
environment
,
containsProperySource
(
"applicationConfig: "
assertThat
(
this
.
environment
,
containsProper
t
ySource
(
"applicationConfig: "
+
"[classpath:specificlocation.properties]"
));
// The default property source is still there
assertThat
(
this
.
environment
,
containsProperySource
(
"applicationConfig: "
assertThat
(
this
.
environment
,
containsProper
t
ySource
(
"applicationConfig: "
+
"[classpath:/application.properties]"
));
assertThat
(
this
.
environment
.
getProperty
(
"foo"
),
equalTo
(
"bucket"
));
}
...
...
@@ -402,7 +402,7 @@ public class ConfigFileApplicationListenerTests {
EnvironmentTestUtils
.
addEnvironment
(
this
.
environment
,
"spring.config.location:"
+
location
);
this
.
initializer
.
onApplicationEvent
(
this
.
event
);
assertThat
(
this
.
environment
,
containsProperySource
(
"applicationConfig: ["
assertThat
(
this
.
environment
,
containsProper
t
ySource
(
"applicationConfig: ["
+
location
+
"]"
));
}
...
...
@@ -412,7 +412,7 @@ public class ConfigFileApplicationListenerTests {
EnvironmentTestUtils
.
addEnvironment
(
this
.
environment
,
"spring.config.location:"
+
location
);
this
.
initializer
.
onApplicationEvent
(
this
.
event
);
assertThat
(
this
.
environment
,
containsProperySource
(
"applicationConfig: [file:"
assertThat
(
this
.
environment
,
containsProper
t
ySource
(
"applicationConfig: [file:"
+
location
+
"]"
));
}
...
...
@@ -423,7 +423,7 @@ public class ConfigFileApplicationListenerTests {
ConfigurableApplicationContext
context
=
application
.
run
();
String
property
=
context
.
getEnvironment
().
getProperty
(
"my.property"
);
assertThat
(
property
,
equalTo
(
"fromspecificlocation"
));
assertThat
(
context
.
getEnvironment
(),
containsProperySource
(
"class path resource "
assertThat
(
context
.
getEnvironment
(),
containsProper
t
ySource
(
"class path resource "
+
"[specificlocation.properties]"
));
context
.
close
();
}
...
...
@@ -439,7 +439,7 @@ public class ConfigFileApplicationListenerTests {
ConfigurableApplicationContext
context
=
application
.
run
();
String
property
=
context
.
getEnvironment
().
getProperty
(
"my.property"
);
assertThat
(
property
,
equalTo
(
"fromspecificlocation"
));
assertThat
(
context
.
getEnvironment
(),
containsProperySource
(
"class path resource "
assertThat
(
context
.
getEnvironment
(),
containsProper
t
ySource
(
"class path resource "
+
"[specificlocation.properties]"
));
context
.
close
();
}
...
...
@@ -452,7 +452,7 @@ public class ConfigFileApplicationListenerTests {
ConfigurableApplicationContext
context
=
application
.
run
();
String
property
=
context
.
getEnvironment
().
getProperty
(
"my.property"
);
assertThat
(
property
,
equalTo
(
"fromspecificlocation"
));
assertThat
(
context
.
getEnvironment
(),
containsProperySource
(
"foo"
));
assertThat
(
context
.
getEnvironment
(),
containsProper
t
ySource
(
"foo"
));
context
.
close
();
}
...
...
@@ -465,9 +465,9 @@ public class ConfigFileApplicationListenerTests {
.
run
(
"--spring.profiles.active=myprofile"
);
String
property
=
context
.
getEnvironment
().
getProperty
(
"my.property"
);
assertThat
(
property
,
equalTo
(
"frompropertiesfile"
));
assertThat
(
context
.
getEnvironment
(),
containsProperySource
(
"class path resource "
assertThat
(
context
.
getEnvironment
(),
containsProper
t
ySource
(
"class path resource "
+
"[enableprofile.properties]"
));
assertThat
(
context
.
getEnvironment
(),
not
(
containsProperySource
(
"classpath:/"
assertThat
(
context
.
getEnvironment
(),
not
(
containsProper
t
ySource
(
"classpath:/"
+
"enableprofile-myprofile.properties"
)));
context
.
close
();
}
...
...
@@ -480,7 +480,7 @@ public class ConfigFileApplicationListenerTests {
ConfigurableApplicationContext
context
=
application
.
run
();
String
property
=
context
.
getEnvironment
().
getProperty
(
"my.property"
);
assertThat
(
property
,
equalTo
(
"fromapplicationproperties"
));
assertThat
(
context
.
getEnvironment
(),
not
(
containsProperySource
(
"classpath:"
assertThat
(
context
.
getEnvironment
(),
not
(
containsProper
t
ySource
(
"classpath:"
+
"/enableprofile-myprofile.properties"
)));
context
.
close
();
}
...
...
@@ -493,7 +493,7 @@ public class ConfigFileApplicationListenerTests {
ConfigurableApplicationContext
context
=
application
.
run
();
String
property
=
context
.
getEnvironment
().
getProperty
(
"my.property"
);
assertThat
(
property
,
equalTo
(
"frommorepropertiesfile"
));
assertThat
(
context
.
getEnvironment
(),
containsProperySource
(
"class path resource "
assertThat
(
context
.
getEnvironment
(),
containsProper
t
ySource
(
"class path resource "
+
"[specificlocation.properties]"
));
context
.
close
();
}
...
...
@@ -506,7 +506,7 @@ public class ConfigFileApplicationListenerTests {
ConfigurableApplicationContext
context
=
application
.
run
();
String
property
=
context
.
getEnvironment
().
getProperty
(
"my.property"
);
assertThat
(
property
,
equalTo
(
"frommorepropertiesfile"
));
assertThat
(
context
.
getEnvironment
(),
containsProperySource
(
"foo"
));
assertThat
(
context
.
getEnvironment
(),
containsProper
t
ySource
(
"foo"
));
context
.
close
();
}
...
...
@@ -545,7 +545,7 @@ public class ConfigFileApplicationListenerTests {
assertThat
((
Boolean
)
field
.
get
(
application
),
equalTo
(
false
));
}
private
static
Matcher
<?
super
ConfigurableEnvironment
>
containsProperySource
(
private
static
Matcher
<?
super
ConfigurableEnvironment
>
containsProper
t
ySource
(
final
String
sourceName
)
{
return
new
TypeSafeDiagnosingMatcher
<
ConfigurableEnvironment
>()
{
@Override
...
...
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