为什么80%的码农都做不了架构师?>>> 自定义配置信息: 读取自定义properties文件: 在spring boot 1.4版本里 @configurationproperties去掉location这个属性了,所以当我们需要引入外部properties文件时,采用:@PropertySource("classpath:conf/env/config.properties") 读取自定义spring xml文件: @ImportResource(locations = { "classpath:conf/xml/all.xml" }) 单元测试: 引入 spring-boot-starter-test <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> 开发单元测试 @RunWith(SpringRunner.class) @SpringBootTest(classes=TestApplicaion.class) public class TestServiceTest { @Test public void demo(){ System.out.println("----------测试用例----------"); } } 转载于:https://my.oschina.net/woter/blog/864529