解决方法:
Map map = null;
Yaml yaml = new Yaml();
File ymlFile = new File("c:/src/test/java/application.yml");
if (ymlFile != null && ymlFile.exists()) { map = (Map) yaml.load(new FileInputStream(ymlFile)); }