@Test public void testGetNames() throws Exception { Map<String, String> names = scr.getCountryNames(); assertTrue(names.containsKey("Aruba")); assertEquals("ABW", names.get("Aruba")); int lbnCount = 0; for (String s : names.values()) { if ("LBN".equals(s)) { lbnCount++; } } assertEquals(6, lbnCount); }
private static List<String> getNames(JsonNode node) { List<String> names = new ArrayList<>(); names.addAll(node.findValuesAsText("common")); names.addAll(node.findValuesAsText("official")); return names.stream().filter(s -> !Strings.isNullOrEmpty(s)).collect(Collectors.toList()); }
SharedCountryResource extends BaleenResource { private static List<String> getNames(JsonNode node) { List<String> names = new ArrayList<>(); names.addAll(node.findValuesAsText("common")); names.addAll(node.findValuesAsText("official")); return names.stream().filter(s -> !Strings.isNullOrEmpty(s)).collect(Collectors.toList()); } }
SharedCountryResource extends BaleenResource { private static List<String> getNames(JsonNode node) { List<String> names = new ArrayList<>(); names.addAll(node.findValuesAsText("common")); names.addAll(node.findValuesAsText("official")); return names.stream().filter(s -> !Strings.isNullOrEmpty(s)).collect(Collectors.toList()); }  }
SharedCountryResource extends BaleenResource { private static List<String> getNames(JsonNode node) { List<String> names = new ArrayList<>(); names.addAll(node.findValuesAsText("common")); names.addAll(node.findValuesAsText("official")); return names.stream().filter(s -> !Strings.isNullOrEmpty(s)).collect(Collectors.toList()); }  Map<String, String> getDemonyms(); String getGeoJson(String countryCode); Map<String, String> getCountryNames(); }
SharedCountryResource extends BaleenResource { private static List<String> getNames(JsonNode node) { List<String> names = new ArrayList<>(); names.addAll(node.findValuesAsText("common")); names.addAll(node.findValuesAsText("official")); return names.stream().filter(s -> !Strings.isNullOrEmpty(s)).collect(Collectors.toList()); }  Map<String, String> getDemonyms(); String getGeoJson(String countryCode); Map<String, String> getCountryNames();  }