如何在运行mockito测试用例时初始化System.getProperty(path)以获取本地系统的路径

时间:2015-05-05 06:58:18

标签: junit mockito

它与mockito测试用例有关。 运行我的测试用例时,我需要初始化一个包含本地系统路径的字符串来读取属性文件,但每次我得到null

我正在使用System.getProperty(constant);来检索属性文件路径,但它会返回null

1 个答案:

答案 0 :(得分:0)

System.getProperty(constant); 

由于未设置属性,该行失败。

如何运行测试用例? Eclipse,maven还是别的什么?

相关问题