@Test public void extractCountryCodes_should_ignore_sub_folders() { assertThat(cut.extractCountryCodes(new String[] { "fr+us", "fr+de" })).isEqualTo("fr,us"); }
String extractCountryCodes(String[] path) { if (path != null && path.length != 0) { String rootFolder = path[0]; if (StringUtils.isNotEmpty(rootFolder)) { final Set<String> countryCodes = Arrays.stream(rootFolder.split("\\+")) .map(String::trim) .filter(StringUtils::isNotEmpty) .collect(Collectors.toCollection(TreeSet::new)); if (countryCodes.isEmpty() || countryCodes.contains(Tag.COUNTRY_ALL)) { countryCodes.clear(); countryCodes.add(Tag.COUNTRY_ALL); } return String.join(Scenario.COUNTRY_CODES_SEPARATOR, countryCodes); } } return Tag.COUNTRY_ALL; }
PostmanScenarioIndexerService { String extractCountryCodes(String[] path) { if (path != null && path.length != 0) { String rootFolder = path[0]; if (StringUtils.isNotEmpty(rootFolder)) { final Set<String> countryCodes = Arrays.stream(rootFolder.split("\\+")) .map(String::trim) .filter(StringUtils::isNotEmpty) .collect(Collectors.toCollection(TreeSet::new)); if (countryCodes.isEmpty() || countryCodes.contains(Tag.COUNTRY_ALL)) { countryCodes.clear(); countryCodes.add(Tag.COUNTRY_ALL); } return String.join(Scenario.COUNTRY_CODES_SEPARATOR, countryCodes); } } return Tag.COUNTRY_ALL; } }
PostmanScenarioIndexerService { String extractCountryCodes(String[] path) { if (path != null && path.length != 0) { String rootFolder = path[0]; if (StringUtils.isNotEmpty(rootFolder)) { final Set<String> countryCodes = Arrays.stream(rootFolder.split("\\+")) .map(String::trim) .filter(StringUtils::isNotEmpty) .collect(Collectors.toCollection(TreeSet::new)); if (countryCodes.isEmpty() || countryCodes.contains(Tag.COUNTRY_ALL)) { countryCodes.clear(); countryCodes.add(Tag.COUNTRY_ALL); } return String.join(Scenario.COUNTRY_CODES_SEPARATOR, countryCodes); } } return Tag.COUNTRY_ALL; }  }
PostmanScenarioIndexerService { String extractCountryCodes(String[] path) { if (path != null && path.length != 0) { String rootFolder = path[0]; if (StringUtils.isNotEmpty(rootFolder)) { final Set<String> countryCodes = Arrays.stream(rootFolder.split("\\+")) .map(String::trim) .filter(StringUtils::isNotEmpty) .collect(Collectors.toCollection(TreeSet::new)); if (countryCodes.isEmpty() || countryCodes.contains(Tag.COUNTRY_ALL)) { countryCodes.clear(); countryCodes.add(Tag.COUNTRY_ALL); } return String.join(Scenario.COUNTRY_CODES_SEPARATOR, countryCodes); } } return Tag.COUNTRY_ALL; }  List<Scenario> extractScenarios(Source source, File zipFile); }
PostmanScenarioIndexerService { String extractCountryCodes(String[] path) { if (path != null && path.length != 0) { String rootFolder = path[0]; if (StringUtils.isNotEmpty(rootFolder)) { final Set<String> countryCodes = Arrays.stream(rootFolder.split("\\+")) .map(String::trim) .filter(StringUtils::isNotEmpty) .collect(Collectors.toCollection(TreeSet::new)); if (countryCodes.isEmpty() || countryCodes.contains(Tag.COUNTRY_ALL)) { countryCodes.clear(); countryCodes.add(Tag.COUNTRY_ALL); } return String.join(Scenario.COUNTRY_CODES_SEPARATOR, countryCodes); } } return Tag.COUNTRY_ALL; }  List<Scenario> extractScenarios(Source source, File zipFile);  }