Commit Graph

918 Commits

Author SHA1 Message Date
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