@Test public void generates_a_simple_comment_when_nothing_has_to_be_written() throws IOException { writer.write(Collections.emptyList()); String fileContents = String.join("\n", Files.readAllLines(outputFile.toPath(), StandardCharsets.UTF_8)); assertThat(fileContents).isEqualTo( " ); }
@Override public void write(Collection<Changeset> changelogsToInsert) { try { LOGGER.info("About to dry-run Liquigraph. Results in file {}", outputFile.getAbsolutePath()); Path path = outputFile.toPath(); reinitializeFile(path); if (changelogsToInsert.isEmpty()) { writeNothingToPersist(path); return; } writeHeaderMaybe(path); for (Changeset changeset : changelogsToInsert) { writeChangeset(changeset, path); } } catch (IOException e) { throw propagate(e); } }
ChangelogFileWriter implements ChangelogWriter { @Override public void write(Collection<Changeset> changelogsToInsert) { try { LOGGER.info("About to dry-run Liquigraph. Results in file {}", outputFile.getAbsolutePath()); Path path = outputFile.toPath(); reinitializeFile(path); if (changelogsToInsert.isEmpty()) { writeNothingToPersist(path); return; } writeHeaderMaybe(path); for (Changeset changeset : changelogsToInsert) { writeChangeset(changeset, path); } } catch (IOException e) { throw propagate(e); } } }
ChangelogFileWriter implements ChangelogWriter { @Override public void write(Collection<Changeset> changelogsToInsert) { try { LOGGER.info("About to dry-run Liquigraph. Results in file {}", outputFile.getAbsolutePath()); Path path = outputFile.toPath(); reinitializeFile(path); if (changelogsToInsert.isEmpty()) { writeNothingToPersist(path); return; } writeHeaderMaybe(path); for (Changeset changeset : changelogsToInsert) { writeChangeset(changeset, path); } } catch (IOException e) { throw propagate(e); } } ChangelogFileWriter(ConditionPrinter conditionPrinter, String database, File outputFile); }
ChangelogFileWriter implements ChangelogWriter { @Override public void write(Collection<Changeset> changelogsToInsert) { try { LOGGER.info("About to dry-run Liquigraph. Results in file {}", outputFile.getAbsolutePath()); Path path = outputFile.toPath(); reinitializeFile(path); if (changelogsToInsert.isEmpty()) { writeNothingToPersist(path); return; } writeHeaderMaybe(path); for (Changeset changeset : changelogsToInsert) { writeChangeset(changeset, path); } } catch (IOException e) { throw propagate(e); } } ChangelogFileWriter(ConditionPrinter conditionPrinter, String database, File outputFile); @Override void write(Collection<Changeset> changelogsToInsert); }
ChangelogFileWriter implements ChangelogWriter { @Override public void write(Collection<Changeset> changelogsToInsert) { try { LOGGER.info("About to dry-run Liquigraph. Results in file {}", outputFile.getAbsolutePath()); Path path = outputFile.toPath(); reinitializeFile(path); if (changelogsToInsert.isEmpty()) { writeNothingToPersist(path); return; } writeHeaderMaybe(path); for (Changeset changeset : changelogsToInsert) { writeChangeset(changeset, path); } } catch (IOException e) { throw propagate(e); } } ChangelogFileWriter(ConditionPrinter conditionPrinter, String database, File outputFile); @Override void write(Collection<Changeset> changelogsToInsert);  }