RESTEasy provides the Server-side Mock Framework for mocking server requests. Is there an equivalent for unit testing the client framework?
Is InMemoryClientExecutor intended for this purpose? I’m having trouble finding documentation and examples of how this class should be used.
Looks like
InMemoryClientExecutormay be used for client-side mocking. Looking in the source, it internally uses the same classes as the server-side mock framework, namely,MockHttpRequestandMockHttpResponse.InMemoryClientExecutorgives you the ability to overridecreateResponsefor mocking responses and also has a constructor which takes aDispatcher, if you want to customize and intercept calls that way.Here’s a quick and dirty snippet leveraging the client framework example,