From aac20b3fd1cf643eb1a999e684be2936203b2735 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Thu, 15 Dec 2016 12:15:17 +0100 Subject: [PATCH] Move functional web framework to web.reactive.function.server --- .../web/reactive/function/package-info.java | 4 ---- .../DefaultHandlerStrategiesBuilder.java | 2 +- .../{ => server}/DefaultServerRequest.java | 2 +- .../DefaultServerResponseBuilder.java | 2 +- .../{ => server}/HandlerFilterFunction.java | 4 ++-- .../{ => server}/HandlerFunction.java | 2 +- .../{ => server}/HandlerStrategies.java | 2 +- .../PathResourceLookupFunction.java | 4 ++-- .../{ => server}/RequestPredicate.java | 2 +- .../{ => server}/RequestPredicates.java | 2 +- .../{ => server}/ResourceHandlerFunction.java | 2 +- .../function/{ => server}/RouterFunction.java | 2 +- .../{ => server}/RouterFunctions.java | 12 ++++++---- .../function/{ => server}/ServerRequest.java | 2 +- .../function/{ => server}/ServerResponse.java | 2 +- .../function/server/package-info.java | 20 ++++++++++++++++ .../support/HandlerFunctionAdapter.java | 8 +++---- .../support/ServerRequestWrapper.java | 6 ++--- .../support/ServerResponseResultHandler.java | 6 ++--- .../function/server/support/package-info.java | 23 +++++++++++++++++++ .../function/support/package-info.java | 7 ------ ...bstractRouterFunctionIntegrationTests.java | 2 +- .../DefaultServerRequestTests.java | 2 +- .../DefaultServerResponseBuilderTests.java | 2 +- .../DispatcherHandlerIntegrationTests.java | 8 +++---- .../{ => server}/HandlerStrategiesTests.java | 5 ++-- .../{ => server}/HeadersWrapperTest.java | 4 ++-- .../{ => server}/MockServerRequest.java | 2 +- .../PathResourceLookupFunctionTests.java | 13 ++++++----- ...lisherHandlerFunctionIntegrationTests.java | 8 +++---- .../{ => server}/RequestPredicateTests.java | 2 +- .../{ => server}/RequestPredicatesTests.java | 2 +- .../ResourceHandlerFunctionTests.java | 6 +++-- .../{ => server}/RouterFunctionTests.java | 2 +- .../{ => server}/RouterFunctionsTests.java | 5 ++-- .../SseHandlerFunctionIntegrationTests.java | 8 +++---- .../support/ServerRequestWrapperTests.java | 4 ++-- .../function/{ => server}/child/response.txt | 0 .../function/{ => server}/response.txt | 0 39 files changed, 115 insertions(+), 76 deletions(-) delete mode 100644 spring-web-reactive/src/main/java/org/springframework/web/reactive/function/package-info.java rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/DefaultHandlerStrategiesBuilder.java (99%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/DefaultServerRequest.java (98%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/DefaultServerResponseBuilder.java (99%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/HandlerFilterFunction.java (96%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/HandlerFunction.java (94%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/HandlerStrategies.java (99%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/PathResourceLookupFunction.java (98%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/RequestPredicate.java (98%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/RequestPredicates.java (99%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/ResourceHandlerFunction.java (98%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/RouterFunction.java (98%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/RouterFunctions.java (96%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/ServerRequest.java (98%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/ServerResponse.java (99%) create mode 100644 spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/package-info.java rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/support/HandlerFunctionAdapter.java (87%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/support/ServerRequestWrapper.java (95%) rename spring-web-reactive/src/main/java/org/springframework/web/reactive/function/{ => server}/support/ServerResponseResultHandler.java (90%) create mode 100644 spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/package-info.java delete mode 100644 spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/package-info.java rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/AbstractRouterFunctionIntegrationTests.java (95%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/DefaultServerRequestTests.java (99%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/DefaultServerResponseBuilderTests.java (99%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/DispatcherHandlerIntegrationTests.java (95%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/HandlerStrategiesTests.java (96%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/HeadersWrapperTest.java (95%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/MockServerRequest.java (99%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/PathResourceLookupFunctionTests.java (88%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/PublisherHandlerFunctionIntegrationTests.java (93%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/RequestPredicateTests.java (97%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/RequestPredicatesTests.java (98%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/ResourceHandlerFunctionTests.java (96%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/RouterFunctionTests.java (98%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/RouterFunctionsTests.java (97%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/SseHandlerFunctionIntegrationTests.java (94%) rename spring-web-reactive/src/test/java/org/springframework/web/reactive/function/{ => server}/support/ServerRequestWrapperTests.java (95%) rename spring-web-reactive/src/test/resources/org/springframework/web/reactive/function/{ => server}/child/response.txt (100%) rename spring-web-reactive/src/test/resources/org/springframework/web/reactive/function/{ => server}/response.txt (100%) diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/package-info.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/package-info.java deleted file mode 100644 index 6b3f800eb8..0000000000 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Types that make up Spring's functional web framework. - */ -package org.springframework.web.reactive.function; \ No newline at end of file diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/DefaultHandlerStrategiesBuilder.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/DefaultHandlerStrategiesBuilder.java similarity index 99% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/DefaultHandlerStrategiesBuilder.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/DefaultHandlerStrategiesBuilder.java index 4c09180dc3..cc97dcd313 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/DefaultHandlerStrategiesBuilder.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/DefaultHandlerStrategiesBuilder.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.util.ArrayList; import java.util.Collections; diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/DefaultServerRequest.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/DefaultServerRequest.java similarity index 98% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/DefaultServerRequest.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/DefaultServerRequest.java index a53cd7bb66..39b240420e 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/DefaultServerRequest.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/DefaultServerRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.net.InetSocketAddress; import java.net.URI; diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/DefaultServerResponseBuilder.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/DefaultServerResponseBuilder.java similarity index 99% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/DefaultServerResponseBuilder.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/DefaultServerResponseBuilder.java index 861bb7a987..2bc89b6096 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/DefaultServerResponseBuilder.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/DefaultServerResponseBuilder.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.net.URI; import java.time.ZoneId; diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/HandlerFilterFunction.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/HandlerFilterFunction.java similarity index 96% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/HandlerFilterFunction.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/HandlerFilterFunction.java index 7e367b1340..338d434bb8 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/HandlerFilterFunction.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/HandlerFilterFunction.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.util.function.Function; import reactor.core.publisher.Mono; import org.springframework.util.Assert; -import org.springframework.web.reactive.function.support.ServerRequestWrapper; +import org.springframework.web.reactive.function.server.support.ServerRequestWrapper; /** * Represents a function that filters a {@linkplain HandlerFunction handler function}. diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/HandlerFunction.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/HandlerFunction.java similarity index 94% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/HandlerFunction.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/HandlerFunction.java index be0643e7f4..f314179ec0 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/HandlerFunction.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/HandlerFunction.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import reactor.core.publisher.Mono; diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/HandlerStrategies.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/HandlerStrategies.java similarity index 99% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/HandlerStrategies.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/HandlerStrategies.java index 3f6084da4a..739b7d22f8 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/HandlerStrategies.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/HandlerStrategies.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.util.function.Supplier; import java.util.stream.Stream; diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/PathResourceLookupFunction.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java similarity index 98% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/PathResourceLookupFunction.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java index 7b094aaeb5..70d64c75c4 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/PathResourceLookupFunction.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.io.IOException; import java.io.UncheckedIOException; @@ -107,7 +107,7 @@ class PathResourceLookupFunction implements Function routerFunction) { return toHandlerMapping(routerFunction, HandlerStrategies.withDefaults()); @@ -220,8 +222,8 @@ public abstract class RouterFunctions { * @param routerFunction the router function to convert * @param strategies the strategies to use * @return an handler mapping that maps HTTP request to a handler using the given router function - * @see org.springframework.web.reactive.function.support.HandlerFunctionAdapter - * @see org.springframework.web.reactive.function.support.ServerResponseResultHandler + * @see HandlerFunctionAdapter + * @see ServerResponseResultHandler */ public static HandlerMapping toHandlerMapping(RouterFunction routerFunction, HandlerStrategies strategies) { Assert.notNull(routerFunction, "RouterFunction must not be null"); diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/ServerRequest.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/ServerRequest.java similarity index 98% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/ServerRequest.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/ServerRequest.java index 8b48632135..e86b804a12 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/ServerRequest.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/ServerRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.net.InetSocketAddress; import java.net.URI; diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/ServerResponse.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/ServerResponse.java similarity index 99% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/ServerResponse.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/ServerResponse.java index 4e883a0bf6..1dfe579956 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/ServerResponse.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/ServerResponse.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.net.URI; import java.time.ZonedDateTime; diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/package-info.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/package-info.java new file mode 100644 index 0000000000..19dcae36a2 --- /dev/null +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2002-2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Types that make up Spring's functional web framework. + */ +package org.springframework.web.reactive.function.server; \ No newline at end of file diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/HandlerFunctionAdapter.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/HandlerFunctionAdapter.java similarity index 87% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/HandlerFunctionAdapter.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/HandlerFunctionAdapter.java index 96de8df706..e84d2e0482 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/HandlerFunctionAdapter.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/HandlerFunctionAdapter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function.support; +package org.springframework.web.reactive.function.server.support; import java.lang.reflect.Method; @@ -23,9 +23,9 @@ import reactor.core.publisher.Mono; import org.springframework.core.MethodParameter; import org.springframework.web.reactive.HandlerAdapter; import org.springframework.web.reactive.HandlerResult; -import org.springframework.web.reactive.function.HandlerFunction; -import org.springframework.web.reactive.function.RouterFunctions; -import org.springframework.web.reactive.function.ServerRequest; +import org.springframework.web.reactive.function.server.HandlerFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerRequest; import org.springframework.web.server.ServerWebExchange; /** diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/ServerRequestWrapper.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/ServerRequestWrapper.java similarity index 95% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/ServerRequestWrapper.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/ServerRequestWrapper.java index bf49c56d32..577cff73e5 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/ServerRequestWrapper.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/ServerRequestWrapper.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function.support; +package org.springframework.web.reactive.function.server.support; import java.net.InetSocketAddress; import java.net.URI; @@ -34,8 +34,8 @@ import org.springframework.http.MediaType; import org.springframework.http.codec.BodyExtractor; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.util.Assert; -import org.springframework.web.reactive.function.HandlerFunction; -import org.springframework.web.reactive.function.ServerRequest; +import org.springframework.web.reactive.function.server.HandlerFunction; +import org.springframework.web.reactive.function.server.ServerRequest; /** * Implementation of the {@link ServerRequest} interface that can be subclassed to adapt the request to a diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/ServerResponseResultHandler.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/ServerResponseResultHandler.java similarity index 90% rename from spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/ServerResponseResultHandler.java rename to spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/ServerResponseResultHandler.java index a447fee3ba..83fe18148f 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/ServerResponseResultHandler.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/ServerResponseResultHandler.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package org.springframework.web.reactive.function.support; +package org.springframework.web.reactive.function.server.support; import reactor.core.publisher.Mono; import org.springframework.util.Assert; import org.springframework.web.reactive.HandlerResult; import org.springframework.web.reactive.HandlerResultHandler; -import org.springframework.web.reactive.function.HandlerStrategies; -import org.springframework.web.reactive.function.ServerResponse; +import org.springframework.web.reactive.function.server.HandlerStrategies; +import org.springframework.web.reactive.function.server.ServerResponse; import org.springframework.web.server.ServerWebExchange; /** diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/package-info.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/package-info.java new file mode 100644 index 0000000000..a1bb89412e --- /dev/null +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/server/support/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright 2002-2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Classes supporting the {@code org.springframework.web.reactive.function} package. + * Contains a {@code HandlerAdapter} that supports {@code HandlerFunction}s, + * a {@code HandlerResultHandler} that supports {@code ServerResponse}s, and + * a {@code ServerRequest} wrapper to adapt a request. + */ +package org.springframework.web.reactive.function.server.support; \ No newline at end of file diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/package-info.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/package-info.java deleted file mode 100644 index 5abbc451fa..0000000000 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/support/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Classes supporting the {@code org.springframework.web.reactive.function} package. - * Contains a {@code HandlerAdapter} that supports {@code HandlerFunction}s, - * a {@code HandlerResultHandler} that supports {@code ServerResponse}s, and - * a {@code ServerRequest} wrapper to adapt a request. - */ -package org.springframework.web.reactive.function.support; \ No newline at end of file diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/AbstractRouterFunctionIntegrationTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/AbstractRouterFunctionIntegrationTests.java similarity index 95% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/AbstractRouterFunctionIntegrationTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/AbstractRouterFunctionIntegrationTests.java index 806deef663..5302a39cd5 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/AbstractRouterFunctionIntegrationTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/AbstractRouterFunctionIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import org.springframework.http.server.reactive.AbstractHttpHandlerIntegrationTests; import org.springframework.http.server.reactive.HttpHandler; diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/DefaultServerRequestTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/DefaultServerRequestTests.java similarity index 99% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/DefaultServerRequestTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/DefaultServerRequestTests.java index 496dde0d1e..c558bf16d1 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/DefaultServerRequestTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/DefaultServerRequestTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.net.InetSocketAddress; import java.net.URI; diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/DefaultServerResponseBuilderTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/DefaultServerResponseBuilderTests.java similarity index 99% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/DefaultServerResponseBuilderTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/DefaultServerResponseBuilderTests.java index f978ac0f59..9b885a63e2 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/DefaultServerResponseBuilderTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/DefaultServerResponseBuilderTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.net.URI; import java.time.ZonedDateTime; diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/DispatcherHandlerIntegrationTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/DispatcherHandlerIntegrationTests.java similarity index 95% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/DispatcherHandlerIntegrationTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/DispatcherHandlerIntegrationTests.java index 2fba9ca6aa..8c2685b8bd 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/DispatcherHandlerIntegrationTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/DispatcherHandlerIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.util.List; import java.util.function.Supplier; @@ -42,15 +42,15 @@ import org.springframework.web.reactive.DispatcherHandler; import org.springframework.web.reactive.HandlerAdapter; import org.springframework.web.reactive.HandlerMapping; import org.springframework.web.reactive.config.WebReactiveConfigurationSupport; -import org.springframework.web.reactive.function.support.HandlerFunctionAdapter; -import org.springframework.web.reactive.function.support.ServerResponseResultHandler; +import org.springframework.web.reactive.function.server.support.HandlerFunctionAdapter; +import org.springframework.web.reactive.function.server.support.ServerResponseResultHandler; import org.springframework.web.reactive.result.view.ViewResolver; import org.springframework.web.server.adapter.WebHttpHandlerBuilder; import static org.junit.Assert.assertEquals; import static org.springframework.http.codec.BodyInserters.fromObject; import static org.springframework.http.codec.BodyInserters.fromPublisher; -import static org.springframework.web.reactive.function.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; /** * Tests the use of {@link HandlerFunction} and {@link RouterFunction} in a diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/HandlerStrategiesTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/HandlerStrategiesTests.java similarity index 96% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/HandlerStrategiesTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/HandlerStrategiesTests.java index 37bde92b3c..5dfc452860 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/HandlerStrategiesTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/HandlerStrategiesTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.util.Collections; import java.util.List; @@ -36,7 +36,8 @@ import org.springframework.http.ReactiveHttpOutputMessage; import org.springframework.http.codec.HttpMessageReader; import org.springframework.http.codec.HttpMessageWriter; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * @author Arjen Poutsma diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/HeadersWrapperTest.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/HeadersWrapperTest.java similarity index 95% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/HeadersWrapperTest.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/HeadersWrapperTest.java index 1533ed82ea..4e3d1f6409 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/HeadersWrapperTest.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/HeadersWrapperTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.net.InetSocketAddress; import java.nio.charset.Charset; @@ -30,7 +30,7 @@ import org.junit.Test; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpRange; import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.support.ServerRequestWrapper; +import org.springframework.web.reactive.function.server.support.ServerRequestWrapper; import static org.junit.Assert.assertSame; import static org.mockito.Mockito.mock; diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/MockServerRequest.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/MockServerRequest.java similarity index 99% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/MockServerRequest.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/MockServerRequest.java index 7dce98f191..29a14bd717 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/MockServerRequest.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/MockServerRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.net.InetSocketAddress; import java.net.URI; diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/PathResourceLookupFunctionTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/PathResourceLookupFunctionTests.java similarity index 88% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/PathResourceLookupFunctionTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/PathResourceLookupFunctionTests.java index f05ef215cd..1a19be2561 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/PathResourceLookupFunctionTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/PathResourceLookupFunctionTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.io.File; import java.io.IOException; @@ -34,9 +34,10 @@ public class PathResourceLookupFunctionTests { @Test public void normal() throws Exception { - ClassPathResource location = new ClassPathResource("org/springframework/web/reactive/function/"); + ClassPathResource location = new ClassPathResource("org/springframework/web/reactive/function/server/"); - PathResourceLookupFunction function = new PathResourceLookupFunction("/resources/**", location); + PathResourceLookupFunction + function = new PathResourceLookupFunction("/resources/**", location); MockServerRequest request = MockServerRequest.builder() .uri(new URI("http://localhost/resources/response.txt")) .build(); @@ -58,14 +59,14 @@ public class PathResourceLookupFunctionTests { @Test public void subPath() throws Exception { - ClassPathResource location = new ClassPathResource("org/springframework/web/reactive/function/"); + ClassPathResource location = new ClassPathResource("org/springframework/web/reactive/function/server/"); PathResourceLookupFunction function = new PathResourceLookupFunction("/resources/**", location); MockServerRequest request = MockServerRequest.builder() .uri(new URI("http://localhost/resources/child/response.txt")) .build(); Mono result = function.apply(request); - File expected = new ClassPathResource("org/springframework/web/reactive/function/child/response.txt").getFile(); + File expected = new ClassPathResource("org/springframework/web/reactive/function/server/child/response.txt").getFile(); StepVerifier.create(result) .expectNextMatches(resource -> { try { @@ -81,7 +82,7 @@ public class PathResourceLookupFunctionTests { @Test public void notFound() throws Exception { - ClassPathResource location = new ClassPathResource("org/springframework/web/reactive/function/"); + ClassPathResource location = new ClassPathResource("org/springframework/web/reactive/function/server/"); PathResourceLookupFunction function = new PathResourceLookupFunction("/resources/**", location); MockServerRequest request = MockServerRequest.builder() diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/PublisherHandlerFunctionIntegrationTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/PublisherHandlerFunctionIntegrationTests.java similarity index 93% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/PublisherHandlerFunctionIntegrationTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/PublisherHandlerFunctionIntegrationTests.java index 62aa5016ec..4f1da49ff7 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/PublisherHandlerFunctionIntegrationTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/PublisherHandlerFunctionIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.net.URI; import java.util.List; @@ -34,9 +34,9 @@ import org.springframework.web.client.RestTemplate; import static org.junit.Assert.assertEquals; import static org.springframework.http.codec.BodyExtractors.toMono; import static org.springframework.http.codec.BodyInserters.fromPublisher; -import static org.springframework.web.reactive.function.RequestPredicates.GET; -import static org.springframework.web.reactive.function.RequestPredicates.POST; -import static org.springframework.web.reactive.function.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; /** * @author Arjen Poutsma diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RequestPredicateTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RequestPredicateTests.java similarity index 97% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RequestPredicateTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RequestPredicateTests.java index d1ef1d314d..0fef748db7 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RequestPredicateTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RequestPredicateTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import org.junit.Test; diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RequestPredicatesTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RequestPredicatesTests.java similarity index 98% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RequestPredicatesTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RequestPredicatesTests.java index 00b13d4735..f73fafa1ca 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RequestPredicatesTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RequestPredicatesTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.net.URI; import java.util.Collections; diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/ResourceHandlerFunctionTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/ResourceHandlerFunctionTests.java similarity index 96% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/ResourceHandlerFunctionTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/ResourceHandlerFunctionTests.java index 62c3a74f56..5d7697c8e8 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/ResourceHandlerFunctionTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/ResourceHandlerFunctionTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.io.IOException; import java.nio.file.Files; @@ -35,7 +35,9 @@ import org.springframework.web.server.ServerWebExchange; import org.springframework.web.server.adapter.DefaultServerWebExchange; import org.springframework.web.server.session.MockWebSessionManager; -import static org.junit.Assert.*; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; /** * @author Arjen Poutsma diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RouterFunctionTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RouterFunctionTests.java similarity index 98% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RouterFunctionTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RouterFunctionTests.java index 59e2e1c50b..9c1ec9cadf 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RouterFunctionTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RouterFunctionTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import org.junit.Test; import reactor.core.publisher.Mono; diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RouterFunctionsTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RouterFunctionsTests.java similarity index 97% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RouterFunctionsTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RouterFunctionsTests.java index aac0997753..fc80c41ccd 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/RouterFunctionsTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/RouterFunctionsTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.util.stream.Stream; @@ -51,7 +51,8 @@ public class RouterFunctionsTests { RequestPredicate requestPredicate = mock(RequestPredicate.class); when(requestPredicate.test(request)).thenReturn(true); - RouterFunction result = RouterFunctions.route(requestPredicate, handlerFunction); + RouterFunction + result = RouterFunctions.route(requestPredicate, handlerFunction); assertNotNull(result); Mono> resultHandlerFunction = result.route(request); diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/SseHandlerFunctionIntegrationTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/SseHandlerFunctionIntegrationTests.java similarity index 94% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/SseHandlerFunctionIntegrationTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/SseHandlerFunctionIntegrationTests.java index f7900f2c17..695c1a102c 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/SseHandlerFunctionIntegrationTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/SseHandlerFunctionIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function; +package org.springframework.web.reactive.function.server; import java.time.Duration; @@ -28,11 +28,11 @@ import org.springframework.http.MediaType; import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.http.codec.BodyExtractors; import org.springframework.http.codec.ServerSentEvent; -import org.springframework.web.client.reactive.ClientRequest; -import org.springframework.web.client.reactive.WebClient; +import org.springframework.web.reactive.function.client.ClientRequest; +import org.springframework.web.reactive.function.client.WebClient; import static org.springframework.http.codec.BodyInserters.fromServerSentEvents; -import static org.springframework.web.reactive.function.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; /** * @author Arjen Poutsma diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/support/ServerRequestWrapperTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/support/ServerRequestWrapperTests.java similarity index 95% rename from spring-web-reactive/src/test/java/org/springframework/web/reactive/function/support/ServerRequestWrapperTests.java rename to spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/support/ServerRequestWrapperTests.java index ad4897667e..7042ca8f51 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/support/ServerRequestWrapperTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/function/server/support/ServerRequestWrapperTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.web.reactive.function.support; +package org.springframework.web.reactive.function.server.support; import java.net.URI; import java.util.Collections; @@ -26,7 +26,7 @@ import org.junit.Before; import org.junit.Test; import org.springframework.http.HttpMethod; -import org.springframework.web.reactive.function.ServerRequest; +import org.springframework.web.reactive.function.server.ServerRequest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; diff --git a/spring-web-reactive/src/test/resources/org/springframework/web/reactive/function/child/response.txt b/spring-web-reactive/src/test/resources/org/springframework/web/reactive/function/server/child/response.txt similarity index 100% rename from spring-web-reactive/src/test/resources/org/springframework/web/reactive/function/child/response.txt rename to spring-web-reactive/src/test/resources/org/springframework/web/reactive/function/server/child/response.txt diff --git a/spring-web-reactive/src/test/resources/org/springframework/web/reactive/function/response.txt b/spring-web-reactive/src/test/resources/org/springframework/web/reactive/function/server/response.txt similarity index 100% rename from spring-web-reactive/src/test/resources/org/springframework/web/reactive/function/response.txt rename to spring-web-reactive/src/test/resources/org/springframework/web/reactive/function/server/response.txt -- GitLab