Class SecurityMockServerConfigurers.OpaqueTokenMutator
java.lang.Object
org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OpaqueTokenMutator
- 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.OpaqueTokenMutator
extends Object
implements org.springframework.test.web.reactive.server.WebTestClientConfigurer, org.springframework.test.web.reactive.server.MockServerConfigurer
- Since:
- 5.3
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterConfigureAdded(org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec<?> serverSpec) voidafterConfigurerAdded(org.springframework.test.web.reactive.server.WebTestClient.Builder builder, org.springframework.web.server.adapter.WebHttpHandlerBuilder httpHandlerBuilder, org.springframework.http.client.reactive.ClientHttpConnector connector) attributes(Consumer<Map<String, Object>> attributesConsumer) Mutate the attributes using the givenConsumerauthorities(Collection<GrantedAuthority> authorities) Use the provided authorities in the resulting principalauthorities(GrantedAuthority... authorities) Use the provided authorities in the resulting principalvoidbeforeServerCreated(org.springframework.web.server.adapter.WebHttpHandlerBuilder builder) principal(OAuth2AuthenticatedPrincipal principal) Use the provided principal
-
Method Details
-
attributes
public SecurityMockServerConfigurers.OpaqueTokenMutator attributes(Consumer<Map<String, Object>> attributesConsumer) Mutate the attributes using the givenConsumer- Parameters:
attributesConsumer- TheConsumerfor mutating theMapof attributes- Returns:
- the
SecurityMockServerConfigurers.OpaqueTokenMutatorfor further configuration
-
authorities
public SecurityMockServerConfigurers.OpaqueTokenMutator authorities(Collection<GrantedAuthority> authorities) Use the provided authorities in the resulting principal- Parameters:
authorities- the authorities to use- Returns:
- the
SecurityMockServerConfigurers.OpaqueTokenMutatorfor further configuration
-
authorities
public SecurityMockServerConfigurers.OpaqueTokenMutator authorities(GrantedAuthority... authorities) Use the provided authorities in the resulting principal- Parameters:
authorities- the authorities to use- Returns:
- the
SecurityMockServerConfigurers.OpaqueTokenMutatorfor further configuration
-
principal
public SecurityMockServerConfigurers.OpaqueTokenMutator principal(OAuth2AuthenticatedPrincipal principal) Use the provided principal- Parameters:
principal- the principal to use- Returns:
- the
SecurityMockServerConfigurers.OpaqueTokenMutatorfor further configuration
-
beforeServerCreated
public void beforeServerCreated(org.springframework.web.server.adapter.WebHttpHandlerBuilder builder) - Specified by:
beforeServerCreatedin interfaceorg.springframework.test.web.reactive.server.MockServerConfigurer
-
afterConfigureAdded
public void afterConfigureAdded(org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec<?> serverSpec) - Specified by:
afterConfigureAddedin 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:
afterConfigurerAddedin interfaceorg.springframework.test.web.reactive.server.WebTestClientConfigurer
-