summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhoujinchuan <[email protected]>2024-01-22 17:43:06 +0800
committerhoujinchuan <[email protected]>2024-01-22 17:43:06 +0800
commita8c3277ebac9d2158ad87a18ec2ec1873fd855a2 (patch)
tree3bec2d8ea8de69bc23c14c395554e6e9e4b5f42e
parente7fc4feb6fee1faed38a71a51cd0ec4fb281099a (diff)
修改单元测试中获取配置文件路径的方式
-rw-r--r--src/test/java/com/zdjizhi/FileChunkCombinerTests.java3
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();