@Test void should_fail_to_dump_xml_rule_set() { when(fs.workDir()).thenReturn(new File("xxx")); final Throwable thrown = catchThrowable(() -> configuration.dumpXmlRuleSet("pmd", "<xml>")); assertThat(thrown) .isInstanceOf(IllegalStateException.class) .hasMessage("Fail to save the PMD configuration"); }
File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = writeToWorkingDirectory(rulesXml, repositoryKey + ".xml").toFile(); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD configuration", e); } }
PmdConfiguration { File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = writeToWorkingDirectory(rulesXml, repositoryKey + ".xml").toFile(); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD configuration", e); } } }
PmdConfiguration { File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = writeToWorkingDirectory(rulesXml, repositoryKey + ".xml").toFile(); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD configuration", e); } } PmdConfiguration(FileSystem fileSystem, Configuration settings); }
PmdConfiguration { File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = writeToWorkingDirectory(rulesXml, repositoryKey + ".xml").toFile(); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD configuration", e); } } PmdConfiguration(FileSystem fileSystem, Configuration settings);  }
PmdConfiguration { File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = writeToWorkingDirectory(rulesXml, repositoryKey + ".xml").toFile(); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD configuration", e); } } PmdConfiguration(FileSystem fileSystem, Configuration settings);   }