@Test
public void testGetStorageUnitEntityByBusinessObjectDataAndStorageNameStorageUnitNoExists()
{

    // Create a business object data entity.
    BusinessObjectDataEntity businessObjectDataEntity = new BusinessObjectDataEntity();
    // Create a storage entity
    StorageEntity storageEntity = new StorageEntity();
    // Mock the external calls.
    when(storageDao.getStorageByName(STORAGE_NAME)).thenReturn(storageEntity);
    when(storageUnitDao.getStorageUnitByBusinessObjectDataAndStorage(businessObjectDataEntity, storageEntity)).thenReturn(null);
    when(businessObjectDataHelper.businessObjectDataEntityAltKeyToString(businessObjectDataEntity)).thenReturn(BUSINESS_OBJECT_DATA_KEY_AS_STRING);
    // Try to call the method under test.
    try
    {
        storageUnitDaoHelper.getStorageUnitEntity(STORAGE_NAME, businessObjectDataEntity);
        fail();
    }
    catch (ObjectNotFoundException e)
    {
        assertEquals(String
                .format("Could not find storage unit in \"%s\" storage for the business object data {%s}.", STORAGE_NAME, BUSINESS_OBJECT_DATA_KEY_AS_STRING),
            e.getMessage());
    }
    // Verify the external calls.
    verify(storageDao).getStorageByName(STORAGE_NAME);
    verify(storageUnitDao).getStorageUnitByBusinessObjectDataAndStorage(businessObjectDataEntity, storageEntity);
    verify(businessObjectDataHelper).businessObjectDataEntityAltKeyToString(businessObjectDataEntity);
    verifyNoMoreInteractionsHelper();
}