public class SecurityExchangeMutators
extends java.lang.Object
org.springframework.test.web.reactive.server.WebTestClient
} using
{{org.springframework.test.web.reactive.server.ExchangeMutatorWebFilter
}}.Modifier and Type | Class and Description |
---|---|
static class |
SecurityExchangeMutators.UserExchangeMutator
Updates the WebServerExchange using
SecurityExchangeMutators#withUser(UserDetails) . |
Constructor and Description |
---|
SecurityExchangeMutators() |
Modifier and Type | Method and Description |
---|---|
static java.util.function.Function<org.springframework.web.server.ServerWebExchange,org.springframework.web.server.ServerWebExchange> |
withAuthentication(Authentication authentication)
Updates the ServerWebExchange to use the provided Authentication as the Principal
|
static java.util.function.Function<org.springframework.web.server.ServerWebExchange,org.springframework.web.server.ServerWebExchange> |
withPrincipal(java.security.Principal principal)
Updates the ServerWebExchange to use the provided Principal
|
static SecurityExchangeMutators.UserExchangeMutator |
withUser()
Updates the ServerWebExchange to use a UserDetails to create a UsernamePasswordAuthenticationToken as
the Principal.
|
static SecurityExchangeMutators.UserExchangeMutator |
withUser(java.lang.String username)
Updates the ServerWebExchange to use a UserDetails to create a UsernamePasswordAuthenticationToken as
the Principal.
|
static java.util.function.Function<org.springframework.web.server.ServerWebExchange,org.springframework.web.server.ServerWebExchange> |
withUser(UserDetails userDetails)
Updates the ServerWebExchange to use the provided UserDetails to create a UsernamePasswordAuthenticationToken as
the Principal
|
public static java.util.function.Function<org.springframework.web.server.ServerWebExchange,org.springframework.web.server.ServerWebExchange> withPrincipal(java.security.Principal principal)
principal
- the principal to use.Function
} to usepublic static java.util.function.Function<org.springframework.web.server.ServerWebExchange,org.springframework.web.server.ServerWebExchange> withAuthentication(Authentication authentication)
authentication
- the Authentication to use.Function
} to usepublic static java.util.function.Function<org.springframework.web.server.ServerWebExchange,org.springframework.web.server.ServerWebExchange> withUser(UserDetails userDetails)
userDetails
- the UserDetails to use.Function
} to usepublic static SecurityExchangeMutators.UserExchangeMutator withUser()
Function
} to usepublic static SecurityExchangeMutators.UserExchangeMutator withUser(java.lang.String username)
Function
} to use