yml自定义属性和值

测试类:

import com.spx.App;
import com.spx.config.MyProperties;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = App.class)
public class MyPropertiesTest {

    @Autowired
    private MyProperties properties;

    @Test
    public void test(){
        System.out.println(properties.getArray());
        System.out.println(properties.getList());
        System.out.println(properties.getMap());
        System.out.println(properties.getListMap());
    }
}

yml自定义属性和值

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-11-04
  • 2022-12-23
猜你喜欢
  • 2021-10-26
  • 2021-11-04
  • 2022-12-23
  • 2021-11-30
  • 2022-01-02
  • 2021-10-28
  • 2021-04-13
相关资源
相似解决方案