Mock Data Usage
- 05 Dec 2022
-
DarkLight
-
PDF
Mock Data Usage
- Updated on 05 Dec 2022
-
DarkLight
-
PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Defined in action.json
- For each action there is an array of responseObjects. These tell the adapter the various responses that are available for the action.
- The adapter has a hierarchy for determining which response to use for a request.
- responseObjects
- mockFile: This is used by the adapter libraries when running in stub mode (not integrated) to tell the adapter where the mock data that should be returned is located. It should be a file within the entity (generally all mock data files are in the mockdatafiles directory to prevent clutter in the base entity directory).
Example: Action.json with mockdata file path
{
"name": "getIP",
"protocol": "REST",
"method": "GET",
"entitypath": "{base_path}/{version}/addresses/{pathv1}",
"schema": "schema.json",
"timeout": 3000,
"datatype": "PLAIN",
"sendEmpty": true,
"headers": {},
"responseObjects": [
{
"type": "default",
"key": "",
"mockFile": "mockdatafiles/getIP-default.json"
}
]
},
- Mock data files should be in a place defined in the action.json.
- In the above example, a file should exist in:
mockdatafiles/getIP-default.json
.
Was this article helpful?