Package org.apache.ace.authentication.api

Examples of org.apache.ace.authentication.api.AuthenticationProcessor.authenticate()


            public Boolean answer(InvocationOnMock invocation) throws Throwable {
                Object[] args = invocation.getArguments();
                return (args.length == 1 && args[0] instanceof Date);
            }
        });
        when(authProc1.authenticate(Mockito.<UserAdmin>any(), eq(now))).thenReturn(user1);

        AuthenticationProcessor authProc2 = mock(AuthenticationProcessor.class);
        when(authProc2.canHandle(anyString())).thenAnswer(new Answer<Boolean>() {
            public Boolean answer(InvocationOnMock invocation) throws Throwable {
                Object[] args = invocation.getArguments();
View Full Code Here


            public Boolean answer(InvocationOnMock invocation) throws Throwable {
                Object[] args = invocation.getArguments();
                return (args.length == 1 && args[0] instanceof String);
            }
        });
        when(authProc2.authenticate(Mockito.<UserAdmin>any(), eq("foo"))).thenReturn(user2);

        AuthenticationServiceImpl authService = createAuthenticationService();

        registerAuthProcessor(authService, authProc1);
        registerAuthProcessor(authService, authProc2);
View Full Code Here

        User user = mock(User.class);

        AuthenticationProcessor authProc = mock(AuthenticationProcessor.class);
        when(authProc.canHandle(anyString())).thenReturn(Boolean.TRUE);
        when(authProc.authenticate(Mockito.<UserAdmin>any(), eq("foo"))).thenReturn(user);

        registerAuthProcessor(authService, authProc);

        assert authService.authenticate("foo") != null;
    }
View Full Code Here

            public Boolean answer(InvocationOnMock invocation) throws Throwable {
                Object[] args = invocation.getArguments();
                return (args.length == 1 && args[0] instanceof Date);
            }
        });
        when(authProc1.authenticate(Mockito.<UserAdmin>any(), eq(now))).thenReturn(user1);

        AuthenticationProcessor authProc2 = mock(AuthenticationProcessor.class);
        when(authProc2.canHandle(anyString())).thenAnswer(new Answer<Boolean>() {
            public Boolean answer(InvocationOnMock invocation) throws Throwable {
                Object[] args = invocation.getArguments();
View Full Code Here

            public Boolean answer(InvocationOnMock invocation) throws Throwable {
                Object[] args = invocation.getArguments();
                return (args.length == 1 && args[0] instanceof String);
            }
        });
        when(authProc2.authenticate(Mockito.<UserAdmin>any(), eq("foo"))).thenReturn(user2);

        AuthenticationServiceImpl authService = createAuthenticationService();

        registerAuthProcessor(authService, authProc1);
        registerAuthProcessor(authService, authProc2);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.