Package org.geomajas.internal.security

Examples of org.geomajas.internal.security.SecurityContextImpl$AuthorizationGetter


  public void testLogout() throws Exception {
    Authentication auth = new Authentication();
    auth.setAuthorizations(new BaseAuthorization[0]);
    auth.setSecurityServiceId(StaticSecurityService.SECURITY_SERVICE_ID); // mimic that this comes from the StaticSecurity stuff
    String token = tokenService.login(auth);
    SecurityContextImpl securityContext = (SecurityContextImpl) this.securityContext;
    List<Authentication> auths = new ArrayList<Authentication>();
    auths.add(auth);
    securityContext.setAuthentications(token, auths);

    Assert.assertEquals(token, securityContext.getToken());
    EmptyCommandRequest request = new EmptyCommandRequest();
    SuccessCommandResponse response = logoutCommand.getEmptyCommandResponse();
    logoutCommand.execute(request, response);
    Assert.assertTrue(response.isSuccess());
    Assert.assertNull(tokenService.getAuthentication(token));
View Full Code Here

TOP

Related Classes of org.geomajas.internal.security.SecurityContextImpl$AuthorizationGetter

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.