{new} MockRemoteResource
The {@link oajr.mock2.MockRemoteResource} class is used for serverless unit testing of {@link oajrc.remote.RemoteResource @RemoteResource}-annotated classes.
The {@link oajr.mock2.MockRemoteResource} API requires a {@link oajr.annotation.RestResource @RestResource}-annotated class to be used as an underlying mocked resource to process the request and return a response.
It looks simple, but there's a lot going on here.
Remote resource interfaces are normally created through the {@link oajrc.RestClient#getRemoteResource(Class)} method.
The {@link oajr.mock2.MockRemoteResource} will create a {@link oajrc.RestClient} using a specialized
All aspects of the client and server side code are tested, yet no servlet container is required. The actual over-the-wire serialization is the only aspect being bypassed.
By default, the {@link oajr.mock2.MockRemoteResource} class uses JSON marshalling. This can be overridden via any of the following methods:
The {@link oajr.mock2.MockRemoteResource} class has a debug mode that will cause your HTTP requests and responses to be sent to the console on both the client and server sides: