diff --git a/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java b/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java index 935518b..ebe04c9 100644 --- a/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java +++ b/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java @@ -106,7 +106,8 @@ public class WMICrawlerTest { ObjectMapper mapper = new ObjectMapper(); - String p = ResourceLoader.class.getClass().getResource("/config/example.json").getPath(); + ClassLoader classLoader = getClass().getClassLoader(); + String p = classLoader.getResource("config/example.json").getFile(); System.out.println(p); @@ -121,7 +122,8 @@ public class WMICrawlerTest { public void testWMIJson() throws Exception { ObjectMapper mapper = new ObjectMapper(); - String p = ResourceLoader.class.getClass().getResource("/config/example.json").getPath(); + ClassLoader classLoader = getClass().getClassLoader(); + String p = classLoader.getResource("config/example.json").getFile(); Config c = mapper.readValue(new File(p),Config.class); // Map map = new HashMap<>();