Skip to content

Conversation

artembilan
Copy link
Member

Fixes #3986

The ReactiveStreamsConsumer in addition to plain Subscriber and MessageHandler also supports a ReactiveMessageHandler, but MockIntegrationContext doesn't handle a scenario when ReactiveMessageHandler is provided for consumer

  • Rework the logic in the MockIntegrationContext to substitute a ReactiveMessageHandler in the ReactiveStreamsConsumer which has a precedence in its logic over plain Subscriber.
  • Wrap a plain MessageHandler mock into a ReactiveMessageHandler before substitution in the ReactiveStreamsConsumer
  • Reset ReactiveStreamsConsumer.reactiveMessageHandler with source ReactiveMessageHandler or null respectively to an original ReactiveStreamsConsumer configuration
  • Mention ReactiveMessageHandler use-case in the testing.adoc

Cherry-pick to 5.5.x

Fixes spring-projects#3986

The `ReactiveStreamsConsumer` in addition to plain `Subscriber` and `MessageHandler`
also supports a `ReactiveMessageHandler`, but `MockIntegrationContext` doesn't
handle a scenario when `ReactiveMessageHandler` is provided for consumer

* Rework the logic in the `MockIntegrationContext` to substitute a `ReactiveMessageHandler`
in the `ReactiveStreamsConsumer` which has a precedence in its logic over plain `Subscriber`.
* Wrap a plain `MessageHandler` mock into a `ReactiveMessageHandler` before substitution
in the `ReactiveStreamsConsumer`
* Reset `ReactiveStreamsConsumer.reactiveMessageHandler` with source `ReactiveMessageHandler`
or `null` respectively to an original `ReactiveStreamsConsumer` configuration
* Mention `ReactiveMessageHandler` use-case in the `testing.adoc`

**Cherry-pick to `5.5.x`**
@garyrussell garyrussell merged commit 4283a55 into spring-projects:main Jan 9, 2023
@artembilan artembilan deleted the GH-3986 branch January 9, 2023 20:44
@garyrussell
Copy link
Contributor

...and cherry-picked as 3ed301e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When ReactiveMessageHandler support was introduced into ReactiveStreamsConsumer, MockIntegrationContext logic wasn't adjusted respectively.

2 participants