@Test public void loadMavenProperties() { Properties p = HarReplayMain.loadMavenProperties(); p.stringPropertyNames().forEach(key -> { String value = p.getProperty(key); System.out.format("%s = %s%n", key, value); assertFalse("expect filtered: " + value, value.startsWith("${")); }); }
static Properties loadMavenProperties() { Properties p = new Properties(); URL resource = HarReplayMain.class.getResource("/har-replay-exec/maven.properties"); if (resource == null) { log.info("maven.properties is not present on classpath"); return p; } try (InputStream in = resource.openStream()) { p.load(in); } catch (IOException e) { log.warn("failed to read from " + resource, e); } return p; }
HarReplayMain { static Properties loadMavenProperties() { Properties p = new Properties(); URL resource = HarReplayMain.class.getResource("/har-replay-exec/maven.properties"); if (resource == null) { log.info("maven.properties is not present on classpath"); return p; } try (InputStream in = resource.openStream()) { p.load(in); } catch (IOException e) { log.warn("failed to read from " + resource, e); } return p; } }
HarReplayMain { static Properties loadMavenProperties() { Properties p = new Properties(); URL resource = HarReplayMain.class.getResource("/har-replay-exec/maven.properties"); if (resource == null) { log.info("maven.properties is not present on classpath"); return p; } try (InputStream in = resource.openStream()) { p.load(in); } catch (IOException e) { log.warn("failed to read from " + resource, e); } return p; } HarReplayMain(); @VisibleForTesting  HarReplayMain(OptionParser parser); }
HarReplayMain { static Properties loadMavenProperties() { Properties p = new Properties(); URL resource = HarReplayMain.class.getResource("/har-replay-exec/maven.properties"); if (resource == null) { log.info("maven.properties is not present on classpath"); return p; } try (InputStream in = resource.openStream()) { p.load(in); } catch (IOException e) { log.warn("failed to read from " + resource, e); } return p; } HarReplayMain(); @VisibleForTesting  HarReplayMain(OptionParser parser); static void main(String[] args); }
HarReplayMain { static Properties loadMavenProperties() { Properties p = new Properties(); URL resource = HarReplayMain.class.getResource("/har-replay-exec/maven.properties"); if (resource == null) { log.info("maven.properties is not present on classpath"); return p; } try (InputStream in = resource.openStream()) { p.load(in); } catch (IOException e) { log.warn("failed to read from " + resource, e); } return p; } HarReplayMain(); @VisibleForTesting  HarReplayMain(OptionParser parser); static void main(String[] args);  }