This commit improves the FreeMarker macro support in spring-webflux by
automatically exposing a RequestContext under the name
"springMacroRequestContext" for use with Spring's FreeMarker macros in
spring.ftl.
This aligns with the user experience for FreeMarkerView in spring-webmvc.
Closes gh-23105
This commit migrates to the MockitoJUnitRunner where sensible, which
will later allow for an easier migration to Mockito's extension for
JUnit Jupiter.
In addition, this commit deletes unnecessary stubbing for various mocks
and polishes test fixture setup in various test classes.
ViewResolutionResultHandler no longer adds BindingResult objects for
async model attributes. Instead AbstractView adds them later when
those attributes are resolved to concrete values.
Closes gh-22933
Organize test imports to expand all '.*' static imports into
fully qualified imports.
This update will allow us to use additional checkstyle rules in
the future, and will also help if we migrate fully to AssertJ.
* Add limited checkstyles to test code
Add a limited set of checkstyle rules to the test codebase to improve
code consistency.
* Fix checksyle violations in test code
* Organize imports to fix checkstyle for test code
* Migrate to assertThatExceptionOfType
Migrate aware from ExpectedException rules to AssertJ exception
assertions. Also include a checkstyle rules to ensure that the
the ExpectedException is not accidentally used in the future.
See gh-22894
DefaultMultipartMessageReader does not cache the part contents, so
binding to the same part multiple times does not work.
Rewrote this test to use separate HTTP request instead.
Normally consumes matches the "Content-Type" header but what should be done if
there is no content? This commit adds checks for method parameters with
@RequestBody(required=false) and if "false" then also match requests with no content.
Closes gh-22010
ServerRequest:
- awaitPrincipalOrNull is renamed to awaitPrincipal since
there is no non-nullable variant
ServerResponse:
- new BodyBuilder.sse() extension
- BodyBuilder.bodyToServerSentEvents is deprecated in favor
of sse().body()
- BodyBuilder.bodyAndAwait(flow: Flow<T>) is renamed to
bodyFlowAndAwait to avoid shadowing of
BodyBuilder.bodyAndAwait(body: Any)
- BodyBuilder.bodyToServerSentEventsAndAwait is removed,
sse().bodyAndAwait() should be used instead
Closes gh-22899