cmvr-wms/ruoyi-admin/src/test/java/com/ruoyi/projectdev/ProfileConfiguration.java

18 lines
641 B
Java
Raw Normal View History

package com.ruoyi.projectdev;
import java.util.Properties;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.core.io.ClassPathResource;
/** Loads the same committed settings as the application; never logs credentials. */
public final class ProfileConfiguration {
private ProfileConfiguration() { }
public static Properties load(String profile) {
var yaml = new YamlPropertiesFactoryBean();
yaml.setResources(new ClassPathResource("application.yml"),
new ClassPathResource("application-" + profile + ".yml"));
return yaml.getObject();
}
}