Add ability to mock an RSocket connection for better isolation & testability · Issue #935 · rsocket/rsocket-java · GitHub
Skip to content

Add ability to mock an RSocket connection for better isolation & testability #935

Open

Description

@mkheck

Add ability to mock an RSocket connection within unit tests to isolate functionality to one end of an RSocket connection for testing.

Motivation

Without the ability to mock an RSocket connection in unit tests, unit tests effectively become integration tests. The (current) necessity to create both RSocket client and server within a unit test adds a large amount of indirectly-related code that falls outside of the scope of testing one end of the connection and its functionality.

Desired solution

Provide a mechanism to mock an RSocket connection.

Considered alternatives

Current solution is to create and configure both ends, RSocket client and server, prior to testing an RSocket client. This adds a considerable amount of code to even a simple test and reduces the clarity and concision of the test.

Additional context

N/A

Activity

  1. spencergibb commented on Sep 28, 2020

    @spencergibb
    Contributor
  2. added this to the 1.x Backlog milestone on Sep 28, 2020
  3. marcingrzejszczak commented on Sep 28, 2020

    @marcingrzejszczak
    Contributor

    If we're just talking about simple mocking it out then that's not enough. It would be great to have an option to teach this mock how to behave, store the mock definition in a file that can be shared. That means that the stubbed RSocket server should have an API to reach it and tell it how to behave. Having a http://wiremock.org but for RSocket would be fantastic.

  4. cheatmenot commented on Jun 4, 2022

    @cheatmenot

    +1

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions