String repoId = "test-repo";
Profile profile = new Profile();
profile.setId( profileId );
Repository repo = new Repository();
repo.setId( repoId );
repo.setUrl( "http://www.google.com" );
profile.addRepository( repo );
pm.addProfile( profile );
pm.explicitlyActivate( profileId );
MavenProject project = projectBuilder.buildStandaloneSuperProject( getLocalRepository(), pm );
List repositories = project.getRepositories();
assertNotNull( repositories );
Repository result = null;
for ( Iterator it = repositories.iterator(); it.hasNext(); )
{
Repository candidate = (Repository) it.next();
if ( repoId.equals( candidate.getId() ) )
{
result = candidate;
break;
}
}