Commit Graph

21370 Commits

Author SHA1 Message Date
Rossen Stoyanchev
128acaff8a WebTestClient cookie assertion support
See gh-19647
2020-08-19 21:15:20 +01:00
Rossen Stoyanchev
6e8bb6c4a9 WebTestClient header assertion improvements
Provides parity with similar options in MockMvc:
 - compare header using a long value
 - compare header using a date/time value
 - dedicated method for "Location" header (redirect)
 - let Hamcrest assert a header even when missing

See gh-19647
2020-08-19 21:14:13 +01:00
Rossen Stoyanchev
f500ab0f9b Add mechanism to expose mock server results
WebTestClient is an actual client and generally it's only possible
to assert the client response (i.e. what goes over HTTP). However,
in a mock server scenario technically we have access to the server
request and response and can make those available for further
assertions.

This will be helpful for the WebTestClient integration with MockMvc
where many more assertions can be performed on the server request
and response when needed.

See gh-19647
2020-08-19 21:14:13 +01:00
Rossen Stoyanchev
cb02b0e776 WebTestClient releases body on returnResult(Void.class)
The original behavior was to ignore the body which came with odd
warnings in the Javadoc and potential leaks that could be reported
from tests causing unnecessary concern.

This change causes the body to be released and effectively still
ignores it but minus the potential leaks.

See gh-19647
2020-08-19 21:14:13 +01:00
Rossen Stoyanchev
dd7369df48 WiretapConnector.Info is private
The claimRequest method was not intended to be public and couldn't
have been used since the Info type it returned was package private.
This change completely hides the Info.

See gh-19647
2020-08-19 21:14:13 +01:00
Rossen Stoyanchev
4116e6dd18 Pull up method to ConfiugrableMockMvcBuilder
See gh-19647
2020-08-19 21:13:17 +01:00
Rossen Stoyanchev
443e9ee618 MockMvc applies StandardMultipartHttpServletRequest wrapper
This is necessary to correctly process multipart requests and resolve
@RequestPart arguments and MultipartFile arguments.

Closes gh-25602
2020-08-19 09:06:20 +01:00
Sam Brannen
50b20c2bb7 Merge branch '5.2.x' 2020-08-17 16:01:32 +02:00
Sam Brannen
d939016a09 Polish contribution
See gh-25600
2020-08-17 15:53:45 +02:00
Maciej Miklas
a83529c844 Introduce createContext() factory method in AbstractGenericContextLoader
Prior to this commit it was possible to configure the
DefaultListableBeanFactory used by the GenericApplicationContext
created by AbstractGenericContextLoader, but it was not possible to
completely replace the bean factory.

This commit introduces a new createContext() factory method in
AbstractGenericContextLoader which indirectly allows subclasses to
supply a custom DefaultListableBeanFactory implementation to the
GenericApplicationContext.

Closes gh-25600
2020-08-17 15:38:24 +02:00
Sam Brannen
32e851617e Fix Javadoc formatting in GenericGroovyXmlContextLoader 2020-08-17 15:37:51 +02:00
Sam Brannen
1891f8af70 Merge branch '5.2.x' 2020-08-16 20:04:24 +02:00
Sam Brannen
93e5214d01 Revise Javadoc regarding log level for non-static BFPP @Bean method
Closes gh-25590
2020-08-16 20:03:46 +02:00
Rossen Stoyanchev
7758ba3c7e Refactor MonoToListenableFutureAdapter
Closes gh-25561
2020-08-14 15:18:39 +01:00
Rossen Stoyanchev
a7f71f4d9b Support filename hint for client side too
Closes gh-25516
2020-08-14 15:18:39 +01:00
York Lee
36553264ce Fix document for core-bean.adoc
This is the orginal "A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container". Here's an extra word of "otherwise".
2020-08-14 11:04:27 +01:00
Sam Brannen
13183c89ce Update tests due to deprecations in Reactor 2020-08-12 13:46:32 +02:00
Sam Brannen
4d3dd9b9f6 Clean up warnings in Gradle build 2020-08-11 17:20:27 +02:00
Sam Brannen
c558391e2c Declare interfaces as @FunctionalInterface where feasible
This commit declares each of the following public interfaces as a
@FunctionalInterface.

- org.springframework.context.ApplicationContextInitializer
- org.springframework.test.web.servlet.DispatcherServletCustomizer
- org.springframework.validation.MessageCodeFormatter
- org.springframework.util.IdGenerator
- org.springframework.beans.factory.config.YamlProcessor.MatchCallback
- org.springframework.beans.factory.config.YamlProcessor.DocumentMatcher

Closes gh-25580
2020-08-11 17:01:03 +02:00
Sam Brannen
596936f18c Polishing 2020-08-11 16:42:18 +02:00
Sam Brannen
6a2939a4d4 Suppress deprecation warnings in JmsInvokerTests 2020-08-11 12:12:01 +02:00
Sam Brannen
45491f0756 Upgrade to Gradle 6.6
Closes gh-25578
2020-08-11 12:10:35 +02:00
Sam Brannen
2c757399b2 Polish spring-jcl documentation 2020-08-11 11:58:49 +02:00
Rossen Stoyanchev
63a4873edb Upgrade to RSocket 1.1.0-M1
Closes gh-25331
2020-08-10 20:39:44 +01:00
Rossen Stoyanchev
7d41c5fa2e Upgrade to Reactor 2020.0.0-M2
Closes gh-25373
2020-08-10 18:50:18 +01:00
Juergen Hoeller
9d92fa79d3 Upgrade to AspectJ 1.9.6, RxJava 3.0.5, HtmlUnit 2.43 2020-08-10 19:05:59 +02:00
Vitalii Ananev
890f29e832 Add spring-jcl information to reference doc
Closes gh-22158
2020-08-10 16:52:45 +02:00
Sébastien Deleuze
79dfda7369 Add a comment about gradle/gradle#14017
See gh-24171
2020-08-10 16:49:00 +02:00
Sam Brannen
5de549d7d4 Update contentType property via MockHttpServletResponse::setCharacterEncoding()
Prior to this commit, MockHttpServletResponse's setCharacterEncoding()
method did not update the contentType property, which violates the
Servlet 2.4 Javadoc for getContentType() and setCharacterEncoding().

This commit addresses this issue; however, some existing tests may have
to be updated as a result of this change.

For example, note how some of the tests in this commit have been
refactored to use MediaType##isCompatibleWith() instead of asserting
exact matches for the value returned by MockHttpServletResponse's
getContentType() method.

Closes gh-25536
2020-08-10 16:05:18 +02:00
Sam Brannen
c5bb5d6c03 Polish ViewResolutionTests 2020-08-10 15:31:51 +02:00
Сергей Цыпанов
c2122551c8 Improve UriComponents.sanitizeSource() 2020-08-10 14:47:20 +02:00
Juergen Hoeller
7b6e1c957f Merge branch '5.2.x' 2020-08-10 14:44:22 +02:00
Juergen Hoeller
9bf5cba3c2 Drop outdated notes on handler type versus handler method restrictions
Closes gh-25482
2020-08-10 14:43:27 +02:00
Juergen Hoeller
7d56c303a4 Use getType with allowFactoryBeanInit=false during advisor retrieval
Closes gh-25546
2020-08-10 14:43:02 +02:00
Sam Brannen
1f35cc5cae Polish contribution
See gh-25506
2020-08-10 14:17:04 +02:00
Qimiao Chen
af8ab2e3a8 Optimize DefaultLifecycleProcessor::startBeans
Closes gh-25506
2020-08-10 14:08:14 +02:00
Sam Brannen
1dcaa04224 Fix typo in reference manual 2020-08-10 12:22:06 +02:00
diguage
2c274cf0aa Use Groovy syntax highlighting in reference manual
Closes gh-25554
2020-08-10 12:11:03 +02:00
Sam Brannen
e0d79f5dbb Merge branch '5.2.x' 2020-08-10 11:36:19 +02:00
Sam Brannen
bd65762582 Polish Javadoc for MessagePostProcessor interfaces
See gh-25571
2020-08-10 11:26:41 +02:00
Philippe Marschall
6a7e58ac82 Add @FunctionalInterface to MessagePostProcessor
Add the @FunctionalInterface annotation to the MessagePostProcessor
interfaces in the spring-jms and spring-messaging projects.

Closes gh-25571
2020-08-10 11:19:35 +02:00
Brian Clozel
88ccab8f13 Revert timeout inscreases in STOMP tests
This change is not fixing tests but rather increasing their duration, so
we're reverting this change as a result.
2020-08-08 16:39:56 +02:00
Sam Brannen
d0cf90bb8e Update tests due to deprecations in Reactor 2020-08-08 12:40:23 +02:00
Sam Brannen
01b79514da Update ReactiveTypeHandlerTests due to deprecations in Reactor 2020-08-08 12:33:26 +02:00
Sam Brannen
17acc3554c Sync MockServerHttpResponse changes 2020-08-08 12:31:50 +02:00
Sam Brannen
0b57368d5f Merge branch '5.2.x' 2020-08-08 12:23:45 +02:00
Sam Brannen
e25e690ad4 Assert preconditions for MergedAnnotations.from() factory methods
Prior to this commit, if null values were supplied for the
RepeatableContainers or AnnotationFilter arguments to `from()` factory
methods in MergedAnnotations, certain operations would eventually
result in a NullPointerException. This is to be expected; however, the
NullPointerException is often swallowed and only logged at INFO level
with an exception message similar to the following.

> Failed to introspect annotations on org.example.MyClass: NullPointerException

In such cases, the INFO log message is not helpful in diagnosing the
problem. Furthermore, since the exception is swallowed, the desired
operation (e.g., MergedAnnotations.stream(...)) simply returns no
results.

This commit improves the user experience by eagerly asserting non-null
preconditions for required arguments in MergedAnnotations.from()
factory methods.

Closes gh-25568
2020-08-08 12:21:15 +02:00
Sam Brannen
a614abe17b Polish Javadoc for MergedAnnotations 2020-08-08 11:59:24 +02:00
Brian Clozel
3c832f0ec8 Upgrade ActiveMQ and extend timeout in STOMP tests 2020-08-08 11:44:16 +02:00
Juergen Hoeller
e87a49c61c Merge branch '5.2.x' 2020-08-07 21:43:33 +02:00