public abstract class WebTestUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static CsrfTokenRepository |
getCsrfTokenRepository(javax.servlet.http.HttpServletRequest request)
Gets the
CsrfTokenRepository for the specified HttpServletRequest . |
static SecurityContextRepository |
getSecurityContextRepository(javax.servlet.http.HttpServletRequest request)
Gets the
SecurityContextRepository for the specified
HttpServletRequest . |
static void |
setCsrfTokenRepository(javax.servlet.http.HttpServletRequest request,
CsrfTokenRepository repository)
Sets the
CsrfTokenRepository for the specified HttpServletRequest . |
static void |
setSecurityContextRepository(javax.servlet.http.HttpServletRequest request,
SecurityContextRepository securityContextRepository)
Sets the
SecurityContextRepository for the specified
HttpServletRequest . |
public static SecurityContextRepository getSecurityContextRepository(javax.servlet.http.HttpServletRequest request)
SecurityContextRepository
for the specified
HttpServletRequest
. If one is not found, a default
HttpSessionSecurityContextRepository
is used.request
- the HttpServletRequest
to obtain the
SecurityContextRepository
SecurityContextRepository
for the specified
HttpServletRequest
public static void setSecurityContextRepository(javax.servlet.http.HttpServletRequest request, SecurityContextRepository securityContextRepository)
SecurityContextRepository
for the specified
HttpServletRequest
.request
- the HttpServletRequest
to obtain the
SecurityContextRepository
securityContextRepository
- the SecurityContextRepository
to setpublic static CsrfTokenRepository getCsrfTokenRepository(javax.servlet.http.HttpServletRequest request)
CsrfTokenRepository
for the specified HttpServletRequest
.
If one is not found, the default HttpSessionCsrfTokenRepository
is used.request
- the HttpServletRequest
to obtain the
CsrfTokenRepository
CsrfTokenRepository
for the specified
HttpServletRequest
public static void setCsrfTokenRepository(javax.servlet.http.HttpServletRequest request, CsrfTokenRepository repository)
CsrfTokenRepository
for the specified HttpServletRequest
.request
- the HttpServletRequest
to obtain the
CsrfTokenRepository
repository
- the CsrfTokenRepository
to set