Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
29751a5f
Commit
29751a5f
authored
Jul 20, 2018
by
Junling Bu
Browse files
chore[litemall-core]: 采用yaml配置文件方式
parent
ef999d86
Changes
41
Hide whitespace changes
Inline
Side-by-side
litemall-wx-api/src/test/java/org/linlinjava/litemall/wx/WxConfigTest.java
View file @
29751a5f
...
...
@@ -6,6 +6,7 @@ import org.junit.Test;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.core.env.Environment
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.web.WebAppConfiguration
;
...
...
@@ -14,12 +15,18 @@ import org.springframework.test.context.web.WebAppConfiguration;
@SpringBootTest
public
class
WxConfigTest
{
@Autowired
private
WxPayService
wxPayService
;
private
Environment
environment
;
@Test
public
void
test
()
{
WxPayConfig
wxPayConfig
=
wxPayService
.
getConfig
();
System
.
out
.
println
(
wxPayConfig
.
getMchId
()
+
" "
+
wxPayConfig
.
getMchKey
());
// 测试获取application-core.yml配置信息
System
.
out
.
println
(
environment
.
getProperty
(
"express.appId"
));
// 测试获取application-db.yml配置信息
System
.
out
.
println
(
environment
.
getProperty
(
"spring.datasource.druid.url"
));
// 测试获取application-wx.yml配置信息
System
.
out
.
println
(
environment
.
getProperty
(
"wx.app-id"
));
// 测试获取application.yml配置信息
System
.
out
.
println
(
environment
.
getProperty
(
"logging.level.org.linlinjava.litemall.wx"
));
}
}
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
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