Class SecurityMockServerConfigurers.OAuth2ClientMutator
java.lang.Object
org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2ClientMutator
- All Implemented Interfaces:
org.springframework.test.web.reactive.server.MockServerConfigurer
,org.springframework.test.web.reactive.server.WebTestClientConfigurer
- Enclosing class:
- SecurityMockServerConfigurers
public static final class SecurityMockServerConfigurers.OAuth2ClientMutator
extends Object
implements org.springframework.test.web.reactive.server.WebTestClientConfigurer, org.springframework.test.web.reactive.server.MockServerConfigurer
- Since:
- 5.3
-
Method Summary
Modifier and TypeMethodDescriptionaccessToken
(OAuth2AccessToken accessToken) Use thisOAuth2AccessToken
void
afterConfigureAdded
(org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec<?> serverSpec) void
afterConfigurerAdded
(org.springframework.test.web.reactive.server.WebTestClient.Builder builder, org.springframework.web.server.adapter.WebHttpHandlerBuilder httpHandlerBuilder, org.springframework.http.client.reactive.ClientHttpConnector connector) void
beforeServerCreated
(org.springframework.web.server.adapter.WebHttpHandlerBuilder builder) clientRegistration
(Consumer<ClientRegistration.Builder> clientRegistrationConfigurer) Use thisConsumer
to configure aClientRegistration
clientRegistration
(ClientRegistration clientRegistration) Use thisClientRegistration
principalName
(String principalName) Use this as the resource owner's principal name
-
Method Details
-
clientRegistration
public SecurityMockServerConfigurers.OAuth2ClientMutator clientRegistration(ClientRegistration clientRegistration) Use thisClientRegistration
- Parameters:
clientRegistration
-- Returns:
- the
SecurityMockMvcRequestPostProcessors.OAuth2ClientRequestPostProcessor
for further configuration
-
clientRegistration
public SecurityMockServerConfigurers.OAuth2ClientMutator clientRegistration(Consumer<ClientRegistration.Builder> clientRegistrationConfigurer) Use thisConsumer
to configure aClientRegistration
- Parameters:
clientRegistrationConfigurer
- theClientRegistration
configurer- Returns:
- the
SecurityMockMvcRequestPostProcessors.OAuth2ClientRequestPostProcessor
for further configuration
-
principalName
Use this as the resource owner's principal name- Parameters:
principalName
- the resource owner's principal name- Returns:
- the
SecurityMockServerConfigurers.OAuth2ClientMutator
for further configuration
-
accessToken
Use thisOAuth2AccessToken
- Parameters:
accessToken
- theOAuth2AccessToken
to use- Returns:
- the
SecurityMockMvcRequestPostProcessors.OAuth2ClientRequestPostProcessor
for further configuration
-
beforeServerCreated
public void beforeServerCreated(org.springframework.web.server.adapter.WebHttpHandlerBuilder builder) - Specified by:
beforeServerCreated
in interfaceorg.springframework.test.web.reactive.server.MockServerConfigurer
-
afterConfigureAdded
public void afterConfigureAdded(org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec<?> serverSpec) - Specified by:
afterConfigureAdded
in interfaceorg.springframework.test.web.reactive.server.MockServerConfigurer
-
afterConfigurerAdded
public void afterConfigurerAdded(org.springframework.test.web.reactive.server.WebTestClient.Builder builder, @Nullable org.springframework.web.server.adapter.WebHttpHandlerBuilder httpHandlerBuilder, @Nullable org.springframework.http.client.reactive.ClientHttpConnector connector) - Specified by:
afterConfigurerAdded
in interfaceorg.springframework.test.web.reactive.server.WebTestClientConfigurer
-