In this tutorial, we will explore some advanced features of the OData V2 mock server.
If no OData V2 service is available or you simply don't want to depend on the OData back-end connectivity for your development and tests, the mock server can mimic the OData V2 back-end calls. It is designed to simulate an OData V2 provider by intercepting the HTTP communication made to the server, and providing a fake output. All this is transparent to the data binding and usage of the OData V2 model.
In certain scenarios, using only the built-in OData V2 simulation of the mock server is insufficient for completely server-independent tests. For example, if your application is using an OData feature that is not supported by the mock server, or if your application invokes a function import that depends on a server specific implementation (and thus is also not simulated generically). We will demonstrate how to use function callbacks in order to change existing mock requests.
Additionally, we will demonstrate how to mock an additional request that is not simulated out of the box by the OpenUI5 OData V2 mock server.
The tutorial describes how to use some advanced features of the mock server, disregarding the legal aspects of shipping mock data. Usually the mock data and mock server invocation is done in a test folder that is not shipped to customers. Be very careful that you don't ship mock data!
You don't have to do all tutorial steps sequentially, you can also jump directly to any step you want. Just download the code from the previous step, and start there.
You can view and download the files for all steps in the Demo Kit at Mock Server. Depending on your development environment you might have to adjust resource paths and configuration entries.
For more information check the Downloading Code for a Tutorial Step section of the tutorials overview page Get Started: Setup, Tutorials, and Demo Apps.
You should be familiar with the concepts explained in the Walkthrough Tutorial (JavaScript) tutorial and with the OData specification.
Related Information