Merge branch '2.0.x'
This commit is contained in:
@@ -35,13 +35,14 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.reactive.function.BodyInserters;
|
||||
import org.springframework.web.reactive.function.server.RequestPredicate;
|
||||
import org.springframework.web.reactive.function.server.RequestPredicates;
|
||||
import org.springframework.web.reactive.function.server.RouterFunction;
|
||||
import org.springframework.web.reactive.function.server.RouterFunctions;
|
||||
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
import static org.springframework.web.reactive.function.server.RequestPredicates.all;
|
||||
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
|
||||
|
||||
/**
|
||||
* Basic global {@link org.springframework.web.server.WebExceptionHandler}, rendering
|
||||
* {@link ErrorAttributes}.
|
||||
@@ -106,8 +107,8 @@ public class DefaultErrorWebExceptionHandler extends AbstractErrorWebExceptionHa
|
||||
@Override
|
||||
protected RouterFunction<ServerResponse> getRoutingFunction(
|
||||
ErrorAttributes errorAttributes) {
|
||||
return RouterFunctions.route(acceptsTextHtml(), this::renderErrorView)
|
||||
.andRoute(RequestPredicates.all(), this::renderErrorResponse);
|
||||
return route(acceptsTextHtml(), this::renderErrorView).andRoute(all(),
|
||||
this::renderErrorResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,12 +23,12 @@ import org.springframework.boot.test.context.runner.ReactiveWebApplicationContex
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.server.reactive.HttpHandler;
|
||||
import org.springframework.web.reactive.function.server.RequestPredicates;
|
||||
import org.springframework.web.reactive.function.server.RouterFunction;
|
||||
import org.springframework.web.reactive.function.server.RouterFunctions;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
|
||||
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
|
||||
|
||||
/**
|
||||
* Tests for {@link HttpHandlerAutoConfiguration}.
|
||||
@@ -69,8 +69,7 @@ public class HttpHandlerAutoConfigurationTests {
|
||||
|
||||
@Bean
|
||||
public RouterFunction<ServerResponse> routerFunction() {
|
||||
return RouterFunctions.route(RequestPredicates.GET("/test"),
|
||||
(serverRequest) -> null);
|
||||
return route(GET("/test"), (serverRequest) -> null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user