Package org.springframework.security.web.context

Examples of org.springframework.security.web.context.SecurityContextRepository.loadContext()


            HttpServletResponse response = new MockHttpServletResponse();

            HttpRequestResponseHolder requestResponseHolder = new HttpRequestResponseHolder(
                    request, response);
            securityContextRepository.loadContext(requestResponseHolder);

            request = requestResponseHolder.getRequest();
            response = requestResponseHolder.getResponse();

            securityContextRepository.saveContext(securityContext, request,
View Full Code Here


    private static abstract class AuthenticationMatcher<T extends AuthenticationMatcher<T>> implements ResultMatcher {

        protected SecurityContext load(MvcResult result) {
            HttpRequestResponseHolder holder = new HttpRequestResponseHolder(result.getRequest(), result.getResponse());
            SecurityContextRepository repository = WebTestUtils.getSecurityContextRepository(result.getRequest());
            return repository.loadContext(holder);
        }
    }

    /**
     * A {@link MockMvc} {@link ResultMatcher} that verifies a specific user is
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.