Package com.github.ebnew.ki4so.core.authentication.handlers

Examples of com.github.ebnew.ki4so.core.authentication.handlers.AuthenticationHandler.authenticate()


   
   
    //测试情况5,测试存在合法的认证处理器的情况,但是无合法的凭据转换器。
    handler = Mockito.mock(AuthenticationHandler.class);
    Mockito.when(handler.supports(credential)).thenReturn(true);
    Mockito.when(handler.authenticate(credential)).thenReturn(true);
    try{
      authenticationHandlers = new ArrayList<AuthenticationHandler>();
      authenticationHandlers.add(handler);
      authenticationManager.setAuthenticationHandlers(authenticationHandlers);
      authenticationManager.authenticate(credential);
View Full Code Here


   
    //测试情况6,测试存在合法的认证处理器的情况,但是凭据转换器列表不为空,但是集合中的元素为空。
    List<CredentialToPrincipalResolver> resolvers = new ArrayList<CredentialToPrincipalResolver>();
    handler = Mockito.mock(AuthenticationHandler.class);
    Mockito.when(handler.supports(credential)).thenReturn(true);
    Mockito.when(handler.authenticate(credential)).thenReturn(true);
    try{
      authenticationHandlers = new ArrayList<AuthenticationHandler>();
      authenticationHandlers.add(handler);
      authenticationManager.setAuthenticationHandlers(authenticationHandlers);
      authenticationManager.setCredentialToPrincipalResolvers(resolvers);
View Full Code Here

    }
   
    //测试情况7,测试存在合法的认证处理器的情况,但是凭据转换器列表不为空,但是集合中的元素不为空,认证后处理器对象是空。
    handler = Mockito.mock(AuthenticationHandler.class);
    Mockito.when(handler.supports(credential)).thenReturn(true);
    Mockito.when(handler.authenticate(credential)).thenReturn(true);
    CredentialToPrincipalResolver resolver = Mockito.mock(CredentialToPrincipalResolver.class);
    Principal principal = Mockito.mock(Principal.class);
    Mockito.when(resolver.supports(credential)).thenReturn(true);
    Mockito.when(resolver.resolvePrincipal(credential)).thenReturn(principal);
    try{
View Full Code Here

    }
   
    //测试情况8,测试存在合法的认证处理器的情况,但是凭据转换器列表不为空,但是集合中的元素不为空,认证后处理器对象不是空。
    handler = Mockito.mock(AuthenticationHandler.class);
    Mockito.when(handler.supports(credential)).thenReturn(true);
    Mockito.when(handler.authenticate(credential)).thenReturn(true);
    resolver = Mockito.mock(CredentialToPrincipalResolver.class);
    principal = Mockito.mock(Principal.class);
    Mockito.when(resolver.supports(credential)).thenReturn(true);
    Mockito.when(resolver.resolvePrincipal(credential)).thenReturn(principal);
    AuthenticationPostHandler authenticationPostHandler = Mockito.mock(AuthenticationPostHandler.class);
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.