Package org.springframework.security.core

Examples of org.springframework.security.core.SpringSecurityMessageSource


        AclService service = mock(AclService.class);
        Acl acl = mock(Acl.class);
        when(acl.isGranted(any(List.class), any(List.class), anyBoolean())).thenReturn(true);
        when(service.readAclById(any(ObjectIdentity.class), any(List.class))).thenReturn(acl);
        AclEntryAfterInvocationProvider provider = new AclEntryAfterInvocationProvider(service, Arrays.asList(mock(Permission.class)));
        provider.setMessageSource(new SpringSecurityMessageSource());
        provider.setObjectIdentityRetrievalStrategy(mock(ObjectIdentityRetrievalStrategy.class));
        provider.setProcessDomainObjectClass(Object.class);
        provider.setSidRetrievalStrategy(mock(SidRetrievalStrategy.class));
        Object returned = new Object();
View Full Code Here


        // Try a second time with no permissions found
        when(acl.isGranted(any(List.class), any(List.class), anyBoolean())).thenThrow(new NotFoundException(""));
        when(service.readAclById(any(ObjectIdentity.class), any(List.class))).thenReturn(acl);
        AclEntryAfterInvocationProvider provider = new AclEntryAfterInvocationProvider(service, Arrays.asList(mock(Permission.class)));
        provider.setProcessConfigAttribute("MY_ATTRIBUTE");
        provider.setMessageSource(new SpringSecurityMessageSource());
        provider.setObjectIdentityRetrievalStrategy(mock(ObjectIdentityRetrievalStrategy.class));
        provider.setProcessDomainObjectClass(Object.class);
        provider.setSidRetrievalStrategy(mock(SidRetrievalStrategy.class));
        try {
            provider.decide(mock(Authentication.class), new Object(), SecurityConfig.createList("UNSUPPORTED", "MY_ATTRIBUTE"), new Object());
View Full Code Here

*/
public class SpringSecurityMessageSourceTests extends TestCase {
    //~ Methods ========================================================================================================

    public void testOperation() {
        SpringSecurityMessageSource msgs = new SpringSecurityMessageSource();
        assertEquals("\u4E0D\u5141\u8BB8\u8BBF\u95EE", msgs.getMessage("AbstractAccessDecisionManager.accessDenied", null, Locale.SIMPLIFIED_CHINESE));
    }
View Full Code Here

    SubjectDnX509PrincipalExtractor extractor;

    @Before
    public void setUp() {
        extractor = new SubjectDnX509PrincipalExtractor();
        extractor.setMessageSource(new SpringSecurityMessageSource());
    }
View Full Code Here

    //~ Methods ========================================================================================================

    @Before
    public void setUp() {
        authenticator = new BindAuthenticator(getContextSource());
        authenticator.setMessageSource(new SpringSecurityMessageSource());
        bob = new UsernamePasswordAuthenticationToken("bob", "bobspassword");

    }
View Full Code Here

TOP

Related Classes of org.springframework.security.core.SpringSecurityMessageSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.