SpringBoot系列之YAML配置用法 (2)

写个junit测试类来单元测试:

import org.junit.Test; import org.junit.runner.RunWith; import org.muses.jeeplatform.bean.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @org.springframework.boot.test.context.SpringBootTest public class SpringBootTest { @Autowired User user; @Test public void testConfigurationProperties(){ System.out.println(user); } } User{userName='root', isAdmin=false, regTime=Fri Nov 01 00:00:00 CST 2019, isOnline=1, maps={k1=v1, k2=v2}, lists=[list1, list2], address=Address{tel='15899988899',}}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpswjx.html