@Test public void getConfigsThrowsExceptionIfThereIsAnInvalidConfig() throws Exception { File config1 = new File(muleFolder, CONFIG_1); File config2 = new File(muleFolder, CONFIG_2); String expectedExceptionMessage = "Element type \"xml-module:validate-schema\" must be followed by either attribute specifications, \">\" or \"/>\""; config1.createNewFile(); FileUtils.writeStringToFile(config1, DEFAULT_MULE_CONFIG_CONTENT, Charset.defaultCharset()); config2.createNewFile(); FileUtils.writeStringToFile(config2, MALFORMED_MULE_CONFIG_CONTENT, Charset.defaultCharset()); expectedException.expect(RuntimeException.class); expectedException.expectMessage(StringContains.containsString(expectedExceptionMessage)); List<String> actualConfigs = resolver.getConfigs(); }
public List<String> getConfigs() throws IOException { if (configs == null) { List<String> candidateConfigs = getResources(projectStructure.getConfigsPath(), new SuffixFileFilter(CONFIG_FILE_EXTENSION)); configs = candidateConfigs.stream() .filter(config -> hasMuleAsRootElement(projectStructure.getConfigsPath().resolve(config))).collect(toList()); } return configs; }
MuleArtifactContentResolver { public List<String> getConfigs() throws IOException { if (configs == null) { List<String> candidateConfigs = getResources(projectStructure.getConfigsPath(), new SuffixFileFilter(CONFIG_FILE_EXTENSION)); configs = candidateConfigs.stream() .filter(config -> hasMuleAsRootElement(projectStructure.getConfigsPath().resolve(config))).collect(toList()); } return configs; } }
MuleArtifactContentResolver { public List<String> getConfigs() throws IOException { if (configs == null) { List<String> candidateConfigs = getResources(projectStructure.getConfigsPath(), new SuffixFileFilter(CONFIG_FILE_EXTENSION)); configs = candidateConfigs.stream() .filter(config -> hasMuleAsRootElement(projectStructure.getConfigsPath().resolve(config))).collect(toList()); } return configs; } MuleArtifactContentResolver(ProjectStructure projectStructure, Pom pom, List<BundleDependency> bundleDependencies); }
MuleArtifactContentResolver { public List<String> getConfigs() throws IOException { if (configs == null) { List<String> candidateConfigs = getResources(projectStructure.getConfigsPath(), new SuffixFileFilter(CONFIG_FILE_EXTENSION)); configs = candidateConfigs.stream() .filter(config -> hasMuleAsRootElement(projectStructure.getConfigsPath().resolve(config))).collect(toList()); } return configs; } MuleArtifactContentResolver(ProjectStructure projectStructure, Pom pom, List<BundleDependency> bundleDependencies); ProjectStructure getProjectStructure(); List<String> getExportedPackages(); List<String> getExportedResources(); List<String> getTestExportedResources(); List<String> getConfigs(); List<String> getTestConfigs(); static String escapeSlashes(String p); List<BundleDependency> getBundleDependencies(); Pom getPom(); }
MuleArtifactContentResolver { public List<String> getConfigs() throws IOException { if (configs == null) { List<String> candidateConfigs = getResources(projectStructure.getConfigsPath(), new SuffixFileFilter(CONFIG_FILE_EXTENSION)); configs = candidateConfigs.stream() .filter(config -> hasMuleAsRootElement(projectStructure.getConfigsPath().resolve(config))).collect(toList()); } return configs; } MuleArtifactContentResolver(ProjectStructure projectStructure, Pom pom, List<BundleDependency> bundleDependencies); ProjectStructure getProjectStructure(); List<String> getExportedPackages(); List<String> getExportedResources(); List<String> getTestExportedResources(); List<String> getConfigs(); List<String> getTestConfigs(); static String escapeSlashes(String p); List<BundleDependency> getBundleDependencies(); Pom getPom(); static final String CLASS_PATH_SEPARATOR; }