### Question:
FluentDriverScreenshotPersister { public void persistScreenshot(String fileName) { try { File destFile; if (configuration.getScreenshotPath() == null) { destFile = new File(fileName); } else { destFile = Paths.get(configuration.getScreenshotPath(), fileName).toFile(); } FileUtils.writeByteArrayToFile(destFile, prepareScreenshot()); LOGGER.info("Created screenshot at: " + destFile.getAbsolutePath()); } catch (IOException e) { throw new ScreenshotNotCreatedException("Error when taking the screenshot", e); } } FluentDriverScreenshotPersister(Configuration configuration, WebDriver driver); void persistScreenshot(String fileName);  }### Answer:
@Test public void shouldCreateScreenshotFromDriverWithNoConfiguration() throws IOException { mockScreenshotFromWebDriver(); initializeDestinationFile(); screenshotPersister.persistScreenshot(destinationFile.getAbsolutePath()); assertThat(destinationFile).exists(); }
@Test public void shouldCreateScreenshotFromDriverWithConfiguration() throws IOException { mockScreenshotFromWebDriver(); initializeDestinationFile(); when(configuration.getScreenshotPath()).thenReturn(destinationFile.getParent()); screenshotPersister.persistScreenshot(destinationFile.getName()); assertThat(destinationFile).exists(); }