Commit Graph

1118 Commits

Author SHA1 Message Date
Rossen Stoyanchev b75674f5e9 Polish method order 2019-08-20 10:27:05 +03:00
Rossen Stoyanchev 008687d5ae Rename body(Object) to bodyValue
The recently added body(Object) variant can be confused easily with
body(Publisher, Class) forgetting to provide the element type and
only running into the IllegalArgumentException at runtime.

See gh-23212
2019-08-20 10:27:05 +03:00
Rossen Stoyanchev 5cfe491602 Polish AbstractWebSocketIntegrationTests 2019-08-20 03:03:58 +03:00
Sebastien Deleuze 4d10249b70 Update to Coroutine 1.3.0-RC2
This updates brings full interoperability between Reactor and
Coroutines contexts.

Closes gh-22986
2019-08-19 10:03:01 +02:00
Sam Brannen 31cde12540 Fix off-by-one error in AbstractWebSocketIntegrationTests.arguments()
Prior to this commit, the "reactive matrix" contained a duplicate
argument set per parameterized client.
2019-08-17 14:47:25 +02:00
Sam Brannen 979508a7f3 Remove JUnit 4 dependency from all modules except spring-test
This commit removes the JUnit 4 dependency from all modules except
spring-test which provides explicit JUnit 4 support.

This commit also includes the following.

- migration from JUnit 4 assertions to JUnit Jupiter assertions in all
  Kotlin tests
- migration from JUnit 4 assumptions in Spring's TestGroup support to
  JUnit Jupiter assumptions, based on org.opentest4j.TestAbortedException
- introduction of a new TestGroups utility class than can be used from
  existing JUnit 4 tests in the spring-test module in order to perform
  assumptions using JUnit 4's Assume class

See gh-23451
2019-08-17 11:37:21 +02:00
Sam Brannen 3f3e41923f Migrate rest of test suite from JUnit 4 to JUnit Jupiter
This commit migrates the rest of Spring's test suite to JUnit Jupiter,
except spring-test which will be migrated in a separate commit.

See gh-23451
2019-08-17 11:36:58 +02:00
Sam Brannen 3df85c783f Migrate parameterized tests in spring-core
This commit migrates parameterized tests in spring-core using the
"composed @ParameterizedTest" approach. This approach is reused in
follow-up commits for the migration of the remaining modules.

For a concrete example, see AbstractDataBufferAllocatingTests and its
subclasses (e.g., DataBufferTests).

Specifically, AbstractDataBufferAllocatingTests declares a custom
@ParameterizedDataBufferAllocatingTest annotation that is
meta-annotated with @ParameterizedTest and
@MethodSource("org.springframework.core.io.buffer.AbstractDataBufferAllocatingTests#dataBufferFactories()").

Individual methods in concrete subclasses are then annotated with
@ParameterizedDataBufferAllocatingTest instead of @ParameterizedTest or
@Test.

The approach makes the migration from JUnit 4 to JUnit Jupiter rather
straightforward; however, there is one major downside. The arguments
for a @ParameterizedTest test method can only be accessed by the test
method itself. It is not possible to access them in an @BeforeEach
method (see https://github.com/junit-team/junit5/issues/944).
Consequently, we are forced to declare the parameters in each such
method and delegate to a custom "setup" method. Although this is a bit
cumbersome, I feel it is currently the best way to achieve fine grained
parameterized tests within our test suite without implementing a custom
TestTemplateInvocationContextProvider for each specific use case.

Once https://github.com/junit-team/junit5/issues/878 is resolved, we
should consider migrating to parameterized test classes.

See gh-23451
2019-08-17 11:36:47 +02:00
Sam Brannen e7e5cce735 Polish contribution
See gh-23457
2019-08-13 10:36:46 +02:00
Sauhard Sharma 91c0fbaadb Use valid example in Javadoc for @EnableWebFlux
This commit modifies the class-level Javadoc for the @EnableWebFlux
annotation to reference an actual method in WebFluxConfigurer.

Closes gh-23457
2019-08-13 10:27:29 +02:00
Sam Brannen d32cb7dac3 Avoid use of GenericTypeResolver.resolveParameterType() in tests
This commit avoids the use of the deprecated
GenericTypeResolver.resolveParameterType() method in tests in order to
avoid warnings in the Gradle build.
2019-08-07 14:23:15 +02:00
Juergen Hoeller dea9ad6cb2 Merge branch '5.1.x' 2019-07-31 23:53:32 +02:00
Juergen Hoeller 438b40f6d7 Consistent ordering of WebClient.Builder methods 2019-07-31 23:48:14 +02:00
Juergen Hoeller 30132b42c6 Consistent assertion messages in DefaultWebClient 2019-07-30 22:53:27 +02:00
Juergen Hoeller 3b235a098f Merge branch '5.1.x' 2019-07-30 22:52:20 +02:00
Juergen Hoeller 960079e5f5 Retain non-null HttpStatus return value in Client(Http)Response
See gh-23366
2019-07-30 22:26:46 +02:00
Arjen Poutsma ac9a11a581 Merge branch '5.1.x' 2019-07-30 18:03:01 +02:00
Arjen Poutsma 29ef985411 Add support for non-standard status codes
Added support for status codes that do not occur in HttpStatus in
DefaultClientResponseBuilder and made ClientResponse::statusCode
ClientHttpResponse::getStatusCode @Nullable.

Closed gh-23366
2019-07-30 17:44:47 +02:00
Juergen Hoeller c4622dbebc Polishing 2019-07-30 16:59:01 +02:00
Juergen Hoeller 22e87ac143 Polishing 2019-07-30 16:05:18 +02:00
Arjen Poutsma 571f6adb35 Merge branch '5.1.x' 2019-07-30 15:46:27 +02:00
Arjen Poutsma 6cb4b8bd43 Add onRawStatus to WebClient
- Add onRawStatus to WebClient.ResponseSpec, allowing users to deal with
  raw status codes that are not in HttpStatus.
- No longer throw an exception status codes not in HttpStatus.

Closes gh-23367
2019-07-30 15:10:33 +02:00
Stephane Maldini 50a909908c Remove unnecessary flushOnEach (since reactor-netty 0.9) 2019-07-30 10:54:51 +02:00
Sam Brannen f53cdb8bd2 Introduce common SimpleUrlHandlerMapping constructors
Prior to this commit, the SimpleUrlHandlerMapping classes in Spring MVC
and Spring Webflux only had default constructors. This lead to the fact
that users often had to explicitly invoke setUrlMap() and setOrder() on
the newly instantiated SimpleUrlHandlerMapping.

In order to simplify the programmatic setup of a SimpleUrlHandlerMapping
in common scenarios, this commit introduces the following constructors.

- SimpleUrlHandlerMapping()
- SimpleUrlHandlerMapping(Map<String, ?> urlMap)
- SimpleUrlHandlerMapping(Map<String, ?> urlMap, int order)

Closes gh-23362
2019-07-28 17:59:19 +02:00
Johnny Lim 7c45381600 Add since tag for ClientResponse.Builder.request()
Closes gh-23364
2019-07-26 11:07:48 +02:00
Arjen Poutsma 7b73418418 Add rawStatusCode() to ServerResponse in both WebFlux and Servlet
Closes gh-22872
2019-07-22 15:34:42 +02:00
Sam Brannen b0939a8af0 Suppress deprecation warnings in Gradle build 2019-07-21 13:12:02 +02:00
Sebastien Deleuze c006a83584 Upgrade to Coroutines 1.3.0-RC
This commit upgrades Coroutines support to kotlinx.coroutines
1.3.0-RC, leverages the new Coroutines BOM and refine Coroutines
detection to avoid false positives.

Only Coroutines to Mono context interoperability is supported
for now.

CLoses gh-23326
2019-07-21 11:27:43 +02:00
Juergen Hoeller 45136aabd4 Upgrade to Protobuf 3.9 (plus consistent XMLUnit declarations) 2019-07-20 19:06:54 +02:00
Sebastien Deleuze 095fd5bcb3 Use Kotlin BOM
Close gh-23316
2019-07-19 10:43:54 +02:00
Arjen Poutsma 8b7ed5f45e Added since tag 2019-07-18 15:37:33 +02:00
Arjen Poutsma d8838152b3 Copy ClientResponseEntity::toEntity* methods to ResponseSpec
This commit copies the toEntity and toEntityList methods from
ClientResponse to ResponseSpec, so that it is possible to retrieve
a ResponseEntity when using retrieve().

Closes gh-22368
2019-07-18 12:28:22 +02:00
Juergen Hoeller 94e3210ae7 Fix nullability warnings and javadoc-triggered package cycles 2019-07-17 22:34:07 +02:00
Arjen Poutsma 7fe0116599 Added since tag 2019-07-16 16:18:31 +02:00
Arjen Poutsma a9b3d95a14 Interpret empty mono from status handler as normal response
Prior to this commit, returning an empty mono from an exception handler
registered through ResponseSpec::onStatus would result in memory leaks
(since the response was not read) and in an empty response from bodyTo*
methods of the webclient.

As of this commit, that same empty mono is now interpreted to return
the body (and not an exception), offering a way to override the default
status handlers and return a normal response for 4xx and 5xx status
codes.
2019-07-16 15:53:21 +02:00
Arjen Poutsma dae4509152 Make sure built ClientResponses have HttpRequest 2019-07-15 09:40:02 +02:00
Rossen Stoyanchev c32299f734 Use HttpMessageNotWritableException instead of ISE
As a follow-up to the recent commit #37f9ce, this change replaces the
raised IllegalStateException with HttpMessageNotWritableException.

See gh-23205
2019-07-13 10:56:12 +01:00
Arjen Poutsma b4207823af Add ClientResponse::createException
This commit adds the createException() method to ClientResponse,
returning a delayed WebClientResponseException based on the status code,
headers, and body as well as the corresponding request.

Closes gh-22825
2019-07-12 14:51:54 +02:00
Rob Winch fde92793b5 Fix http URLs
See gh-22839
2019-07-11 18:14:20 +02:00
Sebastien Deleuze c8f8dfa39e Add engineSupplier property to ScriptTemplateConfigurer
This commit adds an engineSupplier property to ScriptTemplateConfigurer
and ScriptTemplateView in order to be able to customize the ScriptEngine
when sharedEngine is set to false.

This can be useful with Graal.js for example.

Closes gh-23258
2019-07-11 15:58:10 +02:00
Sebastien Deleuze c08035b674 Remove unused Coroutines extension parameter 2019-07-11 10:11:34 +02:00
Arjen Poutsma 2909de8829 Remove ServerWebExchange::getParts and ServerRequest::parts
Revert to state before DefaultMultipartMessageReader
2019-07-10 16:20:20 +02:00
Sam Brannen f0d599493e Cache encoded BASIC credentials in ExchangeFilterFunctions
Prior to this commit, the Basic Authentication credentials were encoded for
each request in ExchangeFilterFunctions.basicAuthentication(String, String).

This commit addresses this minor performance issue by encoding the
credentials prior to the creation of the lambda expression returned by
ExchangeFilterFunctions.basicAuthentication(String, String).

Closes gh-23256
2019-07-09 18:01:27 +02:00
Sebastien Deleuze ca75c2843a Upgrade to Coroutines 1.3.0-M2 2019-07-09 11:36:26 +02:00
Sebastien Deleuze 08a5196c3a Use elementClass and elementTypeRef consistently 2019-07-08 12:08:40 +02:00
Sebastien Deleuze 2b4d6ce354 Add body methods with Object parameter to WebFlux
The commit deprecates syncBody(Object) in favor of body(Object)
which has the same behavior in ServerResponse, WebClient and
WebTestClient. It also adds body(Object, Class) and
body(Object, ParameterizedTypeReference) methods in order to support
any reactive type that can be adapted to a Publisher via
ReactiveAdapterRegistry. Related BodyInserters#fromProducer
methods are provided as well.

Shadowed Kotlin body<T>() extensions are deprecated in favor of
bodyWithType<T>() ones, including dedicated Publisher<T> and
Flow<T> variants. Coroutines extensions are adapted as well, and
body(Object) can now be used with suspending functions.

Closes gh-23212
2019-07-07 22:27:57 +02:00
Juergen Hoeller d903b9acf5 Compatibility with RxJava 3.0
Closes gh-23208
2019-07-05 16:25:52 +02:00
Rossen Stoyanchev 97d020c509 Merge branch '5.1.x' 2019-07-05 10:55:49 +01:00
Rossen Stoyanchev 2aec175ccc Drain body after exception from applying onStatus
Closes gh-23230
2019-07-05 10:50:03 +01:00
Rossen Stoyanchev 37f9ce5cc9 Return 500 (not 406) if content-type was preset
If content-type is preset in the returned ResponseEntity, then any
failure to find a matching converter is a server error.

Closes gh-23205
2019-07-05 07:07:58 +01:00
Rossen Stoyanchev 03a342378a Merge branch '5.1.x' 2019-07-02 09:43:58 +01:00
Rossen Stoyanchev 29b7659094 Polish 2019-07-02 09:32:07 +01:00
Ilya Lukyanovich 27b5d2b288 Optional @RequestPart Mono arg resolves to Mono.empty
Closes gh-23060
2019-07-02 09:32:07 +01:00
Stephane Maldini 14afdb2bbc Remove unnecessary import 2019-06-25 17:42:01 -07:00
Stephane Maldini 339ee01233 Remove unnecessary flushOnEach (since reactor-netty 0.9) 2019-06-25 16:05:30 -07:00
Sam Brannen d0231cb29a Presort beans in ControllerAdviceBean.findAnnotatedBeans()
Prior to this commit, all clients of
ControllerAdviceBean.findAnnotatedBeans() sorted the returned list
manually. In addition, clients within the core Spring Framework
unnecessarily used AnnotationAwareOrderComparator instead of
OrderComparator to sort the list.

This commit presorts the ControllerAdviceBean list using OrderComparator
directly within ControllerAdviceBean.findAnnotatedBeans().

Closes gh-23188
2019-06-24 16:26:11 +03:00
Juergen Hoeller e2d01bb783 Merge branch '5.1.x' 2019-06-22 17:11:31 +02:00
Juergen Hoeller 29dcd19971 Upgrade to AspectJ 1.9.4, RxJava 2.2.10, Jetty 9.4.19, Undertow 2.0.22
Includes Hibernate Validator 6.0.17 and renames "withoutJclOverSlf4j".
2019-06-22 16:49:40 +02:00
Arjen Poutsma 92981ac9de Add Flux<Part> ServerRequest.parts()
This commit introduces Flux<Part> ServerRequest.parts() that delegates
to ServerWebExchange.getParts() and offers an alternative,
streaming way of accessing multipart data.

Closes gh-23131
2019-06-21 10:59:13 +02:00
Arjen Poutsma edd86e5dd5 Move RouterFunction WebHandler to inner class 2019-06-21 10:59:12 +02:00
Sebastien Deleuze e86b937f8c Leverage new Kotlin script templating support
As of 1.3.40, Kotlin now provides a kotlin-scripting-jsr223-embeddable
dependency which:
 - Fixes classloading related issues
 - Provides out of the box JSR 223 support
 - Is compatible with Spring Boot Fat Jar mechanism

This commit updates Spring Framework tests and documentation accordingly.

Closes gh-23165
2019-06-20 10:17:02 +02:00
Arjen Poutsma 30af01fd4e Use DataBufferUtils.write in DefaultFilePart.transferTo
This commit makes sure that in DefaultMultipartMessageReader's
DefaultFilePart, the file is not closed before all bytes are written,
by using DataBufferUtils.write (see c1b6885191d6a50347aeaa14da994f0db88f26fe).

The commit also improves on the logging of the
DefaultMultipartMessageReader.

Closes gh-23130
2019-06-14 14:13:18 +02:00
Sam Brannen 451cce4fe8 Do not override requestContextAttribute with null in UrlBasedViewResolvers
Prior to this commit, if a subclass of
org.springframework.web.servlet.view.AbstractView or
org.springframework.web.reactive.result.view.AbstractUrlBasedView
configured a custom value for the requestContextAttribute, that value
was overwritten with null whenever the View was dynamically
instantiated by a UrlBasedViewResolver, and this could lead to
confusing behavior for users of the View.

This commit addresses this issue by ensuring that the
UrlBasedViewResolvers in spring-webmvc and spring-webflux do not
override the requestContextAttribute in a View if the
UrlBasedViewResolver has not been explicitly configured with a custom
requestContextAttribute value.

Closes gh-23129
2019-06-13 17:42:14 +03:00
Sam Brannen eef9bc899f Avoid NPE in FreeMarkerView.getModelAttributes() in spring-webflux
This commit declares the model method parameter as @Nullable and adds
defensive guards against a null model argument.

Closes gh-23105
2019-06-13 01:40:22 +03:00
Sam Brannen 9fb973d4f3 Polish JavaDoc for FreeMarkerView in spring-webflux
See gh-23105
2019-06-12 22:42:29 +03:00
Sam Brannen a4f4ef9011 Update documentation for spring.ftl in spring-webflux
See gh-23105
2019-06-12 22:40:13 +03:00
Sam Brannen cc4593fda8 Improve FreeMarker macro support in spring-webflux
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
2019-06-12 17:00:21 +03:00
Juergen Hoeller 7e02358166 Merge branch '5.1.x' 2019-06-12 00:05:01 +02:00
Juergen Hoeller 33b5bc2aae Polishing 2019-06-11 23:50:29 +02:00
Juergen Hoeller 22aba8bf60 Upgrade to Apache HttpClient 4.5.9 2019-06-11 23:49:57 +02:00
Juergen Hoeller a89bfffd8c Merge branch '5.1.x' 2019-06-11 23:16:03 +02:00
Juergen Hoeller 7dc92aa05d Polishing 2019-06-11 20:57:27 +02:00
Rossen Stoyanchev 0757eaee9d Clear ProducesRequestCondition attribute
Closes gh-23091
2019-06-11 13:55:20 -04:00
Sam Brannen a5828ca14e Polish JavaDoc for AbstractView in spring-webflux 2019-06-11 16:28:25 +03:00
Sam Brannen 7a87d86b80 Fix documentation for FreeMarker `bind` macro in spring-webflux
See gh-23002
2019-06-10 16:39:54 +03:00
Sam Brannen 2f640fe205 Polish FreeMarker macro support in spring-webflux
See gh-23002
2019-06-10 16:13:20 +03:00
Sam Brannen ac28de0dc1 Polish Javadoc for FreeMarker support 2019-06-10 16:03:16 +03:00
Issam EL-ATIF b58f34d802 Add FreeMarker macro support in spring-webflux
Closes gh-23002
2019-06-09 16:30:05 +03:00
Rossen Stoyanchev 331463739d Merge branch '5.1.x' 2019-06-07 16:26:00 -04:00
Rossen Stoyanchev 9ce5a18d96 Ignore null attributes in AbstractView
Consistent with ConcurrentModel and also with treatment of empty values
from async attributes.

Closes gh-23038
2019-06-07 16:25:47 -04:00
Sebastien Deleuze 098ac0bbb8 Annotate Object#equals parameter with @Nullable
Closes gh-23093
2019-06-06 14:18:30 +02:00
Sebastien Deleuze 23e617160f Use a timeout != 0 in InvocableHandlerMethodTests 2019-06-05 11:52:08 +02:00
Сергей Цыпанов aaeabc3c85 Simplify iteration over maps
Closes gh-23053
2019-05-29 18:00:34 +02:00
Brian Clozel 4b8ce04bdc Mark Spring web config classes as proxyBeanMethods=false
Closes gh-23004
2019-05-28 19:11:35 +02:00
Sam Brannen 141ef9082f Clean up Mockito usage
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.
2019-05-28 13:59:43 +02:00
Phillip Webb 9d74da006c Migrate JUnit 4 assertions to AssertJ
Migrate all existing JUnit 4 `assert...` based assertions to AssertJ
and add a checkstyle rule to ensure they don't return.

See gh-23022
2019-05-23 15:52:49 -07:00
Phillip Webb 95a9d46a87 Migrate Hamcrest assertions to AssertJ
Migrate all existing `assertThat(..., Matcher)` assertions to AssertJ
and add checkstyle rules to ensure they don't return.

See gh-23022
2019-05-23 15:49:59 -07:00
Juergen Hoeller 8a33ef2d14 Merge branch '5.1.x' 2019-05-21 21:06:38 +02:00
Juergen Hoeller 5aa0de7ac8 Upgrade to OkHttp 3.14.2, Joda-Time 2.10.2, OpenPDF 1.2.17, JRuby 9.2.7 2019-05-21 20:47:06 +02:00
Arjen Poutsma 9b3c92e8d2 Add leading slash for path predicate if not present
This commit adds a leading slash for path predicates in both
WebFlux.fn and WebMvc.fn.

Closes gh-22795
2019-05-21 12:09:36 +02:00
Phillip Webb 02850f357f Migrate exception checking tests to use AssertJ
Migrate tests that use `@Test(expectedException=...)` or
`try...fail...catch` to use AssertJ's `assertThatException`
instead.
2019-05-20 10:47:53 -07:00
Rossen Stoyanchev bd910fc62b Fix checkstyle errors 2019-05-16 20:49:49 -04:00
Rossen Stoyanchev 60e4649ff3 Merge branch '5.1.x' 2019-05-16 20:42:09 -04:00
Rossen Stoyanchev da4430e27e BindingResult for resolved async attributes
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
2019-05-16 20:41:37 -04:00
Rossen Stoyanchev 172afb510a Polish AbstractView in WebFlux 2019-05-16 14:37:04 -04:00
stsypanov 9ca8681f79 Iteration over a map using EntrySet 2019-05-13 15:38:13 +02:00
Juergen Hoeller cfc4a59135 Merge branch '5.1.x' 2019-05-13 13:40:07 +02:00
Juergen Hoeller daee6f5bd9 Avoid expensive assertions in web resource resolution
Closes gh-22955
2019-05-13 13:28:07 +02:00
Sam Brannen 73dbd06361 Enforces static imports for JUnit 4 assertions and assumptions
This commit configures Checkstyle to enforces static imports for JUnit 4
assertions and assumptions.

See gh-22932
2019-05-12 15:13:07 +02:00
Sam Brannen 724c805211 Discontinue use of JUnit 3 APIs
This commit also ensures that the JSR-330 TCK is executed with the
normal build by adhering to naming conventions for test classes.

See gh-22894
2019-05-12 14:46:55 +02:00
Phillip Webb 798b51f4a3 Migrate to BDD Mockito
Migrate all tests to consistently use BDD Mockito. Also add
checksyle rule to enforce going forwards.
2019-05-08 13:46:13 -07:00
Phillip Webb 816bbee8de Remove '.*' imports from tests
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.
2019-05-08 09:55:09 -07:00
Juergen Hoeller d3b713d5f0 Upgrade to Protobuf 3.7.1 and HtmlUnit 2.35 2019-05-08 17:52:56 +02:00
Sam Brannen 4d1637a9b7 Avoid warnings in RequestMappingHandlerMappingTests 2019-05-08 16:29:31 +02:00
Phil Webb d7320de871 Migrate away from ExpectedException (#22922)
* 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
2019-05-08 16:25:52 +02:00
Arjen Poutsma 2352688ccb MultipartIntegrationTests should not bind to same part multiple times
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.
2019-05-08 12:10:20 +02:00
Rossen Stoyanchev 45147c23c1 Empty body checks in ConsumesRequestCondition
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
2019-05-07 22:03:36 -04:00
Arjen Poutsma 59f6044c09 Add route(RequestPredicate, HandlerFunction) to RouterFunctions builder
Closes gh-22701
2019-05-07 15:06:59 +02:00
Juergen Hoeller 28c5d7b586 Merge branch '5.1.x' 2019-05-07 02:12:11 +02:00
Juergen Hoeller d16beb0e55 Polishing
See gh-22900
2019-05-07 01:40:53 +02:00
Juergen Hoeller f56c70d2f0 Merge branch '5.1.x' 2019-05-07 01:23:16 +02:00
Stephane Maldini fd36d1efe6 Use explicit expectError(class.java) instead of reactor kotlin extension 2019-05-06 16:22:25 -07:00
Juergen Hoeller c841b62bb0 Consistent parameter retrieval across InvocableHandlerMethod variants
See gh-22900
2019-05-07 01:20:05 +02:00
Stephane Maldini 3f8be3416e Use explicit cast to avoid dependency on reactor-core kotlin extension 2019-05-06 16:13:05 -07:00
Juergen Hoeller 4b06d8e511 Merge branch '5.1.x' 2019-05-07 00:59:56 +02:00
Juergen Hoeller 3f85a7db1b Consistent exception naming across InvocableHandlerMethod variants
See gh-22900
2019-05-07 00:48:27 +02:00
Ippei Nawate 47ff92873b Add null check 2019-05-07 00:23:48 +02:00
Sebastien Deleuze e16a134075 Refine WebFlux Kotlin extensions
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
2019-05-06 11:00:58 +02:00
Sam Brannen 47c39304af Use assertThat from Hamcrest instead of JUnit 4
org.junit.Assert.assertThat() is deprecated as of JUnit 4.13.

See gh-22894
2019-05-05 18:27:38 +02:00
Juergen Hoeller 28039057fd Consistent naming of HandlerMethodArgumentResolver implementations
Includes combined imports of assertion methods and related polishing.

Closes #22889
2019-05-04 18:30:56 +02:00
Juergen Hoeller f0f6af2926 Merge branch '5.1.x' 2019-05-03 18:13:12 +02:00
Juergen Hoeller ea4a174583 Polishing 2019-05-03 18:10:41 +02:00
Juergen Hoeller 3d6476da46 Polishing 2019-05-03 17:29:22 +02:00
Juergen Hoeller a7949ac84a Consistent use of StringUtils.hasLength(String) vs isEmpty(Object) 2019-05-03 17:29:14 +02:00
Juergen Hoeller ec8689d1fc Merge branch '5.1.x' 2019-05-03 14:23:59 +02:00
Juergen Hoeller 84266d71e9 Polishing 2019-05-03 14:08:20 +02:00
Juergen Hoeller eaa9a78d5d Merge branch '5.1.x' 2019-05-03 00:23:57 +02:00
Juergen Hoeller 31c3b8a291 Avoid unguarded String concatenation for debug/trace logging
Closes gh-22874
2019-05-03 00:10:56 +02:00
Rossen Stoyanchev bd8d71be0e canWrite uses actual return value type if known
Closes gh-22803
2019-05-01 16:52:23 -04:00
Rossen Stoyanchev 07c9a0e1f5 Merge branch '5.1.x' 2019-05-01 04:03:21 -04:00
Rossen Stoyanchev b5327ef60f Fix regression in ProducesRequestCondition
Closes gh-22853
2019-05-01 02:59:19 -04:00
Juergen Hoeller 52657b68ea Merge branch '5.1.x' 2019-04-30 18:55:34 +02:00
Juergen Hoeller 90d4e9090c Polishing 2019-04-30 18:43:16 +02:00
Sebastien Deleuze 89454e69c3 Deprecate MediaType.APPLICATION_JSON_UTF8
This commit deprecates MediaType.APPLICATION_JSON_UTF8 and
MediaType.APPLICATION_PROBLEM_JSON_UTF8 in favor of
MediaType.APPLICATION_JSON and MediaType.APPLICATION_PROBLEM_JSON since
UTF-8 encoding is now handled correctly by most browsers
(related bug has been fixed in Chrome since September 2017).

MediaType.APPLICATION_JSON is now used as the default JSON content type.

Closes gh-22788
2019-04-30 16:11:50 +02:00
Juergen Hoeller f8dc8523da Merge branch '5.1.x' 2019-04-26 23:00:40 +02:00
Juergen Hoeller 1f473261a8 Polishing 2019-04-26 22:56:23 +02:00
Juergen Hoeller 55418b256d Merge branch '5.1.x' 2019-04-26 16:56:04 +02:00
Juergen Hoeller e5e2d2d661 Polishing (includes minor performance refinements from master) 2019-04-26 16:51:18 +02:00
Juergen Hoeller ad497c259a Merge branch '5.1.x' 2019-04-25 14:55:04 +02:00
Juergen Hoeller 42fda0ba15 Upgrade to Tomcat 9.0.19, Jetty 9.4.17, Netty 4.1.35, OkHttp 3.14.1
Includes upgrade to Hibernate ORM 5.3.10 (for branch 5.1.x)
2019-04-25 14:32:37 +02:00
Sebastien Deleuze aee2df8919 Improve WebFlux suspending handler method support
Support for suspending handler methods introduced in Spring
Framework 5.2 M1 does not detect types correctly and does not
support suspending handler methods returning Flow which is a
common use case with WebClient.

This commit fixes these issues and adds Coroutines integration
tests.

Closes gh-22820
Closes gh-22827
2019-04-23 11:32:32 +02:00
Rossen Stoyanchev de3238dbea Merge branch '5.1.x' 2019-04-16 21:08:54 -04:00
Rossen Stoyanchev 15b2fb1210 Polish
Replacing a couple of calls to Mono.fromCallable with Mono.just which
seems to work with doOnDiscard except when nested inside Flux.defer.
2019-04-16 20:52:19 -04:00
Rossen Stoyanchev 375090bb7c LeakAwareDataBuffer related fixes
Following on 3ebbfa2191 where the local
refCount was removed in favor of using the internal refCount of the
native data buffer, this commit ensures that LeakAwareDataBufferFactory
uses a PooledDataBufferFactory delegate by default.

There are also fixes for test issues with eager allocation uncovered by
these changes in StringDecoder and ResourceDecoder.
2019-04-16 20:52:19 -04:00
Sebastien Deleuze e84347554e Ignore Kotlin script templating tests
Ignore these tests for the time being since they trigger
a NoClassDefFoundError exception with Kotlin 1.3.30.
2019-04-12 11:17:19 +02:00
Rossen Stoyanchev d1f888a7a9 Empty path mapping behaves consistently
An empty path mapping in an @RequestMapping now consistently matches to
empty paths regardless of whether there are both type and method level,
annotations, or method-level only.

Closes gh-22543
2019-04-09 15:03:43 -04:00
Rossen Stoyanchev f839c1f9cd Remove warning about empty @RequestMapping path
See gh-22543
2019-04-09 15:03:43 -04:00
Sebastien Deleuze cd0b517abf Improve Kotlin documentation 2019-04-09 12:28:00 +02:00
Sam Brannen 85f05023c6 Pull WebFlux getMappingPathPatterns() implementation up in the hierarchy
This commit moves the WebFlux getMappingPathPatterns() implementation
from RequestMappingHandlerMapping to
RequestMappingInfoHandlerMapping so that subclasses of the latter no
longer need to re-implement the method.

See gh-22543
2019-04-09 10:58:04 +02:00
Sam Brannen 55b764bac3 Remove unused import
See gh-22543
2019-04-06 12:14:46 +02:00