springboot读取yml文件中数组配置_springboot yml配置数组参数-CSDN博客

网站介绍:文章浏览阅读1.1k次。1.yml文件配置shopcode: list: 2020,2021,2022 这样写无需写配置类读取,直接@value读取,中间用逗号隔开2.测试读取@SpringBootTest(classes = Application.class)@RunWith(SpringRunner.class)public class TestClass { @Value("${shopCode.list}") private String[] list; @Test_springboot yml配置数组参数