@Test
public void testRetention()
{

    systemSettingManager.saveSystemSetting( SettingKey.FILE_RESOURCE_RETENTION_STRATEGY, FileResourceRetentionStrategy.THREE_MONTHS );
    content = "filecontentA".getBytes();
    dataValueA = createFileResourceDataValue( 'A', content );
    assertNotNull( fileResourceService.getFileResource( dataValueA.getValue() ) );
    content = "filecontentB".getBytes();
    dataValueB = createFileResourceDataValue( 'B', content );
    assertNotNull( fileResourceService.getFileResource( dataValueB.getValue() ) );
    content = "fileResourceC".getBytes();
    FileResource fileResource = createFileResource( 'C', content );
    dataValueB.setValue( fileResource.getUid() );
    dataValueService.updateDataValue( dataValueB );
    fileResource.setAssigned( true );
    dataValueAuditService.getDataValueAudits( dataValueB ).get( 0 )
        .setCreated( getDate( 2000, 1, 1 ) );
    cleanUpJob.execute( null );
    assertNotNull( fileResourceService.getFileResource( dataValueA.getValue() ) );
    assertTrue( fileResourceService.getFileResource( dataValueA.getValue() ).isAssigned() );
    assertNull( dataValueService.getDataValue( dataValueA.getDataElement(), dataValueA.getPeriod(), dataValueA.getSource(), null ) );
    assertNull( fileResourceService.getFileResource( dataValueB.getValue() ) );
}