diff options
| author | houjinchuan <[email protected]> | 2024-01-22 17:43:06 +0800 |
|---|---|---|
| committer | houjinchuan <[email protected]> | 2024-01-22 17:43:06 +0800 |
| commit | a8c3277ebac9d2158ad87a18ec2ec1873fd855a2 (patch) | |
| tree | 3bec2d8ea8de69bc23c14c395554e6e9e4b5f42e | |
| parent | e7fc4feb6fee1faed38a71a51cd0ec4fb281099a (diff) | |
修改单元测试中获取配置文件路径的方式
| -rw-r--r-- | src/test/java/com/zdjizhi/FileChunkCombinerTests.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/java/com/zdjizhi/FileChunkCombinerTests.java b/src/test/java/com/zdjizhi/FileChunkCombinerTests.java index a5b0652..67fab1e 100644 --- a/src/test/java/com/zdjizhi/FileChunkCombinerTests.java +++ b/src/test/java/com/zdjizhi/FileChunkCombinerTests.java @@ -83,7 +83,8 @@ public class FileChunkCombinerTests { @Before public void testBefore() throws Exception { - ParameterTool parameterTool = ParameterTool.fromPropertiesFile("C:\\Users\\root\\Documents\\file-chunk-combiner\\src\\main\\resources\\common.properties"); + String path = FileChunkCombinerTests.class.getClassLoader().getResource("common.properties").getPath(); + ParameterTool parameterTool = ParameterTool.fromPropertiesFile(path); configuration = parameterTool.getConfiguration(); duplicateChunkCounter = new SimpleCounter(); combineErrorCounter = new SimpleCounter(); |
