Commit Graph

13259 Commits

Author SHA1 Message Date
Juergen Hoeller 899ebd8ee2 Avoid collection lookups in StompCommand
Issue: SPR-14636
2016-08-29 11:54:21 +02:00
Juergen Hoeller 728a548199 Consistent use of JDK 7 AssertionError with root cause
Issue: SPR-13188
2016-08-29 11:53:00 +02:00
Sam Brannen 655097a343 Merge pull request #1144 from ttddyy/SPR-14614
* ttddyy-SPR-14614:
  Revise @DisabledIf support for JUnit Jupiter
  Introduce @DisabledIf annotation for JUnit 5
2016-08-28 21:16:59 +02:00
Sam Brannen 19369094ac Revise @DisabledIf support for JUnit Jupiter
- Extracted stand-alone DisabledIfCondition from the SpringExtension
  so that the condition is only evaluated when necessary.

- Simplified implementation of DisabledIfCondition.

- Overhauled and extended logging in DisabledIfCondition.

- DisabledIfCondition now throws an IllegalStateException if @DisabledIf
  is not present on the test element or if the expression does not
  evaluate to a String or Boolean.

- Each generated ConditionEvaluationResult now includes the actual
  expression in the default reason.

- @DisabledIf is now auto-configured to be evaluated by the
  DisabledIfCondition since it is now meta-annotated with
  @ExtendWith(DisabledIfCondition.class)

- Overhauled documentation for @DisabledIf and provided standard
  examples as well as an @DisabledOnMac annotation to demonstrate
  support for custom composed annotations.

Issue: SPR-14614
2016-08-28 21:12:38 +02:00
Tadaya Tsuyukubo c03f6c6d85 Introduce @DisabledIf annotation for JUnit 5
This commit introduces @DisabledIf annotation that takes SpEL as a
condition.  The condition is evaluated at run time whether to disable
JUnit 5 (Jupiter) test method/class.

Issue: SPR-14614
2016-08-28 21:12:38 +02:00
Stephane Nicoll eb193aea5f IDEA -> IntelliJ IDEA 2016-08-28 17:49:58 +02:00
Juergen Hoeller 57cb7c7e0a LiveBeansView exposes aliases as well
Issue: SPR-14632
2016-08-26 20:04:23 +02:00
Juergen Hoeller dfdfd72a3e Polishing
(cherry picked from commit 430180a)
2016-08-26 18:59:40 +02:00
Brian Clozel b84fefc430 Wrap RestTemplate extractor exceptions in RestClientExceptions
When using a `RestTemplate` instance within a Spring MVC application,
client exceptions may propagate in the MVC stack and can be wrongly
mapped by server `ExceptionHandlers`, leading to a wrong HTTP response
sent to the MVC client.

The `RestTemplate` instance uses `HttpMessageConverter` to decode
the remote service responses; and when those fail decoding an HTTP
response, they can throw an `HttpMessageNotReadableException`. That
exception then bubbles up through the `HttpMessageConverterExtractor`,
`RestTemplate` and the whole MVC stack, later mapped to HTTP 400
responses, since those exceptions can also be throws by the server stack
when the incoming requests can't be deserialized.

This commit wraps all `IOException` and `HttpMessageNotReadableException`
instances thrown by the extractor into `RestClientException`` instances.
It's now easier to consistently handle client exceptions and avoid such
edge cases.

Issue: SPR-13592
2016-08-26 17:56:00 +02:00
Rossen Stoyanchev 7fdb892042 Support target type in JsonPath assertions
This change adds support for a target type in JsonPath assertions in
Spring MVC Test.

The existing assertValue(String expression, Object expectedValue)
transparently falls back on using an alternative JsonPath API that
allows specifying the target type to coerce to.

There is also a new overloaded method
assertValue(String expression, Matcher<T> matcher, Class<T> targetType)
for use with Hamcrest matchers where the target type can be specified.

Issue: SPR-14498
2016-08-26 10:38:03 -04:00
Brian Clozel d8fc13f6fc Fix server errors for invalid If-None-Match request headers
HttpEntityMethodProcessor should not throw IllegalArgumentExceptions for
invalid If-None-Match headers.

For those cases, this commit makes sure that both
`HttpEntityMethodProcessor` and `ServletWebRequest` have a consistent
behavior and stop processing the request as conditional and leave the
handler handle it.

Issue: SPR-14559
2016-08-26 15:48:47 +02:00
Sam Brannen 5998a297ce Simplify exception handling in JsonPathExpectationsHelper 2016-08-26 14:43:40 +02:00
Juergen Hoeller 2e4a7480fc Consistent use of JDK 7 StandardCharsets over Charset.forName
Issue: SPR-14492
2016-08-26 14:16:19 +02:00
Brian Clozel 50040e6139 Revert "Consistently use annotation attributes in refdoc"
This reverts commit bbd5993945.
2016-08-26 13:57:18 +02:00
Juergen Hoeller 14046575b0 Polishing 2016-08-26 13:27:33 +02:00
Juergen Hoeller a8f7f75f64 Moved encodeHttpHeaderFieldParam method to HttpHeaders itself (including tests)
This commit also sets the test source encoding to UTF-8.

Issue: SPR-14547
2016-08-26 11:14:02 +02:00
Brian Clozel bbd5993945 Consistently use annotation attributes in refdoc 2016-08-26 09:38:19 +02:00
Brian Clozel f93cb2f539 Support ordered interceptors in RestTemplate
This commit sorts `ClientHttpRequestInterceptor`s when those are set in
`InterceptingHttpAccessor` (which `RestTemplate` extends from).

Interceptors can now be annotated with `@Order` or implements `Ordered`
to reflect their order of execution for each request.

Issue: SPR-13971
2016-08-25 17:14:09 +02:00
Arjen Poutsma ab7107c4c5 Added Host property to HttpHeaders
Added getHost/setHost to HttpHeaders, returning/taking a
InetSocketAddress.
2016-08-25 15:49:07 +02:00
Brian Clozel f2faf84f31 Add RFC5987 support for HTTP header field params
This commit adds support for HTTP header field parameters encoding, as
described in RFC5987.
Note that the default implementation still relies on US-ASCII encoding,
as the latest rfc7230 Section 3.2.4 says that:

> Newly defined header fields SHOULD limit their field values to
  US-ASCII octets

Issue: SPR-14547
2016-08-25 14:26:58 +02:00
Juergen Hoeller 41f7680e20 Polishing 2016-08-25 00:20:18 +02:00
Juergen Hoeller c4fcdb6864 DefaultListableBeanFactory does not trigger early candidate creation ahead of primary bean selection
Issue: SPR-14611
2016-08-24 22:56:47 +02:00
Juergen Hoeller 405e74b6ae GenericApplicationContext picks up ClassLoader from custom ResourceLoader
Issue: SPR-14626
2016-08-24 21:23:57 +02:00
Juergen Hoeller f3f691cc37 Revised assertions in StompHeaderAccessor
Issue: SPR-14625
2016-08-24 21:04:01 +02:00
Juergen Hoeller 56b197bce1 Avoid unnecessary String concatenation in StompSubProtocolHandler
Issue: SPR-14624
2016-08-24 20:12:01 +02:00
Juergen Hoeller bbc85ea466 Refined exception message
Issue: SPR-14609
(cherry picked from commit ab68673)
2016-08-24 15:08:12 +02:00
Juergen Hoeller 951ac5ea4f TransactionAspectSupport stores given PlatformTransactionManager instance as strong reference
Issue: SPR-14609
2016-08-24 14:31:02 +02:00
Juergen Hoeller 3d297b10e9 NamedBeanHolder enforces bean name
Issue: SPR-7549
2016-08-24 14:29:45 +02:00
Juergen Hoeller d9d84ff388 Polishing 2016-08-24 11:40:24 +02:00
Juergen Hoeller d047174c6b Unit test for empty Access-Control-Request-Headers (Chrome 52)
Includes optimized method/header resolution in CorsConfiguration.

Issue: SPR-14617
2016-08-24 11:40:18 +02:00
Brian Clozel e4575330c3 Support empty body in Jackson2JsonDecoder.decodeToMono
Prior to this commit, extracting an HTTP response with an empty body
and no Content-Type header using the WebClient would:

* trigger the use of the Jackson2JsonDecoder
* throw a NoSuchElementException because of the use of `Flux.single()`

This commit changes this behavior to `Flux.singleOrEmpty()` to avoid
throwing exceptions for empty Flux instances.

Issue: SPR-14582
2016-08-23 16:10:41 +02:00
Juergen Hoeller 93d2287894 UnsatisfiedDependencyException avoids duplicate nested exception message
Issue: SPR-14607
2016-08-23 13:21:40 +02:00
Juergen Hoeller c4fff6db1b Reintroduced MessageMethodArgumentResolver default constructor
Issue: SPR-14616
2016-08-23 13:20:02 +02:00
Erik Olsson 64bc0ca744 Add ClientOptions support in ReactorClientHttpConnector
Default ClientOptions enable SSL support.

Issue: SPR-14593
2016-08-23 11:17:12 +02:00
Brian Clozel e05a13841f Upgrade to latest reactor/reactor-netty snapshots
* reactor-core 3.0.1.BUILD-SNAPSHOT
* reactor-netty 0.6.0.BUILD-SNAPSHOT
2016-08-22 19:14:49 +02:00
Sam Brannen 9629afbcfd Restore JUnit XML reports location for TestNG tests
This commit ensures that JUnit XML reports are generated in the old
Gradle 2.x location for all tests in the spring-test module.

Issue: SPR-14569
2016-08-22 16:30:14 +02:00
Stephane Nicoll e6353f0ec7 Fix JUnit reports location
Issue: SPR-14569
2016-08-22 14:50:18 +02:00
Stephane Nicoll c64cdcc47f Restore JUnit reports location
Since the upgrade to Gradle 3, our Bamboo build is failing because it
can't find test reports "at the usual location".

This commit restores the location that Gradle 2 was using until we
upgrade to a version of Bamboo that supports it.

Issue: SPR-14569
2016-08-22 14:10:12 +02:00
Rob Winch d48c32e7f6 Fix reactor-core 3.0.0.RELEASE
Fix the build to work with reactor-core-3.0.0.RELEASE
2016-08-19 12:56:36 -05:00
Rob Winch 3d68806ca1 Consistent reactor-core versions
Previously the IDE (STS) was resolving a different reactor-core
version (3.0.0.BUILD-SNAPSHOT) than the build (3.0.0.RELEASE). This
discrepancy was due to the fact that reactor-netty now brings in
reactor-core 3.0.0.RELEASE. Gradle's version conflict resolution is to use
the latest version. However, the optional dependency on reactor-core
3.0.0.BUILD-SNAPSHOT was making the build path of the IDE use the SNAPSHOT.

This fix leverages a resolutionStrategy to ensure a consistent version of
reactor-core is used throughout the entire project. It also bumps up the
reactor-core version to 3.0.0.RELEASE to be consistent with reactor-netty.
Care is taken to only change 3.x vesion since 2.x is still used within
the codebase.
2016-08-19 12:56:29 -05:00
Stephane Nicoll b183934ed4 Remove reference to PayloadApplicationEvent
Issue: SPR-14594
2016-08-19 14:22:21 +02:00
Stephane Nicoll 74511181de Document support for `@ManagedBean`
Issue: SPR-14600
2016-08-19 13:52:39 +02:00
Juergen Hoeller 7bb4ab6842 Various @since tags (and varargs on setInterceptors)
(cherry picked from commit 5222489)
2016-08-18 12:58:02 +02:00
Juergen Hoeller 5ee65cd4b1 Updated to JPA 2.1 requirement 2016-08-18 10:17:01 +02:00
Juergen Hoeller 453822817f Protected visibility for configurePathMatch and configureAsyncSupport
Issue: SPR-14599
2016-08-18 10:15:48 +02:00
Juergen Hoeller d2e3a1a4f5 DelegatingWebMvcConfiguration properly delegates extendHandlerExceptionResolvers
Issue: SPR-14599
2016-08-18 09:05:47 +02:00
Juergen Hoeller 53819c472f Updated note on CompilationCustomizer and CompilerConfiguration
Issue: SPR-14585
(cherry picked from commit da56758)
2016-08-17 22:33:21 +02:00
Juergen Hoeller f1ab37cd01 Renamed setDefaultPersistenceUnitRootLocation to setPersistenceUnitRootLocation 2016-08-17 22:12:47 +02:00
Juergen Hoeller b4db161880 Latest dependency updates (Caffeine 2.3.2, RxJava 1.1.9, Jetty 9.4.0.M1) 2016-08-17 22:11:55 +02:00
Juergen Hoeller cf9b4d1e0b Removed duplicate NoHandlerFoundException entry
Issue: SPR-14598
(cherry picked from commit 188e532)
2016-08-17 21:54:40 +02:00