@Test
public void testCreateStorageUnitKeyFromEntity()
{

    // Create a business object data storage unit key.
    BusinessObjectDataStorageUnitKey businessObjectDataStorageUnitKey =
        new BusinessObjectDataStorageUnitKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE,
            SUBPARTITION_VALUES, DATA_VERSION, STORAGE_NAME);
    // Create a storage unit entity.
    StorageUnitEntity storageUnitEntity = storageUnitDaoTestHelper.createStorageUnitEntity(businessObjectDataStorageUnitKey, STORAGE_UNIT_STATUS);
    // Mock the external calls.
    when(businessObjectDataHelper.getSubPartitionValues(storageUnitEntity.getBusinessObjectData())).thenReturn(SUBPARTITION_VALUES);
    // Call the method under test.
    BusinessObjectDataStorageUnitKey result = storageUnitHelper.createStorageUnitKeyFromEntity(storageUnitEntity);
    // Verify the external calls.
    verify(businessObjectDataHelper).getSubPartitionValues(storageUnitEntity.getBusinessObjectData());
    verifyNoMoreInteractionsHelper();
    // Validate the results.
    assertEquals(new BusinessObjectDataStorageUnitKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE,
        SUBPARTITION_VALUES, DATA_VERSION, STORAGE_NAME), result);
}