@Test
public void testUpdateBusinessObjectFormatRetentionInformationRetentionDateRetentionTypeWithRetentionPeriodInDays()
{

    // Create a business object format key without version.
    BusinessObjectFormatKey businessObjectFormatKey =
        new BusinessObjectFormatKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, NO_FORMAT_VERSION);
    // Create a retention type entity for BDATA_RETENTION_DATE.
    RetentionTypeEntity retentionTypeEntity = new RetentionTypeEntity();
    retentionTypeEntity.setCode(RetentionTypeEntity.BDATA_RETENTION_DATE);
    // Mock the external calls.
    when(businessObjectFormatDaoHelper.getRecordRetentionTypeEntity(RetentionTypeEntity.BDATA_RETENTION_DATE)).thenReturn(retentionTypeEntity);
    // Try to call the method under test with retention period in days specified for BDATA_RETENTION_DATE retention type.
    try
    {
        businessObjectFormatServiceImpl.updateBusinessObjectFormatRetentionInformation(businessObjectFormatKey,
            new BusinessObjectFormatRetentionInformationUpdateRequest(RECORD_FLAG_SET, RETENTION_PERIOD_DAYS, RetentionTypeEntity.BDATA_RETENTION_DATE));
        fail();
    }
    catch (IllegalArgumentException e)
    {
        assertEquals(String.format("A retention period in days cannot be specified for %s retention type.", RetentionTypeEntity.BDATA_RETENTION_DATE),
            e.getMessage());
    }
    // Verify the external calls.
    verify(businessObjectFormatHelper).validateBusinessObjectFormatKey(businessObjectFormatKey, false);
    verify(businessObjectFormatDaoHelper).getRecordRetentionTypeEntity(RetentionTypeEntity.BDATA_RETENTION_DATE);
    verifyNoMoreInteractionsHelper();
}