Commit Graph

846 Commits

Author SHA1 Message Date
Сергей Цыпанов 7ef8cc9faf Tiny improvements regarding ArrayList creation
Closes gh-23047
2019-05-28 16:08:58 +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
Christoph Dreis 4e4145ac27 Avoid unnecessary call to get message type
Closes gh-23040
2019-05-28 07:21:08 +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
Rossen Stoyanchev 2294625cf0 Exposes STOMP frame stats
Closes gh-23015
2019-05-23 18:32:11 -04:00
Rossen Stoyanchev e09c5fd9e5 Use TaskExecutor instead of ThreadPoolTaskExecutor
Closes gh-22943
2019-05-23 14:26:51 -04:00
Rossen Stoyanchev 0b2fcbfe8a Use TaskScheduler instead of ThreadPoolTaskScheduler
Closes gh-22943
2019-05-23 14:01:05 -04:00
Rossen Stoyanchev 438d3710d3 Detect MimeType via ConnectionSetupPayload
Closes gh-23012
2019-05-21 14:07:59 -04: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
Johnny Lim 21e163e5da Fix typo 2019-05-20 16:41:05 +02:00
Rossen Stoyanchev 97c2de915a Add RouteMatcher
Closes gh-22642
2019-05-14 21:44:39 -04:00
stsypanov 9ca8681f79 Iteration over a map using EntrySet 2019-05-13 15:38:13 +02:00
Sam Brannen 0cff7eb32c Fix Javadoc links 2019-05-10 17:40:03 +02:00
Stephane Nicoll f188aab5f2 Merge branch '5.1.x' 2019-05-10 10:49:59 +02:00
chenqimiao e3137f11df Fix typo in package-info.java
Closes gh-22941
2019-05-10 10:49:13 +02:00
Rossen Stoyanchev 06c3a058f4 Use most recent RSocket RC for M2 release 2019-05-08 20:34:22 -04: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
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
Juergen Hoeller cdf51c3d51 Nullability refinements and related polishing 2019-05-08 00:27:56 +02:00
Juergen Hoeller 8eb9782ca2 Polishing 2019-05-07 12:43:36 +02:00
Juergen Hoeller 85cecb66e5 Consistent parameter retrieval across InvocableHandlerMethod variants
See gh-22900
2019-05-07 01:33:07 +02:00
Juergen Hoeller f56c70d2f0 Merge branch '5.1.x' 2019-05-07 01:23:16 +02:00
Juergen Hoeller c841b62bb0 Consistent parameter retrieval across InvocableHandlerMethod variants
See gh-22900
2019-05-07 01:20:05 +02:00
Juergen Hoeller 30a1f6fed5 Consistent exception naming across InvocableHandlerMethod variants
See gh-22900
2019-05-07 01:00:45 +02: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
Rossen Stoyanchev 15e1af2281 Protected methods to determine payload target type
Closes gh-22035
2019-05-06 09:34:21 -04: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 30bbf91dba Rename PayloadArgumentResolver to PayloadMethodArgumentResolver
Closes gh-22888
2019-05-04 17:35:34 +02:00
Juergen Hoeller 57984c5705 Move package annotation.support.reactive to annotation.reactive
Aligned with invocation.reactive and transaction.reactive packages.

Closes gh-22887
2019-05-04 17:34:32 +02:00
Sebastien Deleuze 2259ab7ff3 Polishing 2019-04-30 16:21:32 +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
Sebastien Deleuze 2e6059f6b0 Add coroutines support to RSocket @MessageMapping
Closes gh-22780
2019-04-30 15:48:18 +02:00
Sebastien Deleuze 842e7e5ef7 Add RSocketRequester coroutines extensions
See gh-22780
2019-04-30 09:36:35 +02:00
Rossen Stoyanchev 089fb5737d Replace create with wrap in RSocketRequester 2019-04-29 17:12:28 -04:00
Rossen Stoyanchev a1ad0285ca Default MimeType selection for RSocketRequester
Remove the dataMimeType argument on connect methods. Applications can
still configure it through the ClientRSocketFactory but it shouldn't
be necessary as we now choose a default MimeType from the supported
encoders and decoders.

Add an option to provide the RSocketStrategies instance (vs customizing
it) which is expected in Spring config where an RSocketStrategies
instance may be shared between client and server setups.
2019-04-29 15:22:01 -04:00
Rossen Stoyanchev 8888a65079 Polish RSocketRequester 2019-04-29 12:03:49 -04:00
Juergen Hoeller c4bd5abc3b Nullability refinements and related polishing 2019-04-26 17:41:43 +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
Brian Clozel b33d2f4634 Fix checkstyle errors 2019-04-23 15:10:11 +02:00
Brian Clozel 02904121a3 Add RSocketRequest.Builder in Spring Messaging
Prior to this commit, `RSocketRequester` would have a single
`RSocketRequester.create` static method taking a fully built
`RSocket` as an argument. Developers need to build an `RSocket`
instance using the `RSocketFactory` and then use it to create
a requester.

To help developers set up a requester, this commit adds a new
`RSocketRequester.Builder` interface and implementation. The
`RSocket` building phase and codecs configuration are part of a
single call chain. Subscribing to the returned
`Mono<RSocketRequester>` will configure and connect to the remote
RSocket server.

This design should be improved in gh-22798, since we will need to
support metadata in a broader fashion.

Closes gh-22806
2019-04-23 14:06:15 +02:00
Rossen Stoyanchev 4e63153886 Upgrade RSocket snapshot version 2019-04-18 12:49:36 -04:00
Rossen Stoyanchev 60d6b5a922 Add mutate method to RSocketStrategies
Closes gh-22799
2019-04-17 13:11:34 -04:00
Rossen Stoyanchev 5fc18064f2 Use encode with an Object value where feasible
Closes gh-22782
2019-04-11 19:00:28 -04:00
Rossen Stoyanchev f89d2ac148 Use decode from a DataBuffer where feasible
See gh-22782
2019-04-11 19:00:28 -04:00
Rossen Stoyanchev 6e7da62085 Switch to Reactor snapshots and remove workaround
Following the 5.2 M1 release we can switch back to Reactor snapshots
and remove the workaround for a fix coming in Reactor Core 3.2.9.
2019-04-10 16:09:28 -04:00
Brian Clozel cd69a4a03b Support DestinationVariable on RSocket handlers
Prior to this commit, the pattern destination variables were not set in
the message headers prior to calling the handler. In this case, the
`DestinationVariableMethodArgumentResolver` could not get the
destination variables from the message headers and resolve those as
handler arguments.

This commit mutates the message headers if the message destination
contains patterns.

Fixes gh-22776
2019-04-09 22:56:08 +02:00