Search in sources :

Example 1 with MultiRepoNodeHits

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");
    }
}
Also used : MultiRepoNodeHits(com.enonic.xp.node.MultiRepoNodeHits) RepositoryId(com.enonic.xp.repository.RepositoryId)

Example 2 with MultiRepoNodeHits

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");
    }
}
Also used : Branch(com.enonic.xp.branch.Branch) MultiRepoNodeHits(com.enonic.xp.node.MultiRepoNodeHits)

Aggregations

MultiRepoNodeHits (com.enonic.xp.node.MultiRepoNodeHits)2 Branch (com.enonic.xp.branch.Branch)1 RepositoryId (com.enonic.xp.repository.RepositoryId)1