Search in sources :

Example 6 with PrivilegeConfiguration

use of org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConfiguration in project jackrabbit-oak by apache.

the class InternalSecurityProviderTest method testSetPrivilegeConfiguration.

@Test
public void testSetPrivilegeConfiguration() {
    PrivilegeConfiguration pc = Mockito.mock(PrivilegeConfiguration.class);
    when(pc.getParameters()).thenReturn(PARAMS);
    securityProvider.setPrivilegeConfiguration(pc);
    assertSame(pc, securityProvider.getConfiguration(PrivilegeConfiguration.class));
    for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
        if (sc instanceof PrivilegeConfiguration) {
            assertSame(pc, sc);
        }
    }
    assertEquals(PARAMS, securityProvider.getParameters(PrivilegeConfiguration.NAME));
}
Also used : SecurityConfiguration(org.apache.jackrabbit.oak.spi.security.SecurityConfiguration) PrivilegeConfiguration(org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConfiguration) Test(org.junit.Test)

Aggregations

PrivilegeConfiguration (org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConfiguration)6 SecurityConfiguration (org.apache.jackrabbit.oak.spi.security.SecurityConfiguration)4 Test (org.junit.Test)4 SecurityProvider (org.apache.jackrabbit.oak.spi.security.SecurityProvider)2 Stopwatch (com.google.common.base.Stopwatch)1 IOException (java.io.IOException)1 Field (java.lang.reflect.Field)1 NamespaceException (javax.jcr.NamespaceException)1 RepositoryException (javax.jcr.RepositoryException)1 NodeTypeManager (javax.jcr.nodetype.NodeTypeManager)1 PrivilegeManager (org.apache.jackrabbit.api.security.authorization.PrivilegeManager)1 RepositoryConfig (org.apache.jackrabbit.core.config.RepositoryConfig)1 FileSystemException (org.apache.jackrabbit.core.fs.FileSystemException)1 AbstractSecurityTest (org.apache.jackrabbit.oak.AbstractSecurityTest)1 InitialContent (org.apache.jackrabbit.oak.InitialContent)1 CommitFailedException (org.apache.jackrabbit.oak.api.CommitFailedException)1 ContentSession (org.apache.jackrabbit.oak.api.ContentSession)1 Root (org.apache.jackrabbit.oak.api.Root)1 Tree (org.apache.jackrabbit.oak.api.Tree)1 CompositeIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.CompositeIndexEditorProvider)1