@Test
public void testValidateStorageUnitS3FilesS3KeyPrefixMismatch() throws IOException
{

    StorageUnit storageUnit = createStorageUnit("SOME_S3_KEY_PREFIX", LOCAL_FILES, FILE_SIZE_1_KB);
    // Try to validate S3 files when we have not registered S3 file.
    try
    {
        storageFileHelper.validateStorageUnitS3Files(storageUnit, new ArrayList<>(), TEST_S3_KEY_PREFIX);
        fail("Should throw a RuntimeException when registered S3 file does match S3 key prefix.");
    }
    catch (RuntimeException e)
    {
        String expectedErrMsg = String.format("Storage file S3 key prefix \"%s\" does not match the expected S3 key prefix \"%s\".",
            storageUnit.getStorageFiles().get(0).getFilePath(), TEST_S3_KEY_PREFIX);
        assertEquals(expectedErrMsg, e.getMessage());
    }
}