Commit Graph

14207 Commits

Author SHA1 Message Date
Rossen Stoyanchev
f219680d42 Add equals/hashcode for STOMP Subscription
Issue: SPR-15229
2017-02-21 15:05:06 -05:00
Rossen Stoyanchev
5ea5f81c00 Support flash attributes on ResponseEntity redirect
Issue: SPR-15176
2017-02-21 14:44:17 -05:00
Stephane Maldini
ba97432043 prepare for reactor-netty 0.6.1.RELEASE 2017-02-21 16:00:19 +00:00
Juergen Hoeller
6242e30539 Polishing 2017-02-21 15:27:21 +01:00
Arjen Poutsma
7582adc0bc Fix trailing slash in nested path
This commit adds a trailing slash to the nested path if the request path
also ends with a slash. For instance, given the request "/foo/bar/", and
nested path pattern "/foo/**", we expect the nested path to be “/bar/”,
not “/bar".
2017-02-21 13:46:27 +01:00
Brian Clozel
babd5517aa Revert ParsingPathMatcher concurrency checks
`PathPatternParser` is now thread-safe and creates a new internal parser
for each `parse` call, since this operation is cheap.
This commit removes the `ThreadLocal` based instances of
`PathPatternParser` in `ParsingPathMatcher` which are not required
anymore.

Issue: SPR-15246
2017-02-21 11:44:59 +01:00
Andy Clement
a0505bf1e7 Make PathPatternParser multi-threaded
With this change the original PathPatternParser is renamed
InternalPathPatternParser and a new PathPatternParser class is added.
This new PathPatternParser class is a very simple thread-safe wrapper for
the InternalPathPatternParser. It achieves this by creating a new
InternalPathPatternParser for each new parse request.  This follows the
model used for SpEL parsing.
2017-02-21 11:44:59 +01:00
Arjen Poutsma
8450c69497 Add ListBodySpec.size implementation
Added implementation for WebTestClient.ListBodySpec.size().
2017-02-21 11:25:49 +01:00
Rossen Stoyanchev
262e5f783d Polish 2017-02-20 21:59:47 -05:00
Rossen Stoyanchev
2515134f8e Fix direction of arrows in request/response output 2017-02-20 18:38:15 -05:00
Rossen Stoyanchev
e6401b29e6 Access to request and response byte[] in WebTestClient
The WiretapConnector now decorated the ClientHttpRequest & Response
in order to intercept and save the actual content written and read.

The saved content is now incorporated in the diagnostic output but may
be used for other purposes as well (e.g. REST Docs).

Diagnostic information about an exchange has also been refactored
similar to command line output from curl.
2017-02-20 18:29:30 -05:00
Rossen Stoyanchev
71b021c7cc Add decorators for ClientHttpRequest & Response 2017-02-20 18:29:30 -05:00
Rossen Stoyanchev
d59dc970a0 Expose response cookies from ExchangeResult 2017-02-20 18:29:30 -05:00
Juergen Hoeller
1ddf8ec625 Polishing 2017-02-21 00:04:08 +01:00
Juergen Hoeller
73493bc490 Revised imports in tests (org.jetbrains.annotations.NotNull etc) 2017-02-20 23:00:22 +01:00
Juergen Hoeller
370e3d683a Polishing 2017-02-20 23:00:12 +01:00
Juergen Hoeller
fc11321010 ServletRequestMethodArgumentResolver passes null references through (again)
Issue: SPR-15214
2017-02-20 23:00:07 +01:00
Juergen Hoeller
b3ad4229f5 Upgrade to Gradle 3.4 final (and Hibernate ORM 5.2.8)
Issue: SPR-15207
2017-02-20 23:00:00 +01:00
Stephane Nicoll
73909f41cb Polish 2017-02-20 16:29:05 +01:00
Stephane Nicoll
1c74a1a0fe Improve allowNullValue handling when a null value is provided
This commit improves `AbstractValueAdaptingCache` to throw a dedicated
exception if `allowNullValues` is `false` and a `null` value is provided
anyway. This avoid a lower-level exception from the cache library that
will miss some context.

Issue: SPR-15173
2017-02-20 16:08:08 +01:00
Sebastien Deleuze
2fe5064dbe Remove unneeded exclude from Gradle build 2017-02-20 15:52:03 +01:00
Arjen Poutsma
4221a344dc Treat empty Accept header as "*/*"
This commit changes the `accept` RequestPredicate so that it treats an
empty `Accept` header as having the value `*/*`, as per the HTTP spec.
2017-02-20 15:40:24 +01:00
Brian Clozel
b732251b09 Ignore HEAD requests in ShallowEtagHeaderFilter
Prior to this commit, the `ShallowEtagHeaderFilter` could participate in
the response and set its ETag/Content-Length headers, even for HEAD
requests. Since the response body is empty, the filter implementation
would set a `"Content-Length: 0"`.

The RFC states that responses to HEAD requests should exhibit identical
response headers to GET (with the possible exception of payload related
headers such as Content-Length.

With this commit, `ShallowEtagHeaderFilter` now ignores HEAD requests
since the proper values may be set already for payload related headers
by the handler. The filter has no way to generate a proper ETag value
nor calculate the content length without the actual body.

Issue: SPR-15261
2017-02-20 11:58:22 +01:00
Stephane Nicoll
598d9a4b05 Add test to reproduce SPR-15271 2017-02-20 11:34:08 +01:00
Arjen Poutsma
1efcf26559 Defer evaluation of right-hand route in composed route 2017-02-20 10:59:53 +01:00
Arjen Poutsma
9ab8bd046c Improved logging in functional web framework
This commit improves predicate and route logging in the functional web
framework.
2017-02-20 10:59:23 +01:00
Arjen Poutsma
63f261155a Fixed build by suppressing unchecked warnings 2017-02-20 09:22:59 +01:00
Rossen Stoyanchev
24358200c3 Assertion errors with request and response details
Issue: SPR-15249
2017-02-19 21:14:48 -05:00
Rossen Stoyanchev
d1a64e1122 Refactor ExchangeResult
Clearly separate how the result of an exchange is represented before
the response body has been read (e.g. assertions on status and headers
only) vs later after the body is extracted to a representation
(assertions on the extracted body) or is decoded to Flux<T> (e.g. for
use with a StepVerifier).
2017-02-19 21:14:48 -05:00
Rossen Stoyanchev
20be40bf64 WebTestClient polish and minor refactoring 2017-02-19 21:14:48 -05:00
Andy Clement
d924538211 Fix RegexPathElement when matching variables against a root path
The first fix for issue 15264 covered the case of using a single
variable (the case mentioned in the bug report). However, when
more than one variable is used a different PathElement is built.
This RegexPathElement needs a similar change that checks the
path includes data to bind.

Issue: SPR-15264
2017-02-19 17:11:31 -08:00
Rossen Stoyanchev
9829a62044 Refactor WebTestClient assertions take 3
WebTestClient now defines all the steps from setup to performing
an exchange and applying expectations.

The order of expectations now ensures the response status and headers
are verified first since that's available before the body is consumed
and also because it determines how the body is to be decoded, i.e.
error vs success scenarios.

There is now a built-in option for verifying the response as a Map
along with Map-specific assertions.

There are similar options for verifying the response as a List as well
as whether to "collect" the list or "take" the first N elements from
the response stream.
2017-02-17 23:10:34 -05:00
Andy Clement
f1653cc21c Fix PathPattern incorrectly matching variable against root path
Issue: SPR-15264
2017-02-17 17:37:12 -08:00
Juergen Hoeller
45df1d9fea Javadoc fixes 2017-02-18 01:43:30 +01:00
Juergen Hoeller
214d0d76a5 Polishing 2017-02-18 01:01:35 +01:00
Juergen Hoeller
0f51ff5ebc Reset global rollback-only status when rolling back to savepoint
Issue: SPR-6568
2017-02-17 23:40:44 +01:00
Juergen Hoeller
1ee0626c94 Polishing 2017-02-17 21:06:58 +01:00
Juergen Hoeller
74bdcd8ed4 MutableMessageHeaders serializes itself as regular MessageHeaders
Issue: SPR-15262
2017-02-17 20:59:17 +01:00
Sebastien Deleuze
692e432f0b Generate Java 8 bytecode with Kotlin compiler
This commit also updates Kotlin from beta 2 to RC.

Issue: SPR-15183
2017-02-17 11:47:19 +01:00
Sebastien Deleuze
4d48fde795 Fix RequestPredicate.route() implementation
Issue: SPR-14954
2017-02-16 23:34:28 +01:00
Sebastien Deleuze
305f303d46 Rename RouterDsl to Routes 2017-02-16 17:23:06 +01:00
Sebastien Deleuze
03f34e24ca Add nested route support to Kotlin DSL
Issue: SPR-14954
2017-02-16 17:22:55 +01:00
Juergen Hoeller
0da8dee289 Polishing 2017-02-16 16:24:13 +01:00
Juergen Hoeller
8d707eb530 Polishing 2017-02-16 15:37:31 +01:00
Juergen Hoeller
9543384d9e Avoid deprecated comparators in tests
Issue: SPR-14779
2017-02-16 15:36:27 +01:00
Juergen Hoeller
f90cd7705f Consistent ordering of Assert variants
Issue: SPR-15196
2017-02-16 15:32:07 +01:00
Arjen Poutsma
0922943c12 Rename RouterFunctions.subroute() to nest()
This commit renames the `RouterFunctions.subroute()` method to `nest()`, to
better represent what it does.

Issue: SPR-14954
2017-02-16 14:12:25 +01:00
Juergen Hoeller
22322fde26 Revised isInstanceOf/isAssignable message concatenation
Issue: SPR-15196
2017-02-16 13:13:20 +01:00
Juergen Hoeller
8c04a65eb1 Merge pull request #1329 from kmiya/patch-1
Fix typo in Javadoc
2017-02-16 12:47:56 +01:00
Kazuki Miyahara
e95391765c Fix typo in Javadoc 2017-02-16 18:22:44 +09:00