@Test (expected = IllegalArgumentException.class) public void readNonExistingConfigFile() { ConfigReader.parse(ConfigReaderTest.class.getResourceAsStream("/dummy.json")); }
public static WebPushServerConfig parse(final String fileName) throws Exception { final File configFile = new File(fileName); try (InputStream in = configFile.exists() ? new FileInputStream(configFile) : ConfigReader.class.getResourceAsStream(fileName)) { return parse(in); } }
ConfigReader { public static WebPushServerConfig parse(final String fileName) throws Exception { final File configFile = new File(fileName); try (InputStream in = configFile.exists() ? new FileInputStream(configFile) : ConfigReader.class.getResourceAsStream(fileName)) { return parse(in); } } }
ConfigReader { public static WebPushServerConfig parse(final String fileName) throws Exception { final File configFile = new File(fileName); try (InputStream in = configFile.exists() ? new FileInputStream(configFile) : ConfigReader.class.getResourceAsStream(fileName)) { return parse(in); } } private  ConfigReader(); }
ConfigReader { public static WebPushServerConfig parse(final String fileName) throws Exception { final File configFile = new File(fileName); try (InputStream in = configFile.exists() ? new FileInputStream(configFile) : ConfigReader.class.getResourceAsStream(fileName)) { return parse(in); } } private  ConfigReader(); static WebPushServerConfig parse(final String fileName); static WebPushServerConfig parse(final InputStream in); }
ConfigReader { public static WebPushServerConfig parse(final String fileName) throws Exception { final File configFile = new File(fileName); try (InputStream in = configFile.exists() ? new FileInputStream(configFile) : ConfigReader.class.getResourceAsStream(fileName)) { return parse(in); } } private  ConfigReader(); static WebPushServerConfig parse(final String fileName); static WebPushServerConfig parse(final InputStream in);  }