Search in sources :

Example 1 with ExternalIdentityProviderManager

use of org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProviderManager in project jackrabbit-oak by apache.

the class SyncMBeanImplTest method before.

@Before
public void before() throws Exception {
    super.before();
    syncMgr = new SyncManager() {

        @CheckForNull
        @Override
        public SyncHandler getSyncHandler(@Nonnull String name) {
            if (SYNC_NAME.equals(name)) {
                return new DefaultSyncHandler(syncConfig);
            } else if (ThrowingSyncHandler.NAME.equals(name)) {
                return new ThrowingSyncHandler(false);
            } else if (ThrowingSyncHandler.NAME_ALLOWS_IDENTITY_LISTING.equals(name)) {
                return new ThrowingSyncHandler(true);
            } else {
                return null;
            }
        }
    };
    idpMgr = new ExternalIdentityProviderManager() {

        @CheckForNull
        @Override
        public ExternalIdentityProvider getProvider(@Nonnull String name) {
            if (name.equals(idp.getName())) {
                return idp;
            } else {
                return null;
            }
        }
    };
    syncMBean = createSyncMBeanImpl(SYNC_NAME, idp.getName());
}
Also used : ExternalIdentityProvider(org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider) SyncHandler(org.apache.jackrabbit.oak.spi.security.authentication.external.SyncHandler) DefaultSyncHandler(org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DefaultSyncHandler) CheckForNull(javax.annotation.CheckForNull) SyncManager(org.apache.jackrabbit.oak.spi.security.authentication.external.SyncManager) DefaultSyncHandler(org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DefaultSyncHandler) ExternalIdentityProviderManager(org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProviderManager) Before(org.junit.Before)

Aggregations

CheckForNull (javax.annotation.CheckForNull)1 ExternalIdentityProvider (org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider)1 ExternalIdentityProviderManager (org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProviderManager)1 SyncHandler (org.apache.jackrabbit.oak.spi.security.authentication.external.SyncHandler)1 SyncManager (org.apache.jackrabbit.oak.spi.security.authentication.external.SyncManager)1 DefaultSyncHandler (org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DefaultSyncHandler)1 Before (org.junit.Before)1