Package org.apache.hadoop.security.authentication.server

Examples of org.apache.hadoop.security.authentication.server.AuthenticationToken


    Mockito.verify(response).sendError(
      Mockito.eq(HttpServletResponse.SC_UNAUTHORIZED),
      Mockito.contains("equires SPNEGO authentication established"));

    Mockito.reset(response);
    AuthenticationToken token = Mockito.mock(AuthenticationToken.class);
    Mockito.when(token.getUserName()).thenReturn("user");
    Assert.assertFalse(handler.managementOperation(token, request, response));
    Mockito.verify(response).sendError(
      Mockito.eq(HttpServletResponse.SC_BAD_REQUEST),
      Mockito.contains("requires the parameter [token]"));
View Full Code Here


      HttpFSServerWebApp.get().get(DelegationTokenManager.class).createToken(
        UserGroupInformation.getCurrentUser(), "user");
    Mockito.when(request.getParameter(HttpFSKerberosAuthenticator.DELEGATION_PARAM)).
      thenReturn(dToken.encodeToUrlString());

    AuthenticationToken token = handler.authenticate(request, response);
    Assert.assertEquals(UserGroupInformation.getCurrentUser().getShortUserName(),
                        token.getUserName());
    Assert.assertEquals(0, token.getExpires());
    Assert.assertEquals(HttpFSKerberosAuthenticationHandler.TYPE,
                        token.getType());
    Assert.assertTrue(token.isExpired());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.security.authentication.server.AuthenticationToken

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.