### Question:
LocalBackupUploader extends AbstractBackupUploader { @Override public void doWriteBackup(InputStream inputStream, String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Files.createDirectories(Paths.get(getUploadFilePath())); Files.copy(inputStream, Paths.get(getUploadFilePath(), uniqueFileName), StandardCopyOption.REPLACE_EXISTING); } catch (IOException ex) { throw new BackupException("Error with writing backup file.", ex); } } LocalBackupUploader(String uploadFilePath); @Override void doWriteBackup(InputStream inputStream, String uniqueFileName); @Override InputStream doReadBackup(String uniqueFileName); @Override void doRemoveBackup(String uniqueFileName);  }### Answer:
@Test public void doWriteBackupWithBackupPathCreation() throws IOException { localBackupUploader.doWriteBackup(getInputStreamFromBytes(BYTE_SEQ_1), UNIQUE_FILE_NAME_1); assertThat(Files.exists(UNIQUE_FILE_PATH_1)).isTrue(); assertThat(Files.readAllBytes(UNIQUE_FILE_PATH_1)).isEqualTo(BYTE_SEQ_1); }
@Test public void doWriteBackup_Failed_OnInvalidPath() throws IBackupUploader.BackupException { localBackupUploader = new LocalBackupUploader(""); exceptionRule.expect(IBackupUploader.BackupException.class); exceptionRule.expectMessage("Error with writing backup file"); localBackupUploader.doWriteBackup(getInputStreamFromBytes(BYTE_SEQ_1), ""); }