2015-02-27 13:23:28 +00:00
|
|
|
|
### 35.4.1. ConfigFileApplicationContextInitializer
|
|
|
|
|
|
|
|
|
|
ConfigFileApplicationContextInitializer是一个ApplicationContextInitializer,可以用来测试加载Spring Boot的application.properties文件。当不需要使用@SpringApplicationConfiguration提供的全部特性时,你可以使用它。
|
2015-02-27 13:24:25 +00:00
|
|
|
|
|
2015-02-27 13:23:28 +00:00
|
|
|
|
```java
|
2015-02-27 13:24:48 +00:00
|
|
|
|
@ContextConfiguration(classes = Config.class,initializers = ConfigFileApplicationContextInitializer.class)
|
|
|
|
|
```
|
|
|
|
|
|