// Create a content source type and a content source
ContentSourceType type = new ContentSourceType("testGetSyncResultsListCST");
Set<ContentSourceType> types = new HashSet<ContentSourceType>();
types.add(type);
contentSourceMetadataManager.registerTypes(types); // this blows away any previous existing types
ContentSource contentSource = new ContentSource("testGetSyncResultsListCS", type);
contentSource = contentSourceManager.simpleCreateContentSource(overlord, contentSource);
// Create an imported (non-candidate) repo associated with the source
Repo importedRepo = new Repo("imported repo");
importedRepo.addContentSource(contentSource);
importedRepo = repoManager.createRepo(overlord, importedRepo);
// Create a candidate repo associated with that source
Repo candidateRepo = new Repo(candidateRepoName);
candidateRepo.setCandidate(true);
candidateRepo.addContentSource(contentSource);
candidateRepo = repoManager.createRepo(overlord, candidateRepo);
// Test
RepoCriteria criteria = new RepoCriteria();
criteria.addFilterCandidate(true);
criteria.addFilterContentSourceIds(contentSource.getId());
criteria.fetchRepoContentSources(true);
PageList<Repo> foundRepos = repoManager.findReposByCriteria(overlord, criteria);
// Verify