use of org.apache.jackrabbit.api.security.principal.PrincipalIterator in project jackrabbit-oak by apache.
the class PrincipalManagerImplTest method testFindEveryoneTypeGroup.
@Test
public void testFindEveryoneTypeGroup() {
// search group only -> everyone must be part of the result set
PrincipalIterator it = principalMgr.findPrincipals(EveryonePrincipal.NAME, PrincipalManager.SEARCH_TYPE_GROUP);
assertTrue("findPrincipals does not find principal with filter '" + EveryonePrincipal.NAME + '\'', Iterators.contains(it, EveryonePrincipal.getInstance()));
}
use of org.apache.jackrabbit.api.security.principal.PrincipalIterator in project jackrabbit-oak by apache.
the class PrincipalManagerImplTest method testGetPrincipalsNonGroup.
@Test
public void testGetPrincipalsNonGroup() {
Iterator<? extends Principal> expected = provider.findPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
PrincipalIterator it = principalMgr.getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
assertIterator(expected, it);
}
use of org.apache.jackrabbit.api.security.principal.PrincipalIterator in project jackrabbit-oak by apache.
the class PrincipalManagerImplTest method testFindPrincipal.
@Test
public void testFindPrincipal() {
for (Principal pcpl : testPrincipals) {
PrincipalIterator it = principalMgr.findPrincipals(pcpl.getName());
assertTrue("findPrincipals does not find principal with filter '" + pcpl.getName() + '\'', Iterators.contains(it, pcpl));
}
}
use of org.apache.jackrabbit.api.security.principal.PrincipalIterator in project jackrabbit-oak by apache.
the class PrincipalManagerImplTest method testFindPrincipalByTypeGroup.
@Test
public void testFindPrincipalByTypeGroup() {
for (Principal pcpl : testPrincipals) {
if (isGroup(pcpl)) {
PrincipalIterator it = principalMgr.findPrincipals(pcpl.getName(), PrincipalManager.SEARCH_TYPE_GROUP);
assertTrue("findPrincipals does not find principal with filter '" + pcpl.getName() + '\'', Iterators.contains(it, pcpl));
} else {
PrincipalIterator it = principalMgr.findPrincipals(pcpl.getName(), PrincipalManager.SEARCH_TYPE_NOT_GROUP);
assertTrue("findPrincipals does not find principal with filter '" + pcpl.getName() + '\'', Iterators.contains(it, pcpl));
}
}
}
use of org.apache.jackrabbit.api.security.principal.PrincipalIterator in project jackrabbit-oak by apache.
the class PrincipalManagerImplTest method testFindEveryone.
@Test
public void testFindEveryone() {
// untyped search -> everyone must be part of the result set
PrincipalIterator it = principalMgr.findPrincipals(EveryonePrincipal.NAME);
assertTrue("findPrincipals does not find principal with filter '" + EveryonePrincipal.NAME + '\'', Iterators.contains(it, EveryonePrincipal.getInstance()));
}
Aggregations