@Test
public void testValidateDownloadedS3FilesFileNoExists() throws IOException
{

    File targetLocalDirectory = Paths.get(LOCAL_TEMP_PATH.toString(), TEST_S3_KEY_PREFIX).toFile();
    createLocalFile(targetLocalDirectory.getPath(), "ACTUAL_FILE", FILE_SIZE_1_KB);
    StorageUnit storageUnit = createStorageUnit(TEST_S3_KEY_PREFIX, Collections.singletonList("EXPECTED_FILE"), FILE_SIZE_1_KB);
    // Try to validate non-existing local files.
    try
    {
        storageFileHelper.validateDownloadedS3Files(LOCAL_TEMP_PATH.toString(), TEST_S3_KEY_PREFIX, storageUnit);
        fail("Should throw a RuntimeException when actual local files do not exist.");
    }
    catch (RuntimeException e)
    {
        String expectedErrMsg = String.format("Downloaded \"%s\" file doesn't exist.",
            Paths.get(LOCAL_TEMP_PATH.toString(), storageUnit.getStorageFiles().get(0).getFilePath()).toFile().getPath());
        assertEquals(expectedErrMsg, e.getMessage());
    }
}