public class SecurityMockServerConfigurers
extends java.lang.Object
WebTestClient.Builder.apply(WebTestClientConfigurer).| Modifier and Type | Class and Description |
|---|---|
static class |
SecurityMockServerConfigurers.CsrfMutator |
static class |
SecurityMockServerConfigurers.UserExchangeMutator
Updates the WebServerExchange using {@link SecurityMockServerConfigurers#mockUser(UserDetails)}.
|
| Constructor and Description |
|---|
SecurityMockServerConfigurers() |
| Modifier and Type | Method and Description |
|---|---|
static SecurityMockServerConfigurers.CsrfMutator |
csrf() |
static <T extends org.springframework.test.web.reactive.server.WebTestClientConfigurer & org.springframework.test.web.reactive.server.MockServerConfigurer> |
mockAuthentication(org.springframework.security.core.Authentication authentication)
Updates the ServerWebExchange to use the provided Authentication as the Principal
|
static SecurityMockServerConfigurers.UserExchangeMutator |
mockUser()
Updates the ServerWebExchange to use a UserDetails to create a UsernamePasswordAuthenticationToken as
the Principal.
|
static SecurityMockServerConfigurers.UserExchangeMutator |
mockUser(java.lang.String username)
Updates the ServerWebExchange to use a UserDetails to create a UsernamePasswordAuthenticationToken as
the Principal.
|
static <T extends org.springframework.test.web.reactive.server.WebTestClientConfigurer & org.springframework.test.web.reactive.server.MockServerConfigurer> |
mockUser(org.springframework.security.core.userdetails.UserDetails userDetails)
Updates the ServerWebExchange to use the provided UserDetails to create a UsernamePasswordAuthenticationToken as
the Principal
|
static org.springframework.test.web.reactive.server.MockServerConfigurer |
springSecurity()
Sets up Spring Security's
WebTestClient test support |
public static org.springframework.test.web.reactive.server.MockServerConfigurer springSecurity()
WebTestClient test supportpublic static <T extends org.springframework.test.web.reactive.server.WebTestClientConfigurer & org.springframework.test.web.reactive.server.MockServerConfigurer> T mockAuthentication(org.springframework.security.core.Authentication authentication)
authentication - the Authentication to use.public static <T extends org.springframework.test.web.reactive.server.WebTestClientConfigurer & org.springframework.test.web.reactive.server.MockServerConfigurer> T mockUser(org.springframework.security.core.userdetails.UserDetails userDetails)
userDetails - the UserDetails to use.public static SecurityMockServerConfigurers.UserExchangeMutator mockUser()
SecurityMockServerConfigurers.UserExchangeMutator to usepublic static SecurityMockServerConfigurers.UserExchangeMutator mockUser(java.lang.String username)
WebTestClientConfigurer to usepublic static SecurityMockServerConfigurers.CsrfMutator csrf()