@Test
public void testValidateStorageUnitS3FilesNotRegisteredS3FileFound() throws IOException
{

    StorageUnit storageUnit = createStorageUnit(TEST_S3_KEY_PREFIX, new ArrayList<>(), FILE_SIZE_1_KB);
    List<String> actualS3Files = Collections.singletonList(String.format("%s/%s", TEST_S3_KEY_PREFIX, LOCAL_FILES.get(0)));
    // Try to validate S3 files when we have not registered S3 file.
    try
    {
        storageFileHelper.validateStorageUnitS3Files(storageUnit, actualS3Files, TEST_S3_KEY_PREFIX);
        fail("Should throw a RuntimeException when S3 contains unregistered S3 file.");
    }
    catch (RuntimeException e)
    {
        String expectedErrMsg = String.format("Found S3 file \"%s\" in \"%s\" storage not registered with this business object data.", actualS3Files.get(0),
            storageUnit.getStorage().getName());
        assertEquals(expectedErrMsg, e.getMessage());
    }
}