Search in sources :

Example 1 with SimpleTestSecurityManager

use of org.apache.geode.security.SimpleTestSecurityManager in project geode by apache.

the class IntegratedSecurityServiceTest method testSetSecurityManager.

@Test
public void testSetSecurityManager() {
    // initially
    assertFalse(securityService.isIntegratedSecurity());
    // init with client authenticator
    properties.setProperty(SECURITY_CLIENT_AUTHENTICATOR, "org.abc.test");
    securityService.initSecurity(properties);
    assertFalse(securityService.isIntegratedSecurity());
    assertTrue(securityService.isClientSecurityRequired());
    assertFalse(securityService.isPeerSecurityRequired());
    // set a security manager
    securityService.setSecurityManager(new SimpleTestSecurityManager());
    assertTrue(securityService.isIntegratedSecurity());
    assertTrue(securityService.isClientSecurityRequired());
    assertTrue(securityService.isPeerSecurityRequired());
    assertFalse(securityService.needPostProcess());
    // set a post processor
    securityService.setPostProcessor(new TestPostProcessor());
    assertTrue(securityService.isIntegratedSecurity());
    assertTrue(securityService.needPostProcess());
}
Also used : TestPostProcessor(org.apache.geode.security.TestPostProcessor) SimpleTestSecurityManager(org.apache.geode.security.SimpleTestSecurityManager) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

Aggregations

SimpleTestSecurityManager (org.apache.geode.security.SimpleTestSecurityManager)1 TestPostProcessor (org.apache.geode.security.TestPostProcessor)1 UnitTest (org.apache.geode.test.junit.categories.UnitTest)1 Test (org.junit.Test)1