1 package com.atlassian.seraph.config; 2 3 import junit.framework.TestCase; 4 import com.atlassian.seraph.auth.DefaultAuthenticator; 5 import com.atlassian.seraph.auth.GroupRoleMapper; 6 import com.atlassian.seraph.service.PathService; 7 import com.atlassian.seraph.controller.NullSecurityController; 8 import com.atlassian.seraph.interceptor.LoginInterceptor; 9 import com.atlassian.seraph.interceptor.LogoutInterceptor; 10 import mock.MockLoginInterceptor; 11 12 15 31 public class _TestSecurityConfig extends TestCase 32 { 33 public void testSecurityConfig() throws ConfigurationException 34 { 35 SecurityConfig config = SecurityConfigFactory.getInstance("test-seraph-config.xml"); 36 assertTrue(config.getAuthenticator() instanceof DefaultAuthenticator); 37 assertTrue(config.getRoleMapper() instanceof GroupRoleMapper); 38 assertTrue(config.getController() instanceof NullSecurityController); 39 assertEquals(1, config.getServices().size()); 40 assertTrue(config.getServices().get(0) instanceof PathService); 41 42 assertEquals("xYz", config.getCookieEncoding()); 43 assertEquals("/login.action", config.getLoginURL()); 44 assertEquals("test_security_originalurl", config.getOriginalURLKey()); 45 assertEquals(0, config.getInterceptors(LogoutInterceptor.class).size()); 46 assertEquals(1, config.getInterceptors(LoginInterceptor.class).size()); 47 assertTrue(config.getInterceptors(LoginInterceptor.class).get(0) instanceof MockLoginInterceptor); 48 } 49 } 50 | Popular Tags |