use of org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef in project jackrabbit-oak by apache.
the class SyncMBeanImplTest method testSyncExternalLocal.
/**
* @see <a href="https://issues.apache.org/jira/browse/OAK-4346">OAK-4346</a>
*/
@Test
public void testSyncExternalLocal() throws Exception {
ExternalIdentityRef ref = new ExternalIdentityRef(UserConstants.DEFAULT_ANONYMOUS_ID, null);
String[] result = syncMBean.syncExternalUsers(new String[] { ref.getString() });
assertResultMessages(result, UserConstants.DEFAULT_ANONYMOUS_ID, "for");
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef in project jackrabbit-oak by apache.
the class SyncMBeanImplTest method testSyncExternalNonExisting.
@Test
public void testSyncExternalNonExisting() throws Exception {
ExternalIdentityRef ref = new ExternalIdentityRef("nonExisting", idp.getName());
String[] result = syncMBean.syncExternalUsers(new String[] { ref.getString() });
assertResultMessages(result, "", "nsi");
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef in project jackrabbit-oak by apache.
the class SyncMBeanImplTest method testPurgeOrphanedUsersException.
@Test
public void testPurgeOrphanedUsersException() throws Exception {
User u = getUserManager().createUser(TestIdentityProvider.ID_EXCEPTION, null);
u.setProperty(DefaultSyncContext.REP_EXTERNAL_ID, getValueFactory().createValue(new ExternalIdentityRef(TestIdentityProvider.ID_EXCEPTION, idp.getName()).getString()));
root.commit();
String[] result = syncMBean.purgeOrphanedUsers();
assertEquals(0, result.length);
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef in project jackrabbit-oak by apache.
the class LdapProviderTest method testGetMembers.
@Test
public void testGetMembers() throws Exception {
ExternalIdentityRef ref = new ExternalIdentityRef(TEST_GROUP1_DN, IDP_NAME);
ExternalIdentity id = idp.getIdentity(ref);
assertTrue("Group instance", id instanceof ExternalGroup);
ExternalGroup grp = (ExternalGroup) id;
assertIfEquals("Group members", TEST_GROUP1_MEMBERS, grp.getDeclaredMembers());
}
Aggregations