Handles requests for a web service mock instance based on a given config.
The WebserviceMock assumes that requests and responses of the online web service are considered a black box from the test point of view. In other words: the SUT may perform any request and receive any response content to and from this web service mock. For the test it only matters that:
The SUT is tested in isolation from the online service: online service availability should not affect the test result.
The SUT is tested in a deterministic way: the response data is always the same.
Optionally the response can be changed.
For the above use case, it is required that when the SUT changes (for instance, new functionality is added), the replay data of the WebserviceMock can be re-created without a lot of effort. To allow this, the WebserviceMock can forward all requests to a WebserviceMockConfig.forwardBaseUri server and capture all responses into a
Replay responses are obtained from the
replay.db either when WebserviceMockConfig.requestResponseMode is set to RequestResponseMode.REPLAY_ONLY or set to RequestResponseMode.REPLAY_WHEN_AVAILABLE. Requests are forwarded to the WebserviceMockConfig.forwardBaseUri server when WebserviceMockConfig.requestResponseMode is set to RequestResponseMode.FORWARD or when set to RequestResponseMode.REPLAY_WHEN_AVAILABLE and the request was not found in the