You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add ability to mock an RSocket connection for better isolation & testability #935
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.
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.
Activity
spencergibb commentedon Sep 28, 2020
See spring-attic/spring-cloud-contract#1173
marcingrzejszczak commentedon Sep 28, 2020
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.
cheatmenot commentedon Jun 4, 2022
+1