use of org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler 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);
});
}
use of org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler in project spring-framework by spring-projects.
the class RSocketClientToServerIntegrationTests method setupOnce.
@BeforeAll
@SuppressWarnings("ConstantConditions")
public static void setupOnce() {
MimeType metadataMimeType = MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_COMPOSITE_METADATA.getString());
context = new AnnotationConfigApplicationContext(ServerConfig.class);
RSocketMessageHandler messageHandler = context.getBean(RSocketMessageHandler.class);
SocketAcceptor responder = messageHandler.responder();
server = RSocketServer.create(responder).interceptors(registry -> registry.forResponder(interceptor)).payloadDecoder(PayloadDecoder.ZERO_COPY).bind(TcpServerTransport.create("localhost", 7000)).block();
requester = RSocketRequester.builder().metadataMimeType(metadataMimeType).rsocketStrategies(context.getBean(RSocketStrategies.class)).tcp("localhost", 7000);
}
Aggregations