Commit Graph

14225 Commits

Author SHA1 Message Date
Rossen Stoyanchev
5237e47e66 Polish 2017-02-27 17:26:20 -05:00
Rossen Stoyanchev
226c9f9a73 Add WebFlux redirect integration test case
Issue: SPR-15291
2017-02-27 17:14:56 -05:00
Sebastien Deleuze
40ae8d41a4 Introduce ServerResponse Kotlin extensions
Issue: SPR-15293
2017-02-27 19:46:07 +01:00
Sebastien Deleuze
710702acdc Polish Kotlin routing DSL
- typealias to replace types like RouterDsl.() -> Unit by Routes
 - String.invoke() as path("/foo") shortcut
 - String.route() as pathPrefix("/foo").route() shortcut
 - Avoid requiring PathPredicates.* import

Issue: SPR-15292
2017-02-27 19:14:24 +01:00
Stephane Nicoll
a936ece285 Merge pull request #1340 from pistriak:patch-1
* pr/1340:
  Polishing
2017-02-25 16:50:40 +01:00
Ruslan Pistriak
8417a73913 Polishing
Closes gh-1340
2017-02-25 16:50:02 +01:00
Rossen Stoyanchev
aecdf738d3 Print session attributes in PrintingResultHandler
Issue: SPR-15189
2017-02-23 16:39:21 -05:00
Rossen Stoyanchev
24dbfc8ace Fix wrong access modifier in MockMvc standalone setup
Issue: SPR-15248
2017-02-23 16:10:47 -05:00
Juergen Hoeller
2d7742b214 Latest dependency updates (RxJava 2.0.6, HtmlUnit Driver 2.24, Selenium 3.1) 2017-02-22 16:56:24 +01:00
Juergen Hoeller
cbd19153c4 Polishing 2017-02-22 16:53:54 +01:00
Juergen Hoeller
6357c5167a Upgrade to Jackson 2.8.7 and Dependency Management Plugin 1.0.0.RELEASE 2017-02-22 15:43:52 +01:00
Juergen Hoeller
f4de1ea147 Polishing 2017-02-22 15:32:19 +01:00
Juergen Hoeller
7fb0ad37da ConfigurationClassEnhancer explicitly handles non-interceptable FactoryBeans
Issue: SPR-15275
2017-02-22 15:32:04 +01:00
Juergen Hoeller
6108ab1c31 Test for expected behavior of getAllMergedAnnotations vs findAllMergedAnnotations
Issue: SPR-15271
2017-02-22 15:28:34 +01:00
Stephane Nicoll
21ae169653 Merge pull request #1335 from stonio:patch-4
* pr/1335:
  Use String#isEmpty()
2017-02-22 11:56:24 +01:00
stonio
7d062df992 Use String#isEmpty()
Closes gh-1335
2017-02-22 11:55:17 +01:00
Sebastien Deleuze
c85f063d92 Upgrade Reactor to Aluminium-SR1 2017-02-22 01:43:11 +01:00
Juergen Hoeller
d2cc97af47 Polishing 2017-02-21 22:41:40 +01:00
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