Search in sources :

Example 1 with AuthenticationPrincipalArgumentResolver

use of org.springframework.security.messaging.handler.invocation.reactive.AuthenticationPrincipalArgumentResolver in project spring-boot by spring-projects.

the class RSocketSecurityAutoConfigurationTests method autoConfigurationAddsCustomizerForAuthenticationPrincipalArgumentResolver.

@Test
void autoConfigurationAddsCustomizerForAuthenticationPrincipalArgumentResolver() {
    this.contextRunner.run((context) -> {
        assertThat(context).hasSingleBean(RSocketMessageHandler.class);
        RSocketMessageHandler handler = context.getBean(RSocketMessageHandler.class);
        assertThat(handler.getArgumentResolverConfigurer().getCustomResolvers()).isNotEmpty().anyMatch((customResolver) -> customResolver instanceof AuthenticationPrincipalArgumentResolver);
    });
}
Also used : RSocketMessageHandler(org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler) AuthenticationPrincipalArgumentResolver(org.springframework.security.messaging.handler.invocation.reactive.AuthenticationPrincipalArgumentResolver) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 RSocketMessageHandler (org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler)1 AuthenticationPrincipalArgumentResolver (org.springframework.security.messaging.handler.invocation.reactive.AuthenticationPrincipalArgumentResolver)1