* @throws Exception
*/
public void testReleasedSnapshotsWereNotCleaned()
throws Exception
{
KnownRepositoryContentConsumer repoPurgeConsumer =
(KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class,
"repo-purge-consumer-by-retention-count" );
populateDbForReleasedSnapshotsTest();
ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration();
repoConfiguration.setDeleteReleasedSnapshots( false ); // Set to NOT delete released snapshots.
addRepoToConfiguration( "retention-count", repoConfiguration );
repoPurgeConsumer.beginScan( repoConfiguration );
String repoRoot = prepareTestRepo();
repoPurgeConsumer.processFile( PATH_TO_RELEASED_SNAPSHOT );
// check if the snapshot wasn't removed
String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-plugin-plugin";
assertExists( projectRoot + "/2.3-SNAPSHOT" );