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
32a220da
Commit
32a220da
authored
Jun 11, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for message properties
parent
f5f39035
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
MessageSourceAutoConfigurationTests.java
...ot/autoconfigure/MessageSourceAutoConfigurationTests.java
+19
-0
switch-messages.properties
...toconfigure/src/test/resources/switch-messages.properties
+1
-0
No files found.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfigurationTests.java
View file @
32a220da
...
...
@@ -18,9 +18,12 @@ package org.springframework.boot.autoconfigure;
import
java.util.Locale
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.springframework.boot.test.EnvironmentTestUtils
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.PropertySource
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
...
@@ -81,4 +84,20 @@ public class MessageSourceAutoConfigurationTests {
assertEquals
(
"blah"
,
this
.
context
.
getMessage
(
"foo"
,
null
,
"blah"
,
Locale
.
UK
));
}
@Test
@Ignore
(
"Expected to fail per gh-1075"
)
public
void
testMessageSourceFromPropertySourceAnnotation
()
throws
Exception
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
.
register
(
Config
.
class
,
MessageSourceAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
);
this
.
context
.
refresh
();
assertEquals
(
"bar"
,
this
.
context
.
getMessage
(
"foo"
,
null
,
"Foo message"
,
Locale
.
UK
));
}
@Configuration
@PropertySource
(
"classpath:/switch-messages.properties"
)
protected
static
class
Config
{
}
}
spring-boot-autoconfigure/src/test/resources/switch-messages.properties
0 → 100644
View file @
32a220da
spring.messages.basename
:
test/messages
\ No newline at end of file
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