Commit Graph

14190 Commits

Author SHA1 Message Date
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
Arjen Poutsma 1d589eb639 Add pathPrefix predicate
Added the `pathPrefix` predicate that tests the start of the request
path against a given pattern.

Issue: SPR-14954
2017-02-16 10:17:04 +01:00
Rossen Stoyanchev 285ba7d391 Update WebTestClient builder 2017-02-15 20:10:47 -05:00
Andy Clement f98ea11e5e Fix string handling to avoid exceptions when doing path extraction
Issue: SPR-15259
2017-02-15 16:37:43 -08:00
Rossen Stoyanchev 51f2042e97 Refactor WebTestClient assertions
Rather than returning ExchangeActions that contains ExchangeInfo and
applies a chain of assertions, the exchange operation in WebTestClient
now has an extra step to decode the response.

The outcome of that is ExchangeResult<T>, parameterized with the
decoded body type, and containing the request and response details,
also providing access to built-inassertions via an assertThat()
instance method.

This approach lends itself better to decoding and asserting response
body types with generecis. It is also more friendly to using any
assertion library such as AssertJ since you get the result first
and then deal with assertions.
2017-02-15 18:11:51 -05:00
Juergen Hoeller 50d93d3794 Consistently support CompletionStage next to CompletableFuture
Issue: SPR-15258
2017-02-15 23:16:11 +01:00
Juergen Hoeller dbf5b1e573 Latest dependency updates (Apache HttpAsyncClient 4.1.3, SLF4J 1.7.23, BeanShell 2.0b5) 2017-02-15 18:05:57 +01:00
Juergen Hoeller 599c1ba73e Polishing 2017-02-15 18:05:38 +01:00
Juergen Hoeller 5f531a7a7d Comparators entry point with generically typed factory methods
Issue: SPR-14779
2017-02-15 18:05:32 +01:00
Juergen Hoeller 07dd61eabd Drop NativeJdbcExtractor mechanism in favor of JDBC 4 unwrap
Issue: SPR-14670
2017-02-15 18:04:08 +01:00
Juergen Hoeller 54f01cffaf Drop weaving support for pre-Servlet-3.1 servers
Issue: SPR-14467
2017-02-15 18:03:49 +01:00
Arjen Poutsma 36db6b2753 Removed json(), html() and xml() predicates
Removed `json()`, `html()` and `xml()` from `RequestPredicates`, since
they were confusingly named and would also require a counterpart that
reads the request `Content-Type` instead of the `Accept` header.
2017-02-15 11:06:08 +01:00
Sebastien Deleuze 7dd0f358ed Avoid using callable reference to stay Kotlin 1.0 compatible 2017-02-14 23:52:58 +01:00
Arjen Poutsma bb9d3e1680 Renamed RouterFunction composition methods
Renamed `RouterFunction.andSame()` to `and()`, and `and()` to
`andOther()`. The reason for this change is that we can expect most
RouterFunctions to be parameterized over ServerResponse, and thus it
makes sense to use the shortest composition method (`and()`) for
composing router functions of the same type.

When a user composes different response types, such as composing a
`RouterFunction<RenderingResponse>` with an
`RouterFunction<EntityResponse<?>`, the `andOther` method is to be used,
but this is a less common scenario.
2017-02-14 15:51:57 +01:00
Sebastien Deleuze 276f896956 Document Spring Boot support for WebFlux functional API 2017-02-14 13:29:40 +01:00
Arjen Poutsma fcaf42507a Synchronise PathPatternParser access
This commit adds a synchronized block around the PathPatternParser,
since it is not thread-safe.
2017-02-14 12:11:48 +01:00
Juergen Hoeller a3561168b0 Merge pull request #1326 from JanespenCerpus/fix-resttemplate-mockmvc-encoded-uri
SPR-15254 RestTemplate with MockMvcClientHttpRequestFactory double encodes URIs
2017-02-14 12:07:27 +01:00
Stephane Nicoll b21c0cb8e0 Merge pull request #1327 from hengyunabc:patch-1
* pr/1327:
  Update copyright header
  Fix typo
2017-02-14 10:40:21 +01:00