Commit Graph

14898 Commits

Author SHA1 Message Date
Rossen Stoyanchev 97390fd939 Polish 2017-06-23 17:05:57 -04:00
Rossen Stoyanchev 12850c5fc4 Fix test failure by using the new cloneBuilder method
The cloneBuilder helps to avoid the issue in the comment of the ticket.
Rather than creating the WebClient to then obtain a fresh builder which
causes connector instantiation, we now use the cloneBuilder

Issue: SPR-15674
2017-06-23 16:22:10 -04:00
Brian Clozel 8ac29c8ce7 Add cloneBuilder method on WebClient.Builder
This commit adds a new `cloneBuilder()` method on `WebClient.Builder`;
we can now reuse the customizations of an existing builder without
sharing its state across several `WebClient` building code paths.

Issue: SPR-15690
2017-06-23 16:16:23 -04:00
Rossen Stoyanchev 8fc3b3bc37 Add WebTestClientConfigurer
Issue: SPR-15674
2017-06-23 14:45:46 -04:00
Rossen Stoyanchev 4db0ce12e1 Add MockServerConfigurer to WebTestClient
Issue: SPR-15674
2017-06-23 10:46:59 -04:00
Rossen Stoyanchev c37c59f578 Consumer methods for WebHttpHandlerBuilder
Replace the more limited List-based methods to add filtes and exception
handlers with Consumer<List<?>> variants.
2017-06-23 07:12:10 -04:00
Rossen Stoyanchev 782c595cf7 Polish 2017-06-22 18:33:27 -04:00
Eko Kurniawan Khannedy ac68cc35c2 Ordered WebMvcConfigurer interceptor registrations
Issue: SPR-15620
2017-06-22 18:33:27 -04:00
Sebastien Deleuze 5c1d8c7c59 Leverage ZonedDateTime in HttpHeaders
This commit introduces 2 new public methods in HttpHeaders in order
to leverage Java 8 ZonedDateTime in addition to the existing long
(with GMT time zone implied) variants:
 - ZonedDateTime getFirstZonedDateTime(String headerName)
 - void setZonedDateTime(String headerName, ZonedDateTime date)

This commit also leverages Java 8 thread-safe DateTimeFormatter for
HttpHeader implementation instead of SimpleDateFormat. As a consequence
of the usage of DateTimeFormatter.RFC_1123_DATE_TIME, HTTP date header
serialization could change slightly for single digit days from for
example "Thu, 01 Jan 1970 00:00:00 GMT" to
"Thu, 1 Jan 1970 00:00:00 GMT".

Issue: SPR-15661
2017-06-23 00:15:51 +02:00
Arjen Poutsma 4f39edc905 Fix initialization issue with headers in DefaultWebClient
This commit fixes a lazy initialization issue in
`headers(Consumer<HttpHeaders>)`.

Issue: SPR-15657
2017-06-21 15:48:48 +02:00
Arjen Poutsma 0a4d3c14db Jackson2JsonDecoder should support empty JSON array
Before this commit, the Jackson2JsonDecoder was not able to decode an
empty JSON array (`[]`). After this commit, it is.

Issue: SPR-15685
2017-06-21 11:14:34 +02:00
Sebastien Deleuze 1e04cdfa7e Add CorsWebFilter
This new WebFilter implementation is designed to allow initial
CORS support when using WebFlux functional API. More high-level
API may be introduced later.

Issue: SPR-15567
2017-06-21 10:50:09 +02:00
Sebastien Deleuze 59e90943e4 Rename CorsProcessor#processRequest to process 2017-06-21 10:50:09 +02:00
Rob Winch f092ae567b Conditionally apply Kotlin if not using JDK 9
Kotlin does not yet work with JDK 9, so we need to disable the Kotlin
plugin if we are using JDK 9.
2017-06-20 14:35:55 -05:00
Juergen Hoeller 03133630cb Missing @Nullable annotations in WebFlux, in particular around locale resolution
Issue: SPR-15036
Issue: SPR-15540
2017-06-20 18:08:42 +02:00
Arjen Poutsma a95cf07317 Add WebTestClient.mutate()
This commit introduces a WebTestClient.mutate() method,
returning a WebTestClient.Builder.

Issue: SPR-15657
2017-06-20 17:11:52 +02:00
Juergen Hoeller 535103cd52 Fine-tune HTTP/RMI Invoker exception handling
Issue: SPR-15684
2017-06-20 16:50:35 +02:00
Juergen Hoeller c244f33f84 Polishing 2017-06-20 16:50:02 +02:00
Arjen Poutsma 3b1d46b3ba Polishing 2017-06-20 16:34:09 +02:00
Arjen Poutsma 50fc8f4e32 Support Void response body type in WebClient
This commit adds support for Void response body types in the WebClient,
both when using `exchange` with a response.bodyToMono(Void.class), as
well as using `retrieve` with `toEntity(Void.class)`.

Issue: SPR-15679
2017-06-20 16:30:37 +02:00
Arjen Poutsma 4a0597d612 Replace WebClient.filter with Builder.filter
This commit replaces the WebClient.filter method with
WebClient.Builder.filter. The reason for this change is that filters
added via WebClient.filter would be applied in the opposite order of
their declaration, due to the compositional nature of the method,
combined with the immutable nature of the WebClient.
WebClient.Builder.filter does keep the order of the filters, as
registered.

Furthermore, this commit introduces a WebClient.mutate() method,
returning a WebClient.Builder. This method allow to add/remove filters
and other defaults from a given WebClient.

Issue: SPR-15657

Add WebClient.Builder.addFilter

Add Consumer-based headers and cookies methods to builders.

Add WebClient.mutate
2017-06-20 14:25:52 +02:00
Brian Clozel 52148a10b7 Consistently use CodecConfigurer for configuration
This commit changes the `ExchangeStrategies` and `HandlerStrategies`
interfaces to consistently use the `CodecConfigurer` (and
sub-interfaces) for configuring codecs on the server and on the client.

Issue: SPR-15682
2017-06-19 18:42:37 +02:00
Juergen Hoeller 018cc45483 Upgrade to Groovy 2.5 beta 1
Includes latest dependency updates (Commons FileUpload 1.3.3, OkHttp 3.8.1, XStream 1.4.10)

Issue: SPR-15407
2017-06-19 12:28:09 +02:00
Stephane Nicoll 0e87a346ac Merge pull request #1461 from freeman0432:master
* pr/1461:
  Fix a missing line of xml fragment
2017-06-17 10:33:28 +02:00
freeman0432 b14df2b6ea Fix a missing line of xml fragment
Closes gh-1461
2017-06-17 10:33:08 +02:00
Sebastien Deleuze a2e555d749 Upgrade to Jackson 2.9.0.pr4
Issue: SPR-15548
2017-06-17 09:37:28 +02:00
Sebastien Deleuze 38db64e0d8 Warn when Jackson + Kotlin are used without jackson-module-kotlin
Issue: SPR-15658
2017-06-17 00:07:59 +02:00
Juergen Hoeller efb735aa99 SimpleRequestExpectationManager properly handles sequential requests with different count
Issue: SPR-15672
2017-06-16 13:32:43 +02:00
Sebastien Deleuze d5f9ad03a7 Support ScriptEngine#eval(String, Bindings) in ScriptTemplateView
Supporting ScriptEngine#eval(String, Bindings) when no render function
is specified allows to support use cases where script templates are
simply evaluating a script expression with an even more simplified
configuration.

This improvement also makes it possible to use script engines that
do not implement Invocable.

Issue: SPR-15115
2017-06-16 10:38:59 +02:00
Juergen Hoeller 7e251274ee Consistent nullability of headers Map and MessagePostProcessor
Issue: SPR-15670
2017-06-15 22:45:06 +02:00
Rossen Stoyanchev 4a21fb27fc Fix root path test and add more test cases 2017-06-15 16:14:12 -04:00
Rossen Stoyanchev 67e482aaf8 Fix ROOT_PATH constant to match recent changes
"/" should be 0 segments, isAbsolute=true, hasTrailingSlash=false
2017-06-15 15:40:32 -04:00
Rossen Stoyanchev ef3e309c12 Adjust timeout in Spring MVC for reactive streaming
Issue: SPR-15669
2017-06-15 13:11:59 -04:00
Rossen Stoyanchev 53e8ebe6a6 Fix failing test (after previous commit) 2017-06-15 11:07:39 -04:00
Rossen Stoyanchev 97917aa57d Add PathSegmentContainer subPath extracting method 2017-06-14 17:44:56 -04:00
Rossen Stoyanchev 1018bf771b Separate DefaultRequestPath/DefaultPathSegmentContainer 2017-06-14 17:44:56 -04:00
Rossen Stoyanchev 97a97f9bba RequestPath improvements
Static parse methods on PathSegmentContainer and PathSegment plus:

isEmpty() on PathSegmentContainer and PathSegment
isAbsolute() and hasTrailingSlash() on PathSegmentContainer
char[] alternative for valueDecoded() on PathSegment
2017-06-14 17:44:56 -04:00
Juergen Hoeller 7b5f96c804 HttpComponentsAsyncClientHttpRequestFactory supports plain HttpAsyncClient as well
Issue: SPR-15664
2017-06-14 17:10:44 +02:00
Juergen Hoeller 137fc48cc2 Polishing 2017-06-13 20:59:26 +02:00
Sebastien Deleuze 04d5a2951c Remove KClass based Kotlin extensions
Issue: SPR-15660
2017-06-13 18:43:59 +02:00
Rob Winch 223315f96b Update to SonarQube 2.5 2017-06-13 09:30:50 -05:00
Stephane Nicoll 5e4e3fbe8b Merge pull request #1459 from diguage:lambda-map
* pr/1459:
  Polish "Refactor iterator of Map with Java8's Map.forEach"
  Refactor iterator of Map with Java8's Map.forEach
2017-06-13 16:06:47 +02:00
Stephane Nicoll 1ab678a2a3 Polish "Refactor iterator of Map with Java8's Map.forEach"
Closes gh-1459
2017-06-13 16:06:20 +02:00
diguage 1ef5f61ab2 Refactor iterator of Map with Java8's Map.forEach
See gh-1459
2017-06-13 16:06:20 +02:00
Arjen Poutsma 7018804e84 ServerRequest.path() should return raw path
After this commit, ServerRequest.path() returns the raw, unencoded path,
as that is expected by the PathPatternParser.
2017-06-13 15:23:46 +02:00
Sebastien Deleuze 97909f2258 Support date properties in Content-Disposition HTTP header
Issue: SPR-15555
2017-06-13 15:17:48 +02:00
Sebastien Deleuze e0e6736bc5 Introduce LocaleContextResolver in WebFlux
This commit introduces LocaleContextResolver interface, which is used
at ServerWebExchange level to resolve Locale, TimeZone and other i18n
related informations.

It follows Spring MVC locale resolution patterns with a few differences:
 - Only LocaleContextResolver is supported since LocaleResolver is less
   flexible
 - Support is implemented in the org.springframework.web.server.i18n
   package of spring-web module rather than in spring-webflux in order
   to be able to leverage it at ServerWebExchange level

2 implementations are provided:
 - FixedLocaleContextResolver
 - AcceptHeaderLocaleContextResolver

It can be configured with both functional or annotation-based APIs.

Issue: SPR-15036
2017-06-13 15:10:18 +02:00
Juergen Hoeller 72a8868f84 FreeMarker macros based on HTML output format (requires FreeMarker 2.3.24+)
Issue: SPR-14740
2017-06-13 14:21:09 +02:00
Juergen Hoeller a0cea9a86f Polishing 2017-06-13 14:20:33 +02:00
Sebastien Deleuze aa28b6cb54 Upgrade to Kotlin 1.1.2-5
Changelog: https://github.com/JetBrains/kotlin/releases/tag/v1.1.2-5
2017-06-13 12:22:52 +02:00