@Test
public void testValidateDownloadedS3FilesFileSizeMismatch() throws IOException
{

    File targetLocalDirectory = Paths.get(LOCAL_TEMP_PATH.toString(), TEST_S3_KEY_PREFIX).toFile();
    createLocalFiles(targetLocalDirectory.getPath(), FILE_SIZE_1_KB);
    StorageUnit storageUnit = createStorageUnit(TEST_S3_KEY_PREFIX, LOCAL_FILES, FILE_SIZE_1_KB * 2);
    // Try to validate the local files, when actual file sizes do not not match to the storage unit information.
    try
    {
        storageFileHelper.validateDownloadedS3Files(LOCAL_TEMP_PATH.toString(), TEST_S3_KEY_PREFIX, storageUnit);
        fail("Should throw a RuntimeException when actual file sizes do not not match to the storage unit information.");
    }
    catch (RuntimeException e)
    {
        String expectedErrMsg = String
            .format("Size of the downloaded \"%s\" S3 file does not match the expected value (expected %d bytes, actual %d bytes).",
                Paths.get(LOCAL_TEMP_PATH.toString(), storageUnit.getStorageFiles().get(0).getFilePath()).toFile().getPath(), FILE_SIZE_1_KB * 2,
                FILE_SIZE_1_KB);
        assertEquals(expectedErrMsg, e.getMessage());
    }
}