use of org.springframework.messaging.rsocket.RSocketStrategies in project spring-framework by spring-projects.
the class RSocketMessageHandlerTests method setRSocketStrategies.
@Test
public void setRSocketStrategies() {
RSocketStrategies strategies = RSocketStrategies.builder().encoder(new ByteArrayEncoder()).decoder(new ByteArrayDecoder()).routeMatcher(new SimpleRouteMatcher(new AntPathMatcher())).metadataExtractor(new DefaultMetadataExtractor()).reactiveAdapterStrategy(new ReactiveAdapterRegistry()).build();
RSocketMessageHandler handler = new RSocketMessageHandler();
handler.setRSocketStrategies(strategies);
assertThat(handler.getEncoders()).isEqualTo(strategies.encoders());
assertThat(handler.getDecoders()).isEqualTo(strategies.decoders());
assertThat(handler.getRouteMatcher()).isSameAs(strategies.routeMatcher());
assertThat(handler.getMetadataExtractor()).isSameAs(strategies.metadataExtractor());
assertThat(handler.getReactiveAdapterRegistry()).isSameAs(strategies.reactiveAdapterRegistry());
}
Aggregations