Switch to functional web code to use static imports

Update the samples and tests to use the more idiomatic static import
style.
This commit is contained in:
Phillip Webb
2018-06-04 17:27:34 -07:00
parent 8eba37500c
commit 571c50e43f
7 changed files with 29 additions and 31 deletions

View File

@@ -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);
}
}