@Test public void filter() { Mono<String> stringMono = Mono.just("42"); HandlerFunction<EntityResponse<Mono<String>>> handlerFunction = request -> EntityResponse.fromPublisher(stringMono, String.class).build(); RouterFunction<EntityResponse<Mono<String>>> routerFunction = request -> Mono.just(handlerFunction); HandlerFilterFunction<EntityResponse<Mono<String>>, EntityResponse<Mono<Integer>>> filterFunction = (request, next) -> next.handle(request).flatMap( response -> { Mono<Integer> intMono = response.entity() .map(Integer::parseInt); return EntityResponse.fromPublisher(intMono, Integer.class).build(); }); RouterFunction<EntityResponse<Mono<Integer>>> result = routerFunction.filter(filterFunction); assertNotNull(result); MockServerRequest request = MockServerRequest.builder().build(); Mono<EntityResponse<Mono<Integer>>> responseMono = result.route(request).flatMap(hf -> hf.handle(request)); StepVerifier.create(responseMono) .consumeNextWith( serverResponse -> { StepVerifier.create(serverResponse.entity()) .expectNext(42) .expectComplete() .verify(); }) .expectComplete() .verify(); }
public static Builder route() { return new RouterFunctionBuilder(); }
RouterFunctions { public static Builder route() { return new RouterFunctionBuilder(); } }
RouterFunctions { public static Builder route() { return new RouterFunctionBuilder(); }  }
RouterFunctions { public static Builder route() { return new RouterFunctionBuilder(); }  static Builder route(); static RouterFunction<T> route(
			RequestPredicate predicate, HandlerFunction<T> handlerFunction); static RouterFunction<T> nest(
			RequestPredicate predicate, RouterFunction<T> routerFunction); static RouterFunction<ServerResponse> resources(String pattern, Resource location); static Function<ServerRequest, Mono<Resource>> resourceLookupFunction(String pattern, Resource location); static RouterFunction<ServerResponse> resources(Function<ServerRequest, Mono<Resource>> lookupFunction); static HttpHandler toHttpHandler(RouterFunction<?> routerFunction); static HttpHandler toHttpHandler(RouterFunction<?> routerFunction, HandlerStrategies strategies); static WebHandler toWebHandler(RouterFunction<?> routerFunction); static WebHandler toWebHandler(RouterFunction<?> routerFunction, HandlerStrategies strategies); }
RouterFunctions { public static Builder route() { return new RouterFunctionBuilder(); }  static Builder route(); static RouterFunction<T> route(
			RequestPredicate predicate, HandlerFunction<T> handlerFunction); static RouterFunction<T> nest(
			RequestPredicate predicate, RouterFunction<T> routerFunction); static RouterFunction<ServerResponse> resources(String pattern, Resource location); static Function<ServerRequest, Mono<Resource>> resourceLookupFunction(String pattern, Resource location); static RouterFunction<ServerResponse> resources(Function<ServerRequest, Mono<Resource>> lookupFunction); static HttpHandler toHttpHandler(RouterFunction<?> routerFunction); static HttpHandler toHttpHandler(RouterFunction<?> routerFunction, HandlerStrategies strategies); static WebHandler toWebHandler(RouterFunction<?> routerFunction); static WebHandler toWebHandler(RouterFunction<?> routerFunction, HandlerStrategies strategies); static final String REQUEST_ATTRIBUTE; static final String URI_TEMPLATE_VARIABLES_ATTRIBUTE; }