Commit Graph

22968 Commits

Author SHA1 Message Date
Stephane Nicoll 8670b1c3f0 Merge pull request #27238 from izeye
* pr/27238:
  Polish printMvcResultsToWriterWithFailingGlobalResultMatcher()

Closes gh-27238
2021-08-04 08:29:33 +02:00
izeye 86ef0236e6 Polish printMvcResultsToWriterWithFailingGlobalResultMatcher()
See gh-27238
2021-08-04 08:29:26 +02:00
Sam Brannen ce94f69e52 Polish contribution
See gh-27234
2021-07-31 16:30:39 +02:00
Anton Lyxell 01c8de0111
Simplify getInternalBeanFactoryForBean
This commit simplifies getInternalBeanFactoryForBean() in
AbstractBeanFactoryBasedTargetSourceCreator via
Map::computeIfAbsent.

Closes gh-27234
2021-07-31 16:27:43 +02:00
Sam Brannen bd1f5bd9fc Support Charset for character encoding in MockMvc
To improve the developer experience and avoid the use of String
literals, this commit provides overloaded support via Charset for
character encoding in MockHttpServletRequestBuilder and
ContentResultMatchers.

Closes gh-27231
2021-07-30 15:24:47 +02:00
Sam Brannen 4d115eef91 Polishing 2021-07-30 15:20:44 +02:00
Sam Brannen 0f421f9f86 Support default character encoding for response in MockMvc
Commit e4b9b1fadb introduced support for setting the default character
encoding in MockHttpServletResponse.

This commit introduces support for configuring the default character
encoding in the underlying MockHttpServletResponse used in MockMvc.

Closes gh-27230
2021-07-30 14:42:45 +02:00
Sam Brannen 41fa199178 Polish PrintingResultHandler 2021-07-29 19:43:54 +02:00
Sam Brannen 881fa889fc Apply global ResultHandlers before ResultMatchers in MockMvc
Prior to this commit, MockMvc applied global ResultMatchers before
global ResultHandlers. This lead to unexpected scenarios where a
failing matcher would prevent a handler from being applied.

One concrete use case is `alwaysDo(print(System.err))` which should
print out MockMvc results for debugging purposes. However, if MockMvc is
configured with something like `alwaysExpect(content().string("?"))`
and the expectation fails, the user will never see the expected debug
output to help diagnose the problem.

This commit addresses this issue by applying global ResultHandlers
before ResultMatchers in MockMvc.

Closes gh-27225
2021-07-29 19:18:18 +02:00
Sam Brannen e4b9b1fadb Introduce setDefaultCharacterEncoding() in MockHttpServletResponse
Prior to this commit, it was possible to set the character encoding
in MockHttpServletResponse via setCharacterEncoding() or
setContentType(); however, those methods append "charset=..." to the
Content-Type header which may not be an acceptable side effect.

This commit addresses this shortcoming by introducing a new
setDefaultCharacterEncoding() in MockHttpServletResponse which allows
one to override the previously hard coded value of "ISO-8859-1". In
addition, setDefaultCharacterEncoding() does not modify the Content-Type
header.

The reset() method has also been updated to reset the character encoding
to the configured default character encoding.

Closes gh-27214
2021-07-29 16:02:58 +02:00
Rossen Stoyanchev 55e17ef306 Polishing contribution
Closes gh-27203
2021-07-29 14:49:02 +01:00
Yanming Zhou f2be4e9320 Use MessageSource for @ExceptionHandler methods
Follow-up for commit bb816c123c

See gh-27203
2021-07-29 14:49:02 +01:00
Sam Brannen 5b3f11c543 Add @Nullable to setLocale in MockHttpServletResponse
See gh-26493
2021-07-29 14:47:31 +02:00
Sam Brannen 96ee8a3bc7 Ensure characterEncoding in MockHttpServletResponse is non-null
Closes gh-27219
2021-07-29 14:40:01 +02:00
Sam Brannen 915f1027a5 Update copyright date
See gh-27223
2021-07-29 11:04:59 +02:00
Mateusz Swiatkowski f1b35f1593
Fix reference to Optional.isPresent() in ObjectUtils.isEmpty()
Closes gh-27223
2021-07-29 11:03:26 +02:00
DongHyuk c2f91765b4
Fix typo in Javadoc in AbstractHandlerMapping
Closes gh-27218
2021-07-28 15:19:59 +02:00
Sam Brannen 403e04c0b4 Polish MockHttpServletResponse 2021-07-28 11:27:56 +02:00
Rossen Stoyanchev 6c68419073 Polishing contribution
Closes gh-27216
2021-07-27 17:41:30 +01:00
Moncef AOUDIA a747cc3e91 Fix error message in SynchronossPartHttpMessageReader 2021-07-27 17:25:30 +01:00
Sam Brannen 161c9dc3bd Improve @Cacheable documentation regarding java.util.Optional
This commit improves the documentation for @Cacheable to point out that
`null` will be stored in the cache for an empty `Optional` return value.

Closes gh-27184
2021-07-27 15:05:43 +02:00
Sam Brannen 42edef0bcc Avoid StringIndexOutOfBoundsException in WebSocketMessageBrokerStats
Prior to this commit, if the TaskExecutor configured in
WebSocketMessageBrokerStats for the inboundChannelExecutor or
outboundChannelExecutor was not a ThreadPoolTaskExecutor, a
StringIndexOutOfBoundsException was thrown when attempting to parse the
results of invoking toString() on the executor.

The reason is that ThreadPoolTaskExecutor delegates to a
ThreadPoolExecutor whose toString() implementation generates text
containing "pool size = ...", and WebSocketMessageBrokerStats'
getExecutorStatsInfo() method relied on the presence of "pool" in the
text returned from toString().

This commit fixes this bug by ensuring that the text returned from
toString() contains "pool" before parsing the text. If "pool" is not
present in the text, getExecutorStatsInfo() now returns "unknown"
instead of throwing a StringIndexOutOfBoundsException.

Closes gh-27209
2021-07-25 19:05:02 +02:00
Sam Brannen e94811f1b9 Polish WebSocketMessageBrokerConfigurationSupportTests 2021-07-24 21:45:31 +03:00
Rossen Stoyanchev d034a1f26d Blockhound rule for MediaTypeFactory static initializer
Closes gh-26631
2021-07-23 17:01:28 +01:00
Rossen Stoyanchev 460947651a Minor refactoring in DefaultPathContainer
Closes gh-27204
2021-07-23 16:53:54 +01:00
Juergen Hoeller af67764edb Upgrade to Netty 4.1.66 and Undertow 2.2.9 2021-07-23 12:20:10 +02:00
Juergen Hoeller ba08006d52 ObjectMapper.configure(MapperFeature, boolean) is deprecated as of Jackson 2.13
Closes gh-27206
2021-07-23 12:19:35 +02:00
Juergen Hoeller 2594f4e058 Avoid unnecessary cause initialization in ResponseStatusException
Closes gh-27196
2021-07-23 12:18:15 +02:00
Sam Brannen 9c0825629b Reintroduce left-hand side navigation in ref docs
A side effect of 71995a9087 caused the
dynamic table of contents in the left-hand side navigation to no longer
be displayed, likely due to the missing "details" DIV.

This commit addresses this issue by applying the custom header only to
index.adoc.

Consequently, the TOC is now displayed again on all pages except the
index page, but the customized header is no longer applied to those
pages.

We may revisit this issue if we decide that we want the custom header
on all pages (and not just the index page).

Closes gh-27177
2021-07-17 17:53:43 +03:00
Sam Brannen e0c0e7f878 Fix typo in ref docs 2021-07-17 17:03:51 +03:00
Rossen Stoyanchev 0b1d14cdd9 Follow-up fix, checking also "ws" and port 80 case
See gh-27097
2021-07-16 09:34:12 +01:00
Spring Buildmaster ca262eaa1c Next development version (v5.3.10-SNAPSHOT) 2021-07-14 06:48:14 +00:00
Rossen Stoyanchev bb816c123c Use MessageSource in HandlerMethod for error reason
Closes gh-27156
2021-07-13 19:38:58 +01:00
Juergen Hoeller 33f3aa9b8a Upgrade to AspectJ 1.9.7 and EclipseLink 2.7.9 2021-07-13 18:29:34 +02:00
Rossen Stoyanchev e1f51cbce7 Check both https and wss in forwarded header checks
Closes gh-27097
2021-07-13 16:32:12 +01:00
Stephane Nicoll 6ec7cffc93 Upgrade to Kotlin 1.5.21
Closes gh-27110
2021-07-13 14:55:25 +02:00
Stephane Nicoll 4bc6f40ce8 Upgrade to Reactor 2020.0.9
Closes gh-27158
2021-07-13 14:29:59 +02:00
Arjen Poutsma bf2790498b Document ResourceBundle limitations
This commit adds a note to the documentation saying that ResourceBundle
does not support multiple bundles with the same base name.

Closes gh-27038
2021-07-13 13:45:03 +02:00
Rossen Stoyanchev 95d7f883ae Deprecate LastModified
See gh-27075
2021-07-13 12:11:20 +01:00
Rossen Stoyanchev 25131ebf6f Resource handler initialized only once
Closes gh-27153
2021-07-13 11:44:06 +01:00
Rossen Stoyanchev 0267b00a65 Minor update to Javadoc for HandlerInterceptor#postHandle
Closes gh-27122
2021-07-13 08:44:54 +01:00
Stephane Nicoll c6e644e5c3 Polish "Downcast to InetSocketAddress for Jetty 10"
This commit uses the target type where getRemoteAddress and
getLocalAddress are defined.

See gh-27120
2021-07-13 09:38:37 +02:00
Juergen Hoeller 62e916534f Introduce remaining policy setters from ScheduledThreadPoolExecutor
Closes gh-26719
2021-07-13 09:27:48 +02:00
Juergen Hoeller e1c0f3b067 CommonsMultipartResolver supports configurable HTTP methods
Closes gh-27161
2021-07-12 23:19:08 +02:00
Juergen Hoeller 1ff8da3635 StandardServletMultipartResolver provides strict Servlet compliance option
Closes gh-26826
2021-07-12 23:18:54 +02:00
Juergen Hoeller ed27ea7aa0 Restrict fallback multipart binding to POST requests with multipart/form-data
Closes gh-26999
See gh-26826
2021-07-12 17:55:49 +02:00
Juergen Hoeller 128689e79b Use entrySet iterator in getBodyFromServletRequestParameters
Closes gh-27081
2021-07-12 17:43:19 +02:00
Juergen Hoeller 475396b516 Exclude sealed interfaces from auto-proxying (for JDK 17 compatibility)
Closes gh-27027
2021-07-12 17:42:15 +02:00
Sviatoslav Hryb f3f0bd22c5 Fix content negotiation description 2021-07-12 15:23:35 +01:00
Rossen Stoyanchev 6d01d49b76 Downcast to InetSocketAddress for Jetty 10
Closes gh-27120
2021-07-12 15:04:14 +01:00