use of org.apache.jackrabbit.oak.spi.security.authentication.external.SyncedIdentity in project jackrabbit-oak by apache.
the class DefaultSyncContextTest method testCreateSyncedIdentityEmptyLastSyncedProperty.
@Test
public void testCreateSyncedIdentityEmptyLastSyncedProperty() throws Exception {
Group gr = createTestGroup();
gr.setProperty(DefaultSyncContext.REP_LAST_SYNCED, new Value[0]);
SyncedIdentity si = DefaultSyncContext.createSyncedIdentity(gr);
assertNotNull(si);
assertEquals(-1, si.lastSynced());
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.SyncedIdentity in project jackrabbit-oak by apache.
the class DefaultSyncContextTest method testCreateSyncedIdentitySyncedGroup.
@Test
public void testCreateSyncedIdentitySyncedGroup() throws Exception {
ExternalIdentity externalGroup = idp.listGroups().next();
sync(externalGroup);
Authorizable a = userManager.getAuthorizable(externalGroup.getId());
SyncedIdentity si = DefaultSyncContext.createSyncedIdentity(a);
assertNotNull(si);
assertEquals(a.getID(), si.getId());
assertNotNull(si.getExternalIdRef());
assertTrue(si.isGroup());
assertEquals(syncCtx.now, si.lastSynced());
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.SyncedIdentity in project jackrabbit-oak by apache.
the class DefaultSyncContextTest method testCreateSyncedIdentityLocalUser.
@Test
public void testCreateSyncedIdentityLocalUser() throws Exception {
User u = getTestUser();
SyncedIdentity si = DefaultSyncContext.createSyncedIdentity(u);
assertNotNull(si);
assertEquals(u.getID(), si.getId());
assertNull(si.getExternalIdRef());
assertFalse(si.isGroup());
assertEquals(-1, si.lastSynced());
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.SyncedIdentity in project jackrabbit-oak by apache.
the class DefaultSyncHandlerTest method testFindMissingIdentity.
@Test
public void testFindMissingIdentity() throws Exception {
SyncedIdentity id = syncHandler.findIdentity(userManager, "foobar");
assertNull("unknown authorizable should not exist", id);
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.SyncedIdentity in project jackrabbit-oak by apache.
the class DefaultSyncHandlerTest method testFindLocalIdentity.
@Test
public void testFindLocalIdentity() throws Exception {
SyncedIdentity id = syncHandler.findIdentity(userManager, "admin");
assertNotNull("known authorizable should exist", id);
assertNull("local user should not have external ref", id.getExternalIdRef());
}
Aggregations