use of org.springframework.util.SimpleRouteMatcher in project spring-framework by spring-projects.
the class DefaultRSocketStrategiesTests method explicitValues.
@Test
void explicitValues() {
SimpleRouteMatcher matcher = new SimpleRouteMatcher(new AntPathMatcher());
DefaultMetadataExtractor extractor = new DefaultMetadataExtractor();
ReactiveAdapterRegistry registry = new ReactiveAdapterRegistry();
RSocketStrategies strategies = RSocketStrategies.builder().encoders(encoders -> {
encoders.clear();
encoders.add(new ByteArrayEncoder());
}).decoders(decoders -> {
decoders.clear();
decoders.add(new ByteArrayDecoder());
}).routeMatcher(matcher).metadataExtractor(extractor).reactiveAdapterStrategy(registry).build();
assertThat(strategies.encoders()).hasSize(1);
assertThat(strategies.decoders()).hasSize(1);
assertThat(strategies.routeMatcher()).isSameAs(matcher);
assertThat(strategies.metadataExtractor()).isSameAs(extractor);
assertThat(strategies.reactiveAdapterRegistry()).isSameAs(registry);
}
Aggregations