我的流程中有一些占位符。这些占位符的值在属性文件(在classpath中)中指定。我正在使用 java 做 munit。目前,这些占位符不会被属性文件中的值替换。知道如何在运行 munit 时加载此文件吗?
我的单元是这样的:
Class MyClass extends FunctionalMunitSuite{
@Override
protected String getConfigResources() {
//try 1[gave give value pairs directly]: didnt worked
System.getProperties().put("prop.key", "value");
//try2[load prop files]:didn't worked
prop.load(this.getClass().getResourceAsStream("mypropertyfile.properties"));
System.setProperties(prop);
}
}