@Test void create_invalidPath_expectFailure() { VisualiserWriterFactory writerFactory = new VisualiserWriterFactory(new File("madeUpBadPath").toPath()); assertThrows(FileNotFoundException.class, () -> writerFactory.create("destination")); }
public Writer create(String destination) throws IOException { String destinationFileName = outputFolder + File.separator + destination + ".dot"; System.err.println("CREATING VISUALISER WRITER with destinationFile=" + destinationFileName); return new OutputStreamWriter(new FileOutputStream(destinationFileName), StandardCharsets.UTF_8); }
VisualiserWriterFactory { public Writer create(String destination) throws IOException { String destinationFileName = outputFolder + File.separator + destination + ".dot"; System.err.println("CREATING VISUALISER WRITER with destinationFile=" + destinationFileName); return new OutputStreamWriter(new FileOutputStream(destinationFileName), StandardCharsets.UTF_8); } }
VisualiserWriterFactory { public Writer create(String destination) throws IOException { String destinationFileName = outputFolder + File.separator + destination + ".dot"; System.err.println("CREATING VISUALISER WRITER with destinationFile=" + destinationFileName); return new OutputStreamWriter(new FileOutputStream(destinationFileName), StandardCharsets.UTF_8); } VisualiserWriterFactory(Path outputFolder); }
VisualiserWriterFactory { public Writer create(String destination) throws IOException { String destinationFileName = outputFolder + File.separator + destination + ".dot"; System.err.println("CREATING VISUALISER WRITER with destinationFile=" + destinationFileName); return new OutputStreamWriter(new FileOutputStream(destinationFileName), StandardCharsets.UTF_8); } VisualiserWriterFactory(Path outputFolder); Writer create(String destination); }
VisualiserWriterFactory { public Writer create(String destination) throws IOException { String destinationFileName = outputFolder + File.separator + destination + ".dot"; System.err.println("CREATING VISUALISER WRITER with destinationFile=" + destinationFileName); return new OutputStreamWriter(new FileOutputStream(destinationFileName), StandardCharsets.UTF_8); } VisualiserWriterFactory(Path outputFolder); Writer create(String destination);  }