Commit Graph

19930 Commits

Author SHA1 Message Date
Rossen Stoyanchev
7e07fb16d8 Split RequestMappingIntegrationTests into sub-classes 2016-07-11 18:08:11 -04:00
Rossen Stoyanchev
35f791acf8 Extract base class for RequestMappingIntegrationTests 2016-07-11 18:08:11 -04:00
Rossen Stoyanchev
6fde86903d Declare HTTP method mappings TestRestController 2016-07-11 18:07:55 -04:00
Rossen Stoyanchev
aa1397b8ba Polish method order in RequestMappingIntegrationTests 2016-07-11 18:07:46 -04:00
Sam Brannen
22345f7c25 Upgrade tests to EhCache 2.10+
Issue: SPR-13794
2016-07-11 17:17:03 +02:00
Sam Brannen
f7f37cdb1b Introduce before/after test execution callbacks in the TCF
This commit introduces 'before' and 'after' test execution callbacks in
the Spring TestContext Framework. Specifically, this set of commits
introduces the following.

- beforeTestExecution() and afterTestExecution() callbacks in the
  TestExecutionListener API

- beforeTestExecution() and afterTestExecution() callbacks in
  TestContextManager

- RunBeforeTestExecutionCallbacks and RunAfterTestExecutionCallbacks
  JUnit 4 statements that are used by the SpringJUnit4ClassRunner

- Documentation in the class-level Javadoc for SpringMethodRule stating
  that before/after test execution callbacks cannot be supported with
  JUnit 4 Rules

- Support for JUnit Jupiter's BeforeTestExecutionCallback and
  AfterTestExecutionCallback extension APIs in the SpringExtension for
  JUnit 5

- Support for before/after test execution callbacks in
  AbstractTestNGSpringContextTests for TestNG

Issue: SPR-4365
2016-07-11 15:45:35 +02:00
Sam Brannen
80018c67e7 Introduce before/after test execution support in the SpringExtension
Issue: SPR-4365
2016-07-11 15:44:51 +02:00
Sam Brannen
da89332840 Introduce before/after test execution support in SpringJUnit4ClassRunner
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Sam Brannen
3da5fbe995 Introduce before/after test execution support in AbstractTestNGSpringContextTests
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Sam Brannen
087efa668c Introduce before/after test execution callbacks in TestContextManager
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Sam Brannen
5302566cbb Introduce before/after test execution callbacks in TestExecutionListener
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Stephane Nicoll
11ed26584d Polish 2016-07-11 10:50:44 +02:00
Stephane Nicoll
15c3cdd48d Fix NoOpCache handling of get(key,callable)
This commit fixes the method that takes a Callable to actually always
invoke it rather than returning null.

Issue: SPR-14445
2016-07-11 10:34:27 +02:00
Sam Brannen
629b95bd5c Ensure TestContextManager always tracks after-class exception
This commit fixes a minor bug introduced in 0adc4921ed.

Issue: SPR-14447
2016-07-10 16:04:00 +02:00
Rossen Stoyanchev
407715b89e Helpers for get/post in RequestMappingIntegrationTests
This commit replaces the current helper methods in
RequestMappingIntegrationTests with generic helper methods to perform
HTTP GET and POST requests.

This results in more transparent code that shows the exact HTTP
inputs and outputs and is also more flexible to change for
variations in testing.
2016-07-08 12:17:36 -04:00
Sam Brannen
966d951329 Remove deprecated @TransactionConfiguration & TxCfgAttributes
Issue: SPR-14430
2016-07-08 18:16:44 +02:00
Sam Brannen
57c43f4273 Delete unused import 2016-07-08 17:40:42 +02:00
Sam Brannen
d6d4251550 Utilize default methods in TestExecutionListener
Issue: SPR-14432
2016-07-08 17:38:41 +02:00
Sam Brannen
a0cad5c48f Use streams and lambdas in spring-test where feasible
Issue: SPR-13188
2016-07-08 17:38:40 +02:00
Sam Brannen
8fff1c2ac0 Polishing 2016-07-08 17:18:14 +02:00
Sam Brannen
80216c243d Annotate ContextCustomizer[Factory] with @FunctionalInterface
Issue: SPR-14432
2016-07-08 17:17:25 +02:00
Juergen Hoeller
e8b5374d87 Require EhCache 2.10+
Issue: SPR-13794
2016-07-08 16:28:24 +02:00
Rossen Stoyanchev
d84b989025 Update notes on deps for broker relay 2016-07-08 09:20:49 -04:00
Juergen Hoeller
c43e7497c1 Fixed typo: "occured"->"occurred" 2016-07-08 15:12:16 +02:00
Juergen Hoeller
23c2b6ad41 Added PathEditor for NIO file system resolution
Issue: SPR-14436
2016-07-08 14:58:38 +02:00
Brian Clozel
99697118d8 Add RxJava1 support for request building/extracting
This commit adds the required infrastructure to build HTTP requests as
well as extracting relevant information from HTTP responses using the
RxJava 1.x API, where Observable and Single don't extend Publisher.
2016-07-08 14:22:48 +02:00
Brian Clozel
4892436efe Refactor HTTP client contracts
This commit refactors the `ClientHttpRequestFactory` into an
`ClientHttpConnector` abstraction, in order to reflect that
`ClientHttpRequest`s only "exist" once the client is connected
to the origin server.

This is why the HTTP client is now callback-based, containing all
interactions with the request within a
`Function<ClientHttpRequest,Mono<Void>>` that signals when it's done
writing to the request.

The `ClientHttpRequest` contract also adopts `setComplete()`
and promotes that method to the `ReactiveHttpOutputMessage` contract.

This commit also adapts all other APIs to that change and fixes a few
issues, including:

* use `HttpMessageConverter`s instead of `Encoders`/`Decoders`
* better handle type information about request content publishers
* support client cookies in HTTP requests
* temporarily remove the RxNetty client support
2016-07-08 14:20:07 +02:00
Sam Brannen
40b2d26bd4 Avoid reflection for @Repeatable look-ups
Issue: SPR-13188
2016-07-08 13:21:31 +02:00
Juergen Hoeller
61db8e9f1e DigestUtils processes InputStream with buffered read instead of full copy
Issue: SPR-14427
2016-07-08 12:20:49 +02:00
Brian Clozel
b5bce1f017 Update after reactor.core.converter.Converters changes
Reactor's `DependencyUtils` has been renamed to `Converters` and
all the `from` converter methods have been disambiguated to
`fromPublisher`, `toPublisher`.
2016-07-08 12:00:06 +02:00
Stephane Nicoll
2bf9bc312e Remove Guava cache support
This commit removes `GuavaCache` and support classes. Caffeine supersedes
the caching support in the Google Guava library with an actively maintained
Java 8+ version in standalone form.

As it is the only Guava feature Spring framework integrates with, this
commit removes effectively any reference to Guava.

Issue: SPR-13797
2016-07-08 10:57:05 +02:00
Arjen Poutsma
799bb64275 Merge pull request #135 from violetagg/ondataavailable-concurrency
Refactor AbstractRequestBodyPublisher states
2016-07-08 09:45:05 +02:00
Violeta Georgieva
d68232c880 Refactor AbstractRequestBodyPublisher states
The state machine is refactored in order to solve various concurrency
issues.
2016-07-08 09:31:51 +03:00
Rossen Stoyanchev
d7a43d2003 Polish tests 2016-07-07 23:04:27 -04:00
Rossen Stoyanchev
7534092ef3 Comprensive support for empty request body
This commit adds support for handling an empty request body with both
HttpEntity where the body is not required and with @RequestBody where
the body is required depending on the annotation's required flag.

If the body is an explicit type (e.g. String, HttpEntity<String>) and
the body is required an exception is raised before the method is even
invoked or otherwise the body is passed in as null.

If the body is declared as an async type (e.g. Mono<String>,
HttpEntity<Mono<String>>) and is required, the error will flow through
the async type. If not required, the async type will be passed with no
values (i.e. empty).

A notable exception is rx.Single which can only have one value or one
error and cannot be empty. As a result currently the use of rx.Single
to represent the request body in any form effectively implies the body
is required.
2016-07-07 15:58:06 -04:00
Rossen Stoyanchev
a584311178 Fix StringDecoder#decodeToMono issue with empty input
Before this change decodeToMono always created a StringBuilder to
aggregate resulting in an "" (empty string) rather than an empty
Mono for an empty input stream.

Now we aggregate in the DataBuffer instead and then decode to String.
2016-07-07 15:58:06 -04:00
Rossen Stoyanchev
1e1e2f8b1b Support HttpEntity method arguments
The RequestBodyArgumentResolver has been refactored to have a shared
base class and tests with the new HttpEntityMethodArgumentResolver.

An HttpEntity argument is not expected to have an async wrapper because
the request headers are available immediately. The body however can be
asynchronous, e.g. HttpEntity<Flux<String>>.
2016-07-07 15:58:06 -04:00
Brian Clozel
4c3c54463c Upgrade build to Spring 5.0.0-BUILD-SNAPSHOT
* update bean validation API version
* MethodParameter now validates indices, see 39e3f2ebf6
* `getCharSet()` is now `getCharset()`
2016-07-07 18:11:04 +02:00
Sam Brannen
7e783dd91f Delete temporary MethodParameterFactory solution
SPR-14055 introduced first-class support for the Java 8 Parameter API.

This commit therefore replaces the MethodParameterFactory with use of
the new SynthesizingMethodParameter.forParameter(Parameter) factory
method.

Issue: SPR-13575
2016-07-07 13:02:49 +02:00
Sam Brannen
862fb2af5f Upgrade to JUnit 5.0.0-M1
Issue: SPR-13575
2016-07-07 12:49:46 +02:00
Stephane Nicoll
0f589fc49c Merge pull request #1100 from nkjackzhang:patch-1
* pr/1100:
  Remove trailing whitespaces
  Add the injection point for the Provider
2016-07-07 10:35:27 +02:00
Stephane Nicoll
1103a9cd16 Remove trailing whitespaces
Closes gh-1100
2016-07-07 10:34:50 +02:00
nkjackzhang
6aeaa1976d Add the injection point for the Provider
See gh-1100
2016-07-07 10:31:49 +02:00
Juergen Hoeller
6aa5931e28 Polishing 2016-07-07 01:05:25 +02:00
Juergen Hoeller
a1f5fb53db Java 8 getParameterCount() instead of getParameterTypes().length
Issue: SPR-13188
2016-07-07 01:04:24 +02:00
Juergen Hoeller
39e3f2ebf6 MethodParameter supports Java 8 Executable/Parameter and validates parameter indexes
Also, equals insists on the same class now, differentiating from SynthesizingMethodParameter.

Issue: SPR-14055
Issue: SPR-13456
Issue: SPR-14438
2016-07-07 00:37:52 +02:00
Rossen Stoyanchev
9cc01fc185 Add @RequestBody tests 2016-07-06 14:10:51 -04:00
Rossen Stoyanchev
54bfbbc607 Rename decodeOne->decodeToMono and readOne->readMono 2016-07-06 12:38:05 -04:00
Juergen Hoeller
da9c24c41e Polishing 2016-07-06 18:11:33 +02:00
Rossen Stoyanchev
6525504e17 Restore local vars in JacksonJsonEncoder 2016-07-06 09:35:25 -04:00