assert retrievedRepos.get(0).isCandidate();
reposToDelete.add(retrievedRepos.get(0).getId());
Repo repoInGroup = retrievedRepos.get(0);
RepoCriteria findWithRepoGroup = new RepoCriteria();
findWithRepoGroup.fetchRepoRepoGroups(true);
findWithRepoGroup.addFilterId(repoInGroup.getId());
PageList<Repo> repoPageList = repoManager.findReposByCriteria(overlord, findWithRepoGroup);
repoInGroup = repoPageList.get(0);
Set<RepoRepoGroup> repoGroups = repoInGroup.getRepoRepoGroups();
assert repoGroups.size() == 1;
RepoRepoGroup repoRepoGroup = repoGroups.iterator().next();
assert repoRepoGroup.getRepoRepoGroupPK().getRepoGroup().getName().equals("testRepoGroup");
assert repoRepoGroup.getRepoRepoGroupPK().getRepo().getName().equals("testRepo2");
// -> Repo with a parent
retrievedRepos = repoManager.getRepoByName("testRepo3");
assert retrievedRepos.size() == 1;
assert retrievedRepos.get(0).isCandidate();
reposToDelete.add(retrievedRepos.get(0).getId());
relatedRepoId = retrievedRepos.get(0).getId();
retrievedRepos = repoManager.getRepoByName("testRepo4");
assert retrievedRepos.size() == 1;
assert retrievedRepos.get(0).isCandidate();
reposToDelete.add(retrievedRepos.get(0).getId());
repoId = retrievedRepos.get(0).getId();
RepoCriteria findWithRelationships = new RepoCriteria();
findWithRelationships.addFilterName("testRepo4");
findWithRelationships.fetchRepoRepoRelationships(true);
PageList<Repo> childRepoList = repoManager.findReposByCriteria(overlord, findWithRelationships);
assert childRepoList.size() == 1;
Repo childRepo = childRepoList.get(0);
Set<RepoRepoRelationship> childRepoRepoRelationship = childRepo.getRepoRepoRelationships();