This repo contains additional plugin that might be used in Microsoft Graph Developer Proxy Plugin instead of the default mocks plugin. The conditional mock plugin allows to define multiple responses for the same request. The response which condition is met is returned.
The current installtion process is still to be clarified. Especially the part how to use the msgraph-developer-proxy-abstractions in a custom proxy plugin
- pull the Microsoft Graph Developer Proxy Plugin repo and build it
- pull this repo locally and build the project (in order to build you will need to restore NuGets and correct the reference to msgraph-developer-proxy-abstractions.dll file)
- copy the full output of the build to the location to GraphProxyPlugins catalog
- modify the
appsettings.json
file replacing the defaultMockResponsePlugin
plugin with the following:
{
"name": "ConditionalMockResponsePlugin",
"disabled": false,
"pluginPath": "GraphProxyPlugins\\msgraph-developer-proxy-plugin-conditional-mocks.dll",
"configSection": "mocksPlugin"
}
- start the Microsoft Graph Developer Proxy with
--mocks-file
option passing the path to mock.json file with conditional responses. Please check the sample response.sample.json file.
The current solution is still in preview/prototype stage. Before the release the following milestones must be fulfilled:
- Add possibility to define condition based on request headers
- Clarify the plugin install process
- Wait for the Microsoft Graph Developer Proxy release (align with it if needed)
This code is provided as is without warranty of any kind, either express or implied, including any implied warranties of fitness for a particular purpose, merchantability, or non-infringement.