{
File repoDir = new File( getBasedir(), "src/test/repositories/default-repository" );
assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
ArchivaConfiguration archivaConfig = (ArchivaConfiguration) lookup( ArchivaConfiguration.class );
assertNotNull( archivaConfig );
// Create it
ManagedRepositoryConfiguration repo = createRepository( "testRepo", "Test Repository", repoDir );
assertNotNull( repo );
archivaConfig.getConfiguration().getManagedRepositories().clear();
archivaConfig.getConfiguration().addManagedRepository( repo );
RepositoryTask repoTask = new RepositoryTask();
repoTask.setName( "testRepoTask" );
repoTask.setRepositoryId( "testRepo" );