@Test void should_ignore_xml_report_when_property_is_not_set() { Path reportFile = configuration.dumpXmlReport(new Report()); assertThat(reportFile).isNull(); verifyNoMoreInteractions(fs); }
Path dumpXmlReport(Report report) { if (!settings.getBoolean(PROPERTY_GENERATE_XML).orElse(false)) { return null; } try { final String reportAsString = reportToString(report); final Path reportFile = writeToWorkingDirectory(reportAsString, PMD_RESULT_XML); LOG.info("PMD output report: " + reportFile.toString()); return reportFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD report", e); } }
PmdConfiguration { Path dumpXmlReport(Report report) { if (!settings.getBoolean(PROPERTY_GENERATE_XML).orElse(false)) { return null; } try { final String reportAsString = reportToString(report); final Path reportFile = writeToWorkingDirectory(reportAsString, PMD_RESULT_XML); LOG.info("PMD output report: " + reportFile.toString()); return reportFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD report", e); } } }
PmdConfiguration { Path dumpXmlReport(Report report) { if (!settings.getBoolean(PROPERTY_GENERATE_XML).orElse(false)) { return null; } try { final String reportAsString = reportToString(report); final Path reportFile = writeToWorkingDirectory(reportAsString, PMD_RESULT_XML); LOG.info("PMD output report: " + reportFile.toString()); return reportFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD report", e); } } PmdConfiguration(FileSystem fileSystem, Configuration settings); }
PmdConfiguration { Path dumpXmlReport(Report report) { if (!settings.getBoolean(PROPERTY_GENERATE_XML).orElse(false)) { return null; } try { final String reportAsString = reportToString(report); final Path reportFile = writeToWorkingDirectory(reportAsString, PMD_RESULT_XML); LOG.info("PMD output report: " + reportFile.toString()); return reportFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD report", e); } } PmdConfiguration(FileSystem fileSystem, Configuration settings);  }
PmdConfiguration { Path dumpXmlReport(Report report) { if (!settings.getBoolean(PROPERTY_GENERATE_XML).orElse(false)) { return null; } try { final String reportAsString = reportToString(report); final Path reportFile = writeToWorkingDirectory(reportAsString, PMD_RESULT_XML); LOG.info("PMD output report: " + reportFile.toString()); return reportFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD report", e); } } PmdConfiguration(FileSystem fileSystem, Configuration settings);   }