@Test void parseGnomeSettings() { final Map<String, String> result = GnomeProxyConfigReader.parseGnomeSettings(SAMPLE_OUTPUT); assertEquals("'none'", result.get(GNOME_PROXY_MODE)); assertEquals("'/tmp/foo/pac.js'", result.get(GNOME_PROXY_AUTOCONFIG_URL)); assertEquals("['localhost', '127.0.0.0/8', '::1']", result.get(GNOME_PROXY_IGNORE_HOSTS)); assertEquals("8080", result.get(GNOME_PROXY_HTTP_PORT)); }
static Map<String, String> parseGnomeSettings(String gnomeSettings) { final List<String> lines = splitIntoLines(gnomeSettings); return lines.stream() .map(String::trim) .filter(line -> !line.isEmpty()) .map(line -> line.split("\\s+", 3)) .filter(parts -> parts.length == 3) .collect(Collectors.toMap(parts -> parts[0] + ":" + parts[1], parts -> parts[2])); }
GnomeProxyConfigReader { static Map<String, String> parseGnomeSettings(String gnomeSettings) { final List<String> lines = splitIntoLines(gnomeSettings); return lines.stream() .map(String::trim) .filter(line -> !line.isEmpty()) .map(line -> line.split("\\s+", 3)) .filter(parts -> parts.length == 3) .collect(Collectors.toMap(parts -> parts[0] + ":" + parts[1], parts -> parts[2])); } }
GnomeProxyConfigReader { static Map<String, String> parseGnomeSettings(String gnomeSettings) { final List<String> lines = splitIntoLines(gnomeSettings); return lines.stream() .map(String::trim) .filter(line -> !line.isEmpty()) .map(line -> line.split("\\s+", 3)) .filter(parts -> parts.length == 3) .collect(Collectors.toMap(parts -> parts[0] + ":" + parts[1], parts -> parts[2])); }  }
GnomeProxyConfigReader { static Map<String, String> parseGnomeSettings(String gnomeSettings) { final List<String> lines = splitIntoLines(gnomeSettings); return lines.stream() .map(String::trim) .filter(line -> !line.isEmpty()) .map(line -> line.split("\\s+", 3)) .filter(parts -> parts.length == 3) .collect(Collectors.toMap(parts -> parts[0] + ":" + parts[1], parts -> parts[2])); }  static Optional<LinuxProxySettings> readGnomeProxyConfig(); }
GnomeProxyConfigReader { static Map<String, String> parseGnomeSettings(String gnomeSettings) { final List<String> lines = splitIntoLines(gnomeSettings); return lines.stream() .map(String::trim) .filter(line -> !line.isEmpty()) .map(line -> line.split("\\s+", 3)) .filter(parts -> parts.length == 3) .collect(Collectors.toMap(parts -> parts[0] + ":" + parts[1], parts -> parts[2])); }  static Optional<LinuxProxySettings> readGnomeProxyConfig();  }