LocalizerResourceConfig { public List<String> getResourceNames() { Config subConfig = config.subset(RESOURCE_PREFIX, true); List<String> resourceNames = new ArrayList<String>(); for (String key : subConfig.keySet()) { if (key.endsWith(PATH_SUFFIX)) { resourceNames.add(key.substring(0, key.length() - PATH_SUFFIX.length())); } } return resourceNames; } LocalizerResourceConfig(final Config config); List<String> getResourceNames(); Path getResourcePath(final String resourceName); LocalResourceType getResourceLocalType(final String resourceName); LocalResourceVisibility getResourceLocalVisibility(final String resourceName); String getResourceLocalName(final String resourceName);  }
@Test public void testResourcrConfigNotIncluded() { Map<String, String> configMap = new HashMap<>(); configMap.put("otherconfig", "https: configMap.put("yarn.resources.myResource2.local.name", "notExisting"); configMap.put("yarn.resources.myResource2.local.type", "file"); configMap.put("yarn.resources.myResource2.local.visibility", "application"); Config conf = new MapConfig(configMap); LocalizerResourceConfig manager = new LocalizerResourceConfig(conf); assertEquals(0, manager.getResourceNames().size()); }