@Test
public void testGetStorageUnitStorageUnitNotRestored()
{

    // Create a business object data entity.
    BusinessObjectDataEntity businessObjectDataEntity = new BusinessObjectDataEntity();
    // Create a storage unit status entity.
    StorageUnitStatusEntity storageUnitStatusEntity = new StorageUnitStatusEntity();
    storageUnitStatusEntity.setCode(STORAGE_UNIT_STATUS);
    // Create a storage unit entity.
    StorageUnitEntity storageUnitEntity = new StorageUnitEntity();
    storageUnitEntity.setStatus(storageUnitStatusEntity);
    // Mock the external calls.
    when(storageUnitDaoHelper.getStorageUnitEntity(STORAGE_NAME, businessObjectDataEntity)).thenReturn(storageUnitEntity);
    when(businessObjectDataHelper.businessObjectDataEntityAltKeyToString(businessObjectDataEntity)).thenReturn(BUSINESS_OBJECT_DATA_KEY_AS_STRING);
    // Try to call the method under test.
    try
    {
        expireRestoredBusinessObjectDataHelperServiceImpl.getStorageUnit(STORAGE_NAME, businessObjectDataEntity);
    }
    catch (IllegalArgumentException e)
    {
        assertEquals(String
            .format("S3 storage unit in \"%s\" storage must have \"%s\" status, but it actually has \"%s\" status. Business object data: {%s}",
                STORAGE_NAME, StorageUnitStatusEntity.RESTORED, STORAGE_UNIT_STATUS, BUSINESS_OBJECT_DATA_KEY_AS_STRING), e.getMessage());
    }
    // Verify the external calls.
    verify(storageUnitDaoHelper).getStorageUnitEntity(STORAGE_NAME, businessObjectDataEntity);
    verify(businessObjectDataHelper).businessObjectDataEntityAltKeyToString(businessObjectDataEntity);
    verifyNoMoreInteractionsHelper();
}