@TestPropertySource doesn't work for JUnit test with AnnotationConfigContextLoader in Spring 1.2.6

后端 未结 7 2062
无人及你
无人及你 2020-12-01 10:34

It doesn\'t seem that anything I do in Spring 4.1.17 with Spring Boot 1.2.6.RELEASE works at all. I just want to access the application properties and override them with te

7条回答
  •  天涯浪人
    2020-12-01 11:18

    If you have this problem and you're trying with yaml as properties file keep in mind that spring @TestPropertySource and @PropertySource doesn't work with yaml file, and properties won't be loaded properly.

    https://github.com/spring-projects/spring-boot/issues/10772#issuecomment-339581902

提交回复
热议问题