@Test
public void testUpdateStoragePolicyTransitionFailedAttemptsIgnoreExceptionImplFirstFailure()
{

    // Create a business object data key.
    BusinessObjectDataKey businessObjectDataKey =
        new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES,
            DATA_VERSION);
    // Create a storage unit entity with its storagePolicyTransitionFailedAttempts set to NULL.
    StorageUnitEntity storageUnitEntity = new StorageUnitEntity();
    // 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 policy transition parameters DTO.
    StoragePolicyTransitionParamsDto storagePolicyTransitionParamsDto = new StoragePolicyTransitionParamsDto();
    storagePolicyTransitionParamsDto.setBusinessObjectDataKey(businessObjectDataKey);
    storagePolicyTransitionParamsDto.setStorageName(STORAGE_NAME);
    // Mock the external calls.
    when(storageUnitHelper.createBusinessObjectDataStorageUnitKey(businessObjectDataKey, STORAGE_NAME)).thenReturn(businessObjectDataStorageUnitKey);
    when(storageUnitDaoHelper.getStorageUnitEntityByKey(businessObjectDataStorageUnitKey)).thenReturn(storageUnitEntity);
    // Call the method under test.
    storagePolicyProcessorHelperServiceImpl.updateStoragePolicyTransitionFailedAttemptsIgnoreException(storagePolicyTransitionParamsDto);
    // Verify the external calls.
    verify(jsonHelper).objectToJson(storagePolicyTransitionParamsDto);
    verify(storageUnitHelper).createBusinessObjectDataStorageUnitKey(businessObjectDataKey, STORAGE_NAME);
    verify(storageUnitDaoHelper).getStorageUnitEntityByKey(businessObjectDataStorageUnitKey);
    verify(storageUnitDao).saveAndRefresh(storageUnitEntity);
    verify(jsonHelper).objectToJson(businessObjectDataStorageUnitKey);
    verifyNoMoreInteractionsHelper();
    // Validate the results. The counter value now should be equal to 1.
    assertEquals(Integer.valueOf(1), storageUnitEntity.getStoragePolicyTransitionFailedAttempts());
}