Commit Graph

14173 Commits

Author SHA1 Message Date
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
Stephane Nicoll d4dd8baed5 Update copyright header
Closes gh-1327
2017-02-14 10:39:54 +01:00
hengyunabc 2723bd092c Fix typo
See gh-1327
2017-02-14 10:36:14 +01:00
Jan-Espen Oversand 5158207fe0 Passing the uri as a string to the MockMvc request builder will cause an encoded uri to become double encoded. 2017-02-14 09:37:49 +01:00
Rossen Stoyanchev 130598ffb2 Updates to ExchangeActions
Add assertEntity(Foo.class).map() -> Map<String, Foo>

Add assertBody().map() -> Map<String, String>

Rename andAssert(Consumer<?>) to "consume" in assertion classes

Remove andAssert + andDo from top-level ExchangeActions
2017-02-13 22:03:04 -05:00
Phillip Webb 656e7f801e Remove XmlExpectationsHelper hard XML Unit requirement
Update XmlExpectationsHelper to use an inner class for XML Unit calls
so that the XML Unit dependency remains optional.

Issue: SPR-15156
2017-02-13 16:17:21 -08:00
Sebastien Deleuze f380ab9d90 Polish RouterFunctionExtensions
Issue: SPR-15065
2017-02-13 23:08:56 +01:00
Rossen Stoyanchev e2e5e7653c Add mention of WebFlux testing support 2017-02-13 15:42:54 -05:00
Brian Clozel 4ff17676d3 Avoid duplicate Content-Length headers in Netty client
This commit checks that a "Content-Length" request header isn't already
present before adding one in `Netty4ClientHttpRequestFactory`.
`HttpMessageConverter` implementations can write that request header so
the Netty request factory should only write that value when the header
is missing.

If that header is not written (and since we're not dealing with
the HTTP exchange in a chunked-based fashion), the HTTP client might not
send the request body at all.

Issue: SPR-15241
2017-02-13 21:07:35 +01:00
Brian Clozel 28e77fa68a Assert XML without considering order in XmlExpectationsHelper
This commit changes the `assertXmlEqual` implementation to compare
expected and actual XML documents without considering the order of XML
nodes.

Issue: SPR-15156
2017-02-13 21:07:35 +01:00
Rossen Stoyanchev 6f68af6860 Uncomment test following fix in reactor-netty 2017-02-13 15:02:42 -05:00
Arjen Poutsma febed19bf4 Use PathPatternParser in function.server
Use new PathPatternParser instead of PathMatcher in
web.reactive.function.server.
2017-02-13 16:44:03 +01:00
Arjen Poutsma a31429be2b Add json, html, and xml RequestPredicates
Added RequestPredicate for JSON, HTML, and XML requests. All three tests
for their respective mime type in the Accept header, as well as checking
for a file extension.
2017-02-13 15:37:50 +01:00
Rossen Stoyanchev 896e4db411 ExchangeActions update
Put assertBodyXyz options behind a common assertBody() entry point
currently including "isEmpty" and "asMap" but in the future others
related to JSON content or XPath for example.

Now that ExchangeActions provides method to access the ExchangeInfo
it has been removed from constructors of assertion classes that
already have ExchangeActions.
2017-02-13 09:29:17 -05:00
Arjen Poutsma dff9b3b85c Expose BodyInserter in EntityResponse 2017-02-13 15:09:43 +01:00
Juergen Hoeller 44ec6e0037 Polishing 2017-02-13 15:07:07 +01:00
Juergen Hoeller 199aa776c9 Support for Servlet 4.0 (PushBuilder argument, MockServletContext)
Issue: SPR-12674
2017-02-13 15:06:59 +01:00
Juergen Hoeller d44325ec91 Defensively ignore multipart parsing failure in case of error dispatch
Issue: SPR-15231
2017-02-13 15:06:52 +01:00