SearchResults results = new SearchResults();
List<String> versions = new ArrayList<String>();
versions.add( "1.0" );
SearchResultHit resultHit = new SearchResultHit();
resultHit.setRepositoryId( "repo1.mirror" );
resultHit.setGroupId( "org.apache.archiva" );
resultHit.setArtifactId( "archiva-test" );
resultHit.setVersions( versions );
results.addHit( SearchUtil.getHitId( "org.apache.archiva", "archiva-test" ), resultHit );
SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
searchControl.expectAndDefaultReturn( search.search( "", observableRepoIds, "archiva", limits, null ), results );
archivaDAOControl.expectAndReturn( archivaDAO.query( new UniqueVersionConstraint( observableRepoIds, resultHit.getGroupId(),
resultHit.getArtifactId() ) ), null );
ArchivaDatabaseException exception = new ArchivaDatabaseException( "org.apache.archiva.archiva-test:1.0" );
repoBrowsingControl.expectAndThrow( repoBrowsing.selectVersion( "", observableRepoIds, "org.apache.archiva", "archiva-test", "1.0" ), exception );