{8.1.0-new, 8.1.2-updated} MockRemote
The {@link oajr.mock2.MockRemote} class is used for serverless unit testing of {@link oaj.http.remote.Remote @Remote}-annotated classes.
The {@link oajr.mock2.MockRemote} API requires a {@link oajr.annotation.Rest @Rest}-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#getRemote(Class)} method.
The {@link oajr.mock2.MockRemote} 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.MockRemote} class uses JSON marshalling. This can be overridden via any of the following methods:
The {@link oajr.mock2.MockRemote} 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: