ssh 快捷安装插件端检查配置文件不在使用 SpringBoot 非 public 工具类

This commit is contained in:
bwcx_jzy 2021-08-01 00:31:31 +08:00
parent 04633ab361
commit a2fbd6a7d6

View File

@ -1,4 +1,5 @@
import cn.hutool.core.io.resource.ResourceUtil;
import io.jpom.system.ConfigBean;
import org.junit.Test;
import org.springframework.boot.env.YamlPropertySourceLoader;
import org.springframework.core.env.PropertySource;
@ -23,5 +24,8 @@ public class TestYml {
List<PropertySource<?>> test = yamlPropertySourceLoader.load("test", new FileUrlResource(path));
PropertySource<?> propertySource = test.get(0);
System.out.println(propertySource);
Object user = propertySource.getProperty(ConfigBean.AUTHORIZE_USER_KEY);
System.out.println(user);
}
}