### Question:
BackupUploadService implements IBackupUploadService { @Override public BackupState createBackup(InputStream inputStream, String uniqueFileName) throws IBackupUploader.BackupException { backupUploader.doWriteBackup(inputStream, uniqueFileName); log.debug("sopInstanceUID={}, backup saved.", uniqueFileName); return new BackupState(uniqueFileName, attemptsAmount); } BackupUploadService(IBackupUploader backupUploader, BackupFlags backupFlags, DelayCalculator delayCalculator); @Override BackupState createBackup(InputStream inputStream, String uniqueFileName); @Override InputStream getBackupStream(String uniqueFileName); @Override void startUploading(IDicomWebClient webClient, BackupState backupState); @Override void removeBackup(String fileName); boolean filterHttpCode(Integer actualHttpStatus);  }### Answer:
@Test public void createBackup_success() throws BackupException { BackupState actualBackupState = backupUploadService.createBackup(backupInputStream, UNIQUE_FILE_NAME); verify(backupUploaderMock).doWriteBackup(eq(backupInputStream), eq(UNIQUE_FILE_NAME)); assertThat(actualBackupState.getAttemptsCountdown()).isEqualTo(ATTEMPTS_AMOUNT_ONE); assertThat(actualBackupState.getUniqueFileName()).isEqualTo(UNIQUE_FILE_NAME); }
@Test public void createBackup_failOnBackupException() throws BackupException { String exceptionMsg = "exMsg"; exceptionRule.expect(BackupException.class); exceptionRule.expectMessage(exceptionMsg); doThrow(new BackupException(exceptionMsg)).when(backupUploaderMock).doWriteBackup(isA(InputStream.class), anyString()); backupUploadService.createBackup(backupInputStream, UNIQUE_FILE_NAME); }