spring-security-test
A B C D F G H L M O P R S T U W X 

A

afterTestMethod(TestContext) - Method in class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
Clears out the TestSecurityContextHolder and the SecurityContextHolder after each test method.
asHeader() - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor
Instead of using the CsrfToken as a request parameter (default) will populate the CsrfToken as a header.
authenticated() - Static method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers
ResultMatcher that verifies that a specified user is authenticated.
authentication(Authentication) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Establish a SecurityContext that uses the specified Authentication for the Authentication.getPrincipal() and a custom UserDetails.
authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
Populates the user's GrantedAuthority's.
authorities(Collection<? extends GrantedAuthority>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
Populates the user's GrantedAuthority's.

B

beforeTestMethod(TestContext) - Method in class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
Sets up the SecurityContext for each test method.
buildRequest(ServletContext) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
 
buildRequest(ServletContext) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.LogoutRequestBuilder
 

C

clearContext() - Static method in class org.springframework.security.test.context.TestSecurityContextHolder
Clears the SecurityContext from TestSecurityContextHolder and SecurityContextHolder.
createSecurityContext(A) - Method in interface org.springframework.security.test.context.support.WithSecurityContextFactory
Create a SecurityContext given an Annotation.
csrf() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Creates a RequestPostProcessor that will automatically populate a valid CsrfToken in the request.

D

digest() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Creates a DigestRequestPostProcessor that enables easily adding digest based authentication to a request.
digest(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Creates a DigestRequestPostProcessor that enables easily adding digest based authentication to a request.

F

formLogin() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders
Creates a request (including any necessary CsrfToken) that will submit a form based login to POST "/login".
formLogin(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders
Creates a request (including any necessary CsrfToken) that will submit a form based login to POST loginProcessingUrl.

G

getContext() - Static method in class org.springframework.security.test.context.TestSecurityContextHolder
Gets the SecurityContext from TestSecurityContextHolder.
getCsrfTokenRepository(HttpServletRequest) - Static method in class org.springframework.security.test.web.support.WebTestUtils
Gets the CsrfTokenRepository for the specified HttpServletRequest.
getSecurityContextRepository(HttpServletRequest) - Static method in class org.springframework.security.test.web.support.WebTestUtils
Gets the SecurityContextRepository for the specified HttpServletRequest.

H

httpBasic(String, String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Convenience mechanism for setting the Authorization header to use HTTP Basic with the given username and password.

L

loginProcessingUrl(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
Specifies the URL to POST to.
logout() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders
Creates a logout request.
logout(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders
Creates a logout request (including any necessary CsrfToken) to the specified logoutUrl
logoutUrl(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.LogoutRequestBuilder
Specifies the logout URL to POST to.

M

match(MvcResult) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
 

O

org.springframework.security.test.context - package org.springframework.security.test.context
 
org.springframework.security.test.context.support - package org.springframework.security.test.context.support
 
org.springframework.security.test.web.servlet.request - package org.springframework.security.test.web.servlet.request
 
org.springframework.security.test.web.servlet.response - package org.springframework.security.test.web.servlet.response
 
org.springframework.security.test.web.servlet.setup - package org.springframework.security.test.web.servlet.setup
 
org.springframework.security.test.web.support - package org.springframework.security.test.web.support
 

P

password(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
The value of the password parameter.
password(String, String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
Specify both the password parameter name and the password.
password(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor
Configures the password to use
password(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
Populates the user's password.
passwordParam(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
The HTTP parameter to place the password.
postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor
 
postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor
 
postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
 

R

realm(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor
Configures the realm to use
roles(String...) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
Specify the roles of the user to authenticate as.

S

securityContext(SecurityContext) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Establish the specified SecurityContext to be used.
SecurityMockMvcConfigurers - Class in org.springframework.security.test.web.servlet.setup
Provides Security related MockMvcConfigurer implementations.
SecurityMockMvcConfigurers() - Constructor for class org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers
 
SecurityMockMvcRequestBuilders - Class in org.springframework.security.test.web.servlet.request
Contains Spring Security related MockMvc RequestBuilders.
SecurityMockMvcRequestBuilders.FormLoginRequestBuilder - Class in org.springframework.security.test.web.servlet.request
Creates a form based login request including any necessary CsrfToken.
SecurityMockMvcRequestBuilders.LogoutRequestBuilder - Class in org.springframework.security.test.web.servlet.request
Creates a logout request (including any necessary CsrfToken)
SecurityMockMvcRequestPostProcessors - Class in org.springframework.security.test.web.servlet.request
Contains MockMvc RequestPostProcessor implementations for Spring Security.
SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
Populates a valid CsrfToken into the request.
SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
 
SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor() - Constructor for class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor
 
SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
Creates a UsernamePasswordAuthenticationToken and sets the principal to be a User and associates it to the MockHttpServletRequest.
SecurityMockMvcResultMatchers - Class in org.springframework.security.test.web.servlet.response
Security related MockMvc ResultMatchers.
SecurityMockMvcResultMatchers.AuthenticatedMatcher - Class in org.springframework.security.test.web.servlet.response
A MockMvc ResultMatcher that verifies a specific user is associated to the MvcResult.
setContext(SecurityContext) - Static method in class org.springframework.security.test.context.TestSecurityContextHolder
Sets the SecurityContext on TestSecurityContextHolder and SecurityContextHolder.
setSecurityContextRepository(HttpServletRequest, SecurityContextRepository) - Static method in class org.springframework.security.test.web.support.WebTestUtils
Sets the SecurityContextRepository for the specified HttpServletRequest.
springSecurity() - Static method in class org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers
Configures the MockMvcBuilder for use with Spring Security.
springSecurity(Filter) - Static method in class org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers
Configures the MockMvcBuilder for use with Spring Security.

T

testSecurityContext() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Creates a RequestPostProcessor that can be used to ensure that the resulting request is ran with the user in the TestSecurityContextHolder.
TestSecurityContextHolder - Class in org.springframework.security.test.context
The TestSecurityContextHolder is very similar to SecurityContextHolder, but is necessary for testing.

U

unauthenticated() - Static method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers
ResultMatcher that verifies that no user is authenticated.
useInvalidToken() - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor
Populates an invalid token value on the request.
user(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
The value of the username parameter.
user(String, String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
Specify both the password parameter name and the password.
user(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Establish a SecurityContext that has a UsernamePasswordAuthenticationToken for the Authentication.getPrincipal() and a User for the UsernamePasswordAuthenticationToken.getPrincipal().
user(UserDetails) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Establish a SecurityContext that has a UsernamePasswordAuthenticationToken for the Authentication.getPrincipal() and a custom UserDetails for the UsernamePasswordAuthenticationToken.getPrincipal().
userParameter(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
The HTTP parameter to place the username.

W

WebTestUtils - Class in org.springframework.security.test.web.support
A utility class for testing spring security
withAuthentication(Authentication) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
Specifies the expected Authentication
withAuthenticationName(String) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
Specifies the expected Principal.getName()
withAuthenticationPrincipal(Object) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
Specifies the expected principal
withAuthorities(Collection<GrantedAuthority>) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
Specifies the Authentication.getAuthorities()
WithMockUser - Annotation Type in org.springframework.security.test.context.support
When used with WithSecurityContextTestExecutionListener this annotation can be added to a test method to emulate running with a mocked user.
withRoles(String...) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
Specifies the Authentication.getAuthorities()
WithSecurityContext - Annotation Type in org.springframework.security.test.context.support
An annotation to determine what SecurityContext to use.
withSecurityContext(SecurityContext) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
Specifies the expected SecurityContext
WithSecurityContextFactory<A extends Annotation> - Interface in org.springframework.security.test.context.support
An API that works with WithUserTestExcecutionListener for creating a SecurityContext that is populated in the TestSecurityContextHolder.
WithSecurityContextTestExecutionListener - Class in org.springframework.security.test.context.support
A TestExecutionListener that will find annotations that are annotated with WithSecurityContext on a test method or at the class level.
WithSecurityContextTestExecutionListener() - Constructor for class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
 
WithUserDetails - Annotation Type in org.springframework.security.test.context.support
When used with WithSecurityContextTestExecutionListener this annotation can be added to a test method to emulate running with a UserDetails returned from the UserDetailsService.
withUsername(String) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
Specifies the expected username

X

x509(X509Certificate...) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Populates the provided X509Certificate instances on the request.
x509(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
Finds an X509Cetificate using a resoureName and populates it on the request.
A B C D F G H L M O P R S T U W X 
spring-security-test