spring test: 配置文件优先级

application.properties 默认

application-xxx.properties 高

systemEnvironment 高

test/main/resources/ 同名文件 ?

@TestPropertySource 优先级最高 


https://stackoverflow.com/questions/29669393/override-default-spring-boot-application-properties-settings-in-junit-test
https://www.baeldung.com/properties-with-spring#boot

@RunWith解释:   https://github.com/junit-team/junit4/wiki/test-runners#runwith-annotation

猜你喜欢

转载自www.cnblogs.com/yszzu/p/10033440.html