use of com.enonic.xp.node.MultiRepoNodeHits in project xp by enonic.
the class FindNodesByMultiRepoQueryCommandTest method assertRepos.
private void assertRepos(final FindNodesByMultiRepoQueryResult result, final RepositoryId... repositoryIds) {
final MultiRepoNodeHits nodeHits = result.getNodeHits();
final Set<RepositoryId> repositories = nodeHits.stream().map(MultiRepoNodeHit::getRepositoryId).collect(Collectors.toSet());
assertEquals(repositoryIds.length, repositories.size(), "Wrong number of repositories");
for (final RepositoryId repoId : repositoryIds) {
assertTrue(repositories.contains(repoId), "missing repo '" + repoId + "' in result set");
}
}
use of com.enonic.xp.node.MultiRepoNodeHits in project xp by enonic.
the class FindNodesByMultiRepoQueryCommandTest method assertBranches.
private void assertBranches(final FindNodesByMultiRepoQueryResult result, final Branch... branches) {
final MultiRepoNodeHits nodeHits = result.getNodeHits();
final Set<Branch> resultBranches = nodeHits.stream().map(MultiRepoNodeHit::getBranch).collect(Collectors.toSet());
assertEquals(branches.length, resultBranches.size(), "Wrong number of branches in result");
for (final Branch branch : resultBranches) {
assertTrue(resultBranches.contains(branch), "missing repo '" + branch + "' in result set");
}
}
Aggregations